
                         V    S r SSKJr  SSKJr  SSKJr  SrSrS r	S r
 " S	 S
\5      rg)z2Utilities for Package Rollouts ResourceBundle API.    )
list_pager)util)waiterpageSizez1configdelivery.projects.locations.resourceBundlesc                     SU  SU 3$ )N	projects//locations/ )projectlocations     Glib/googlecloudsdk/api_lib/container/fleet/packages/resource_bundles.py_ParentPathr      s    WI[
	33    c                     SU  SU SU 3$ )Nr   r	   z/resourceBundles/r
   )r   r   names      r   _FullyQualifiedPathr      s    WI[
2CD6	JJr   c                   V    \ rS rSrSrSS jrSS jrSS jrSS jrS r	   SS	 jr
S
rg)ResourceBundlesClient"   zCClient for ResourceBundles in Config Delivery Package Rollouts API.Nc                    U=(       d    [         R                  U l        U=(       d     [         R                  " U R                  5      U l        U=(       d     [         R
                  " U R                  5      U l        U R                  R                  U l        [        R                  " U R                  R                  S S9U l        g )Nc                     U R                   $ Nr   )xs    r   <lambda>0ResourceBundlesClient.__init__.<locals>.<lambda>,   s    r   )operation_serviceget_name_func)r   DEFAULT_API_VERSION_api_versionGetClientInstanceclientGetMessagesModulemessages"projects_locations_resourceBundles_servicer   CloudOperationPollerNoResourcesprojects_locations_operationsresource_bundle_waiter)selfapi_versionr"   r$   s       r   __init__ResourceBundlesClient.__init__%   s    #?t'?'?DED2243D3DEDKC 6 6t{{ CDMKKBBDM"("H"H++CC&#Dr   c           	          U R                   R                  [        X5      S9n[        R                  " U R
                  USUU[        S9$ )a]  List ResourceBundles from Package Rollouts API.

Args:
  project: GCP project id.
  location: Valid GCP location (e.g. us-central1).
  limit: int or None, the total number of results to return.
  page_size: int, the number of entries in each batch (affects requests
    made, but not the yielded results).

Returns:
  Generator of matching devices.
)parentresourceBundles)field
batch_sizelimitbatch_size_attribute)r$   9ConfigdeliveryProjectsLocationsResourceBundlesListRequestr   r   YieldFromListr&   "_LIST_REQUEST_BATCH_SIZE_ATTRIBUTE)r*   r   r   r3   	page_sizelist_requests         r   ListResourceBundlesClient.List/   sT     	OOw1 	P 	
 
 ##? r   c                    [        XU5      nU R                  R                  XTSS9nU R                  R                  U[	        X5      US9n[
        R                  " U R                  U R                  R                  U5      SU 35      nU$ )a  Create ResourceBundle for Package Rollouts API.

Args:
  project: GCP project id.
  location: Valid GCP location (e.g. us-central1).
  name: Name of the ResourceBundle.
  description: Description of the ResourceBundle.

Returns:
  Created ResourceBundle resource.
Nr   descriptionlabels)resourceBundler/   resourceBundleIdzCreating ResourceBundle )
r   r$   ResourceBundle;ConfigdeliveryProjectsLocationsResourceBundlesCreateRequestr   r   WaitForr)   r&   Create)	r*   r   r   r   r>   fully_qualified_pathresource_bundlecreate_requestresults	            r   rE   ResourceBundlesClient.CreateJ   s     /w$Gmm22!4 3 O ]]^^&7- _ N
 ^^##^,
"4&)F
 Mr   c                     [        XU5      nU R                  R                  XTS9n[        R                  " U R
                  U R                  R                  U5      SU 35      $ )zDelete a ResourceBundle resource.

Args:
  project: GCP project id.
  location: Valid GCP location (e.g., us-central1).
  name: Name of the ResourceBundle.
  force: Nested resource deletion flag.

Returns:
  Empty Response Message.
)r   forcezDeleting ResourceBundle )r   r$   ;ConfigdeliveryProjectsLocationsResourceBundlesDeleteRequestr   rD   r)   r&   Delete)r*   r   r   r   rL   rF   
delete_reqs          r   rN   ResourceBundlesClient.Deletef   sf     /w$GZZ! [ J >>##Z(
"4&) r   c                     [        XU5      nU R                  R                  US9nU R                  R	                  U5      $ )zDescribe a ResourceBundle resource.

Args:
  project: GCP project id.
  location: Valid GCP location (e.g., us-central1).
  name: Name of the ResourceBundle.

Returns:
  Requested ResourceBundle resource.
r   )r   r$   8ConfigdeliveryProjectsLocationsResourceBundlesGetRequestr&   Get)r*   r   r   r   rF   describe_reqs         r   DescribeResourceBundlesClient.Describe|   sH     /w$GNN% 	O 	
 
 ==\**r   c                     [        XU5      nU R                  R                  XtUS9nU R                  R                  UUUS9n	[        R
                  " U R                  U R                  R                  U	5      SU 35      $ )aj  Update ResourceBundle for Package Rollouts API.

Args:
  project: GCP project id.
  location: Valid GCP location (e.g. us-central1).
  name: Name of the ResourceBundle.
  description: Description of the ResourceBundle.
  labels: Kubernetes labels to apply to your ResourceBundle.
  update_mask: Fields to be updated.

Returns:
  Updated ResourceBundle resource.
r=   )r@   r   
updateMaskzUpdating ResourceBundle )	r   r$   rB   :ConfigdeliveryProjectsLocationsResourceBundlesPatchRequestr   rD   r)   r&   Patch)
r*   r   r   r   r>   r?   update_maskrF   rG   update_requests
             r   UpdateResourceBundlesClient.Update   s    , /w$Gmm22!6 3 O ]]]]&! ^ N
 >>##N+
"4&) r   )r    r&   r"   r$   r)   )NN)Nd   r   )F)NNN)__name__
__module____qualname____firstlineno____doc__r,   r:   rE   rN   rU   r]   __static_attributes__r
   r   r   r   r   "   s.    K68,+0 #r   r   N)rd   apitools.base.pyr   /googlecloudsdk.api_lib.container.fleet.packagesr   googlecloudsdk.api_lib.utilr   r7   RESOURCE_BUNDLE_COLLECTIONr   r   objectr   r
   r   r   <module>rk      s8    9 ' @ .%/ "P 4KPF Pr   