
    M                     ~    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr	  SSKJ
r  SSKJr  SS	KJr   " S
 S\5      rg)zApphub Service Projects API.    )absolute_import)division)unicode_literals)
list_pager)consts)utils)waiter)basec                   x    \ rS rSrSr\R                  R                  4S jrS r	  SS jr
S rS rS	 rS
 rSrg)ServiceProjectsClient   z*Client for service projects in apphub API.c                    [         R                  " U5      U l        [         R                  " U5      U l        U R                  R
                  U l        U R                  R                  U l        [        R                  " U R                  U R                  R                  5      U l        [        R                  " U R                  R                  5      U l        g )N)api_lib_utilsGetClientInstanceclientGetMessagesModulemessages,projects_locations_serviceProjectAttachments
_sp_clientprojects_locations_project_locations_clientr	   CloudOperationPollerprojects_locations_operations_pollerCloudOperationPollerNoResources_remove_poller)selfrelease_tracks     5lib/googlecloudsdk/api_lib/apphub/service_projects.py__init__ServiceProjectsClient.__init__   s    11-@DK!33MBDMkkNNDO%)[[%C%CD"..11DL !@@11D    c                 j    U R                   R                  US9nU R                  R                  U5      $ )zDescribe a service project in the Project/location.

Args:
  service_project: str, the name for the service project being described.

Returns:
  Described service project Resource.
name)r   :ApphubProjectsLocationsServiceProjectAttachmentsGetRequestr   Get)r   service_projectdescribe_reqs      r   DescribeServiceProjectsClient.Describe,   s8     ==[[ \ L ??|,,r"   Nc           	      z    U R                   R                  US9n[        R                  " U R                  USUUSS9$ )a  List service projects in the Projects/Location.

Args:
  parent: str, projects/{projectId}/locations/{location}
  limit: int or None, the total number of results to return.
    Default value is None
  page_size: int, the number of entries in each batch (affects requests
    made, but not the yielded results). Default value is 100.

Returns:
  Generator of matching service projects.
)parentserviceProjectAttachmentspageSize)field
batch_sizelimitbatch_size_attribute)r   ;ApphubProjectsLocationsServiceProjectAttachmentsListRequestr   YieldFromListr   )r   r-   r2   	page_sizelist_reqs        r   ListServiceProjectsClient.List:   sO    & 	QQ 	R 	
 
 ##)' r"   c                 b   U R                   R                  SU-   S9nU R                   R                  UUUS9nU R                  R	                  U5      nU(       a  U$ [
        R                  " U R                  U[        R                  R                  [        R                  R                  5      nU$ )aH  Add a service project in the Project/location.

Args:
  service_project: str, the name for the service project being created
  async_flag: Boolean value for async operation. If true the operation will
    be async
  parent: parent for service project resource

Returns:
  Service Project or Operation based on async flag value.
	projects/)serviceProject)r-   serviceProjectAttachmentserviceProjectAttachmentId)r   ServiceProjectAttachment=ApphubProjectsLocationsServiceProjectAttachmentsCreateRequestr   Creater   WaitForOperationr   api_lib_constsAddServiceProjectWAIT_FOR_ADD_MESSAGEADD_TIMELIMIT_SEC)r   r(   
async_flagr-   service_project_attachment
create_req	operationcreate_responses           r   AddServiceProjectsClient.AddZ   s    $ "&!G!G"_4 "H " \\!;#2 ] J
 &&z2I#44((==((::	O r"   c                 &   U R                   R                  US9nU R                  R                  U5      nU(       a  U$ [        R
                  " U R                  U[        R                  R                  [        R                  R                  5      nU$ )a$  Remove a service project in the Project/location.

Args:
  service_project: str, the name for the service project being deleted
  async_flag: Boolean value for async operation. If true the operation will
    be async

Returns:
  Empty Response Message or Operation based on async flag value.
r$   )r   =ApphubProjectsLocationsServiceProjectAttachmentsDeleteRequestr   Deleter   rB   r   rC   RemoveServiceProjectWAIT_FOR_REMOVE_MESSAGEREMOVE_TIMELIMIT_SEC)r   r(   rG   
remove_reqrJ   remove_responses         r   RemoveServiceProjectsClient.Remove   s     \\ ] J &&z2I#44++CC++@@	O r"   c                 v    U R                   R                  SU-   S-   S9nU R                  R                  U5      $ )z}Lookup a service project in the Project/location.

Args:
  service_project: Service project id

Returns:
   Service Project.
r;   /locations/globalr$   )r   <ApphubProjectsLocationsLookupServiceProjectAttachmentRequestr   LookupServiceProjectAttachment)r   r(   
lookup_reqs      r   LookupServiceProjectsClient.Lookup   sJ     [[?*-@@ \ J ))HH r"   c                 v    U R                   R                  SU-   S-   S9nU R                  R                  U5      $ )zpDetach a service project in the Project/location.

Args:
  service_project: Service project id

Returns:
  None
r;   rY   r$   )r   <ApphubProjectsLocationsDetachServiceProjectAttachmentRequestr   DetachServiceProjectAttachment)r   r(   
detach_reqs      r   DetachServiceProjectsClient.Detach   sJ     [[?*-@@ \ J ))HH r"   )r   r   r   r   r   r   )Nd   )__name__
__module____qualname____firstlineno____doc__r
   ReleaseTrackALPHAr    r*   r8   rL   rV   r]   rc   __static_attributes__ r"   r   r   r      sA    2#'#4#4#:#: -" 	@'R8"r"   r   N)rj   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.apphubr   rC   r   r   googlecloudsdk.api_lib.utilr	   googlecloudsdk.callioper
   objectr   rn   r"   r   <module>ru      s0    # &  ' ' B @ . (bF br"   