
    o                     B    d Z ddlmZ ddlmZ ddlmZ  G d de      Z	y)zQCommon utility functions for Developer Connect Insights Configs Discover App Hub.    )
list_pager)utils)basec                   "    e Zd ZdZd Z	 	 ddZy)DiscoveredWorkloadsClientz#Client for workloads in apphub API.c                     t         j                  j                  }t        j                  |      | _        t        j                  |      | _        | j
                  j                  | _	        y )N)
r   ReleaseTrackGAapi_lib_utilsGetClientInstanceclientGetMessagesModulemessages)projects_locations_applications_workloads_app_workloads_client)selfrelease_tracks     Plib/googlecloudsdk/api_lib/developer_connect/insights_configs/discover_apphub.py__init__z"DiscoveredWorkloadsClient.__init__   sL    %%((M11-@DK!33MBDM== 	    Nc                     | j                   j                  |      }t        j                  | j                  |d||d      S )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   ListzDiscoveredWorkloadsClient.List!   sQ    ( 	MM 	N 	
 
 ##""' r   )Nd   )__name__
__module____qualname____doc__r   r#    r   r   r   r      s    + 	r   r   N)
r(   apitools.base.pyr   googlecloudsdk.api_lib.apphubr   r   googlecloudsdk.callioper   objectr   r)   r   r   <module>r.      s      X ' @ (* *r   