
                            d Z ddlmZ ddlmZ ddlmZ ddlmZ	 ddl
mZ ddl
mZ  ej                  ej                  j                        ej                   G d dej                                       Zd	d
ddde_        y)z)Command to get IAM policy for a resource.    )base_classes)base)flags)scope)backend_buckets_utilsc                   &    e Zd ZdZed        Zd Zy)GetIamPolicy7Get the IAM policy for a Compute Engine backend bucket.c                     t         j                  j                  |        t        j                  j                  |        y )N)r   &GLOBAL_REGIONAL_BACKEND_BUCKET_ARG_IAMAddArgumentr   URI_FLAGRemoveFromParser)parsers    5lib/surface/compute/backend_buckets/get_iam_policy.pyArgszGetIamPolicy.Args   s(    	00<<VDMM""6*    c                 P   t        j                  | j                               }|j                  }t        j
                  j                  ||j                  t        j                  j                  t        j                  |j                              }t        j                  ||      S )N)default_scopescope_lister)r   ComputeApiHolderReleaseTrackclientr   r   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALcompute_flagsGetDefaultScopeListerr   r	   )selfargsholderr   backend_bucket_refs        r   RunzGetIamPolicy.Run$   s    **4+<+<+>?F]]F44FF'1188&<<V]]K	 	G 	
  !--.@&IIr   N)__name__
__module____qualname____doc__staticmethodr   r%    r   r   r	   r	      s      @+ +Jr   r	   r
   a  
      *{command}* displays the IAM policy associated with a
    Compute Engine backend bucket in a project. If formatted as JSON,
    the output can be edited and used as a policy file for
    set-iam-policy. The output includes an "etag" field
    identifying the version emitted and allowing detection of
    concurrent policy updates; see
    $ {parent} set-iam-policy for additional details.  z    To print the IAM policy for a given backend bucket, run:

      $ {command} my-backend-bucket --region=REGION

      $ {command} my-backend-bucket --global

      $ {command} my-backend-bucket
      z        This command uses the compute/alpha API. The full documentation for this
    API can be found at: https://cloud.google.com/compute/)briefDESCRIPTIONEXAMPLESzAPI REFERENCEN)r)   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r   r   r   2googlecloudsdk.command_lib.compute.backend_bucketsr   ReleaseTracksr   ALPHADefaultUniverseOnlyListCommandr	   detailed_helpr+   r   r   <module>r8      s    0 8 ( E E T D D%%++,J4## J  -J0 G;	
>- r   