
    	                         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
  \R                  " \R                  R                  5       " S	 S
\R                  5      5       rg)zZPrint an Artifact Registry IAM policy for Container Registry to Artifact Registry upgrade.    )absolute_import)division)unicode_literals)base)flags)upgrade_util)utilc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
PrintIamPolicy   aw  Print an Artifact Registry IAM policy for Container Registry to Artifact Registry upgrade.

Print an Artifact Registry IAM policy that is equivalent to the IAM policy
applied to the storage bucket for the specified Container Registry hostname.
Apply the returned policy to the Artifact Registry repository that will
replace the specified host. If the project has an organization, this command
analyzes IAM policies at the organization level. Otherwise, this command
analyzes IAM policies at the project level. See required permissions at
https://cloud.google.com/policy-intelligence/docs/analyze-iam-policies#required-permissions.
z{description}z  To print an equivalent Artifact Registry IAM policy for 'gcr.io/my-project':

      $ {command} upgrade print-iam-policy gcr.io --project=my-project
  )DESCRIPTIONEXAMPLESc                 L    [         R                  " 5       R                  U 5        g )N)r   GetGCRDomainArgAddToParser)parsers    8lib/surface/artifacts/docker/upgrade/print_iam_policy.pyArgsPrintIamPolicy.Args0   s    	''/    c                 r    UR                   n[        R                  " U5      n[        R                  " X#5      $ )zRuns the command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  An iam.Policy.
)DOMAINr	   
GetProjectr   
iam_policy)selfargsdomainprojects       r   RunPrintIamPolicy.Run4   s,     [[Food#G""633r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r   __static_attributes__r!   r   r   r   r      s1    	 %- 0 04r   r   N)r&   
__future__r   r   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.artifactsr   r   r	   ReleaseTracksReleaseTrackBETACommandr   r!   r   r   <module>r1      sV    a &  ' ( 6 = 5 D%%**+%4T\\ %4 ,%4r   