
    }                     B    S r SSKJr  SSKJr  SSKJr   " S S\5      r	g)zQCommon utility functions for Developer Connect Insights Configs Discover App Hub.    )
list_pager)utils)basec                   :    \ rS rSrSrS r  SS jr  SS jrSrg)	DiscoveredApphubClient   z1Client for workloads and services in App Hub API.c                    [         R                  R                  n[        R                  " U5      U l        [        R                  " U5      U l        U R
                  R                  U l	        U R
                  R                  U l        g )N)r   ReleaseTrackGAapi_lib_utilsGetClientInstanceclientGetMessagesModulemessages)projects_locations_applications_workloads_app_workloads_client(projects_locations_applications_services_app_services_client)selfrelease_tracks     Plib/googlecloudsdk/api_lib/developer_connect/insights_configs/discover_apphub.py__init__DiscoveredApphubClient.__init__   sc    %%((M11-@DK!33MBDM== 	 	<< 	    Nc           	      z    U R                   R                  US9n[        R                  " U R                  USUUSS9$ )a  List application workloads in the Projects/Location.

Args:
  parent: str,
    projects/{projectId}/locations/{location}/applications/{application}
  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 application workloads.
parent	workloadspageSizefield
batch_sizelimitbatch_size_attribute)r   7ApphubProjectsLocationsApplicationsWorkloadsListRequestr   YieldFromListr   r   r   r#   	page_sizelist_reqs        r   list_workloads%DiscoveredApphubClient.list_workloads$   sQ    ( 	MM 	N 	
 
 ##""' r   c           	      z    U R                   R                  US9n[        R                  " U R                  USUUSS9$ )a  List application services in the Projects/Location.

Args:
  parent: str,
    projects/{projectId}/locations/{location}/applications/{application}
  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 application services.
r   servicesr   r    )r   6ApphubProjectsLocationsApplicationsServicesListRequestr   r&   r   r'   s        r   list_services$DiscoveredApphubClient.list_servicesE   sQ    ( 	LL 	M 	
 
 ##!!' r   )r   r   r   r   )Nd   )	__name__
__module____qualname____firstlineno____doc__r   r*   r/   __static_attributes__ r   r   r   r      s%    9	 	H 	r   r   N)
r6   apitools.base.pyr   googlecloudsdk.api_lib.apphubr   r   googlecloudsdk.callioper   objectr   r8   r   r   <module>r=      s"     X ' @ (NV Nr   