
    A                     B    S r SSKJr  SSKJr  SSKJr   " S S\5      r	g)z Apphub Discovered Workloads API.    )
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)DiscoveredWorkloadsClient   z#Client for workloads 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_discoveredWorkloads_dis_workloads_client)selfrelease_tracks     9lib/googlecloudsdk/api_lib/apphub/discovered_workloads.py__init__"DiscoveredWorkloadsClient.__init__   s;    11-@DK!33MBDM:: 	    c                 j    U R                   R                  US9nU R                  R                  U5      $ )zDescribe a Discovered Workload in the Project/location.

Args:
  discovered_workload: str, the name for the discovered workload being
    described.

Returns:
  Described discovered workload Resource.
)name)r   4ApphubProjectsLocationsDiscoveredWorkloadsGetRequestr   Get)r   discovered_workloaddescribe_reqs      r   Describe"DiscoveredWorkloadsClient.Describe!   s=     	JJ$ 	K 	
 
 %%)),77r   Nc           	      z    U R                   R                  US9n[        R                  " U R                  USUUSS9$ )a  List discovered workloads 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 workloads.
parentdiscoveredWorkloadspageSize)field
batch_sizelimitbatch_size_attribute)r   5ApphubProjectsLocationsDiscoveredWorkloadsListRequestr   YieldFromListr   )r   r!   r&   	page_sizelist_reqs        r   ListDiscoveredWorkloadsClient.List2   sQ    & 	KK 	L 	
 
 ##""#' r   c           
      |    U R                   R                  US9n[        R                  " U R                  USSUUSS9$ )a  List unregistered discovered workloads 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 workloads.
r    FindUnregisteredr"   r#   )methodr$   r%   r&   r'   )r   AApphubProjectsLocationsDiscoveredWorkloadsFindUnregisteredRequestr   r)   r   )r   r!   r&   r*   find_unregistered_reqs        r   r/   *DiscoveredWorkloadsClient.FindUnregisteredR   sR    $ !MMkk l  ##""!#' r   c                 l    U R                   R                  UUS9nU R                  R                  U5      $ )aP  Lookup a discovered workload in the Project/location with a given uri.

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

Returns:
   discoveredWorkload: Discovered workload
)r!   uri)r   7ApphubProjectsLocationsDiscoveredWorkloadsLookupRequestr   Lookup)r   r!   r5   
lookup_reqs       r   r7    DiscoveredWorkloadsClient.Lookupq   s@     	MM 	N 	
  %%,,Z88r   )r   r   r   )Nd   )__name__
__module____qualname____firstlineno____doc__r   ReleaseTrackALPHAr   r   r,   r/   r7   __static_attributes__ r   r   r   r      s>    +#'#4#4#:#: 8( 	F 	>9r   r   N)
r?   apitools.base.pyr   googlecloudsdk.api_lib.apphubr   r
   googlecloudsdk.callioper   objectr   rC   r   r   <module>rH      s#    ' ( @ (l9 l9r   