
                         P    S r SSKJr  SSKJr  SrSrS rS rS r	 " S	 S
\
5      rg)z,Utilities for Package Rollouts Variants API.    )util)waiterpageSizezCconfigdelivery.projects.locations.resourceBundles.releases.variantsc                     SU  SU SU SU 3$ )N	projects//locations//resourceBundles/
/releases/ )projectlocationparent_bundleparent_releases       ?lib/googlecloudsdk/api_lib/container/fleet/packages/variants.py_ParentPathr      s%    WI[
2CM?R\]k\l	mm    c           
      H    UR                  SS5      nSU  SU SU SU SU 3
$ )N.-r   r   r	   r
   z
/variants/)replace)r   r   resource_bundlereleasevariantnames         r   _FullyQualifiedPathr      s?    	c	"$WI[
2COCTT^_c^ddnovnw	xxr   c                     [        XX#U5      $ N)r   )r   r   r   r   r   s        r   GetFullyQualifiedPathr   "   s    	7
 r   c                   .    \ rS rSrSrSS jr SS jrSrg)	VariantsClient(   z<Client for Variants 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                   $ r   )r   )xs    r   <lambda>)VariantsClient.__init__.<locals>.<lambda>4   s    r   )operation_serviceget_name_func)r   DEFAULT_API_VERSION_api_versionGetClientInstanceclientGetMessagesModulemessages4projects_locations_resourceBundles_releases_variants_servicer   CloudOperationPollerNoResourcesprojects_locations_operationsvariant_waiter)selfapi_versionr,   r.   s       r   __init__VariantsClient.__init__+   s    #?t'?'?DED2243D3DEDKC 6 6t{{ CDMHH 	M !@@++CC&Dr   c                    [        XEXU5      nU R                  R                  USUS9nU R                  R                  [	        XEX5      UUS9n	[
        R                  " U R                  U R                  R                  U	5      SU 35      $ )a:  Create Variant for a Release.

Args:
  resource_bundle: Name of parent ResourceBundle.
  release: Name of parent Release.
  name: Name of the Variant.
  project: GCP Project ID.
  location: Valid GCP location (e.g., uc-central1)
  variant_resources: Resources of the Variant.

Returns:
  Created Variant resource.
N)r   labels	resources)parentr   	variantIdzCreating Variant )
r   r.   VariantKConfigdeliveryProjectsLocationsResourceBundlesReleasesVariantsCreateRequestr   r   WaitForr3   r0   Create)
r4   r   r   r   r   r   variant_resourcesfully_qualified_pathr   create_requests
             r   r@   VariantsClient.Create7   s    , /?T mm##!# $ G
 ]]nn7oG o N
 >>^,
012 r   )r*   r0   r,   r.   r3   )NNr   )__name__
__module____qualname____firstlineno____doc__r6   r@   __static_attributes__r   r   r   r    r    (   s    D
& 'r   r    N)rI   /googlecloudsdk.api_lib.container.fleet.packagesr   googlecloudsdk.api_lib.utilr   "_LIST_REQUEST_BATCH_SIZE_ATTRIBUTEVARIANT_COLLECTIONr   r   r   objectr    r   r   r   <module>rP      s9    3 @ .%/ "Z ny
6V 6r   