
                            S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  SS	KJr  SS
KJr  S r\R&                  " \R(                  R*                  5       " S S\R,                  5      5       r\R&                  " \R(                  R0                  5       " S S\5      5       r\R&                  " \R(                  R4                  5       " S S\5      5       rSSS.\l        g)zCreate resource policy command.    )absolute_import)division)unicode_literals)base_classes)utils)apis)base)flags)utilc                 
   [         R                  " SU5      n[        R                  " 5       R	                  U 5        [        R
                  " U 5        [        R                  " XU5        U R                  R                  S5        g)z?A helper function to build args based on different API version.computeN)	r   GetMessagesModuler
   MakeResourcePolicyArgAddArgumentAddCommonArgsAddGroupPlacementArgsdisplay_infoAddCacheUpdater)parserapi_versiontrackmessagess       ?lib/surface/compute/resource_policies/create/group_placement.py_CommonArgsr      s]    ##I{;(++F3ff6%%d+    c                   .    \ rS rSrSr\S 5       rS rSrg)CreateGroupPlacement'   8Create a Compute Engine group placement resource policy.c                 j    [        U [        R                  [        R                  R
                  5        g N)r   compute_apiCOMPUTE_ALPHA_API_VERSIONr	   ReleaseTrackALPHAr   s    r   ArgsCreateGroupPlacement.Args+   s#    ==!!'')r   c                 ,   [         R                  " U R                  5       5      nUR                  n[        R
                  " 5       R                  UUR                  [        R                  " UR                  5      S9nUR                  R                  n[        R                  " XAUU R                  5       5      nUR                  UUR                  UR                  S9nUR                  R                   R"                  nUR%                  USU4/5      S   $ )N)scope_lister)resourcePolicyprojectregionInsertr   )r   ComputeApiHolderr$   clientr
   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   r   MakeGroupPlacementPolicy$ComputeResourcePoliciesInsertRequestr,   r-   apitools_clientresourcePoliciesMakeRequests)	selfargsholderr0   
policy_refr   resource_policycreate_requestservices	            r   RunCreateGroupPlacement.Run0   s    **4+<+<+>?F]]F,,.@@"88G A IJ
 }}%%H33Jh484E4E4GIOBB&""   C "N
 mm++<<G(N CDEaHHr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr'   rA   __static_attributes__rC   r   r   r   r   '   s    @) )Ir   r   c                   (    \ rS rSrSr\S 5       rSrg)CreateGroupPlacementBetaE   r   c                 j    [        U [        R                  [        R                  R
                  5        g r!   )r   r"   COMPUTE_BETA_API_VERSIONr	   r$   BETAr&   s    r   r'   CreateGroupPlacementBeta.ArgsI   s#    <<!!&&(r   rC   NrD   rE   rF   rG   rH   rI   r'   rJ   rC   r   r   rL   rL   E   s    @( (r   rL   c                   (    \ rS rSrSr\S 5       rSrg)CreateGroupPlacementGaO   r   c                 j    [        U [        R                  [        R                  R
                  5        g r!   )r   r"   COMPUTE_GA_API_VERSIONr	   r$   GAr&   s    r   r'   CreateGroupPlacementGa.ArgsS   s#    ::!!$$&r   rC   NrR   rC   r   r   rT   rT   O   s    @& &r   rT   z9Create a Compute Engine Group Placement Resource Policy.
zTo create a Compute Engine group placement policy with two
availability domains, run:
  $ {command} my-resource-policy --region=REGION --availability-domain-count=2
)DESCRIPTIONEXAMPLESN)rH   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r"   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r3   4googlecloudsdk.command_lib.compute.resource_policiesr   r   ReleaseTracksr$   r%   CreateCommandr   rP   rL   rX   rT   detailed_helprC   r   r   <module>re      s    & &  ' 7 ? , ( E F E, D%%++,I4-- I -I: D%%**+(3 ( ,( D%%(()&1 & *&		&  "r   