
                         f    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	\5      rg
)zApphub Discovered Services API.    )absolute_import)division)unicode_literals)
list_pager)utils)basec                   t    \ rS rSrSr\R                  R                  4S jrS r	  S
S jr
  S
S jrS rS	rg)DiscoveredServicesClient   z"Client for services in apphub API.c                     [         R                  " U5      U l        [         R                  " U5      U l        U R                  R
                  U l        g )N)api_lib_utilsGetClientInstanceclientGetMessagesModulemessages%projects_locations_discoveredServices_dis_services_client)selfrelease_tracks     8lib/googlecloudsdk/api_lib/apphub/discovered_services.py__init__!DiscoveredServicesClient.__init__   s;    11-@DK!33MBDM99 	    c                 j    U R                   R                  US9nU R                  R                  U5      $ )zDescribe a Discovered Service in the Project/location.

Args:
  discovered_service: str, the name for the discovered service being
    described.

Returns:
  Described discovered service Resource.
)name)r   3ApphubProjectsLocationsDiscoveredServicesGetRequestr   Get)r   discovered_servicedescribe_reqs      r   Describe!DiscoveredServicesClient.Describe$   s=     	II# 	J 	
 
 $$((66r   Nc           	      z    U R                   R                  US9n[        R                  " U R                  USUUSS9$ )a  List discovered services that could be added to an application.

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 discovered services.
parentdiscoveredServicespageSize)field
batch_sizelimitbatch_size_attribute)r   4ApphubProjectsLocationsDiscoveredServicesListRequestr   YieldFromListr   )r   r$   r)   	page_sizelist_reqs        r   ListDiscoveredServicesClient.List5   sQ    & 	JJ 	K 	
 
 ##!!"' r   c           
      |    U R                   R                  US9n[        R                  " U R                  USSUUSS9$ )a  List unregistered discovered services 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 discovered services.
r#   FindUnregisteredr%   r&   )methodr'   r(   r)   r*   )r   @ApphubProjectsLocationsDiscoveredServicesFindUnregisteredRequestr   r,   r   )r   r$   r)   r-   find_unregistered_reqs        r   r2   )DiscoveredServicesClient.FindUnregisteredU   sR    $ !MMjj k  ##!!!"' r   c                 l    U R                   R                  UUS9nU R                  R                  U5      $ )aL  Lookup a discovered service in the Project/location with a given uri.

Args:
  parent: str, projects/{projectId_or_projectNumber}/locations/{location}
  uri: str, GCP resource URI to find service for Accepts both project number
    and project id and does translation when needed.

Returns:
   discoveredService: Discovered service
)r$   uri)r   6ApphubProjectsLocationsDiscoveredServicesLookupRequestr   Lookup)r   r$   r8   
lookup_reqs       r   r:   DiscoveredServicesClient.Lookupt   s@     	LL 	M 	
  $$++J77r   )r   r   r   )Nd   )__name__
__module____qualname____firstlineno____doc__r   ReleaseTrackALPHAr   r    r/   r2   r:   __static_attributes__ r   r   r
   r
      s>    *#'#4#4#:#: 7( 	F 	>8r   r
   N)rB   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.apphubr   r   googlecloudsdk.callioper   objectr
   rF   r   r   <module>rL      s*    & &  ' ' @ (l8v l8r   