
    	                        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 rS r\R                   " \R"                  R$                  \R"                  R&                  5       " S S\R(                  5      5       r\R                   " \R"                  R,                  5       " S S\R(                  5      5       rg)z!Fetch the IAM policy for a model.    )absolute_import)division)unicode_literals)models)base)endpoint_util)flags)models_util)region_utilc                     [         R                  " SSSS9R                  U 5        [         R                  " SS9R                  U 5        [        R
                  R                  U 5        g )NTzto set IAM policy for)
positionalrequiredverb)include_global)r	   GetModelResourceArgAddToParserGetRegionArgr   URI_FLAGRemoveFromParserparsers    0lib/surface/ai_platform/models/get_iam_policy.py_AddGetIamPolicyArgsr      sM    "$$/K$7D)55f=--  (    c                     [         R                  " U 5      n[        R                  " US9   [        R
                  " [        R                  " 5       U R                  5      sS S S 5        $ ! , (       d  f       g = f)N)region)	r   	GetRegionr   MlEndpointOverridesr
   GetIamPolicyr   ModelsClientmodel)argsr   s     r   _Runr#   %   sI      &&((7##F$7$7$94::F 877s   4A))
A7c                   .    \ rS rSrSr\S 5       rS rSrg)GetIamPolicyBeta+   Get the IAM policy for a model.

Gets the IAM policy for the given model.

Returns an empty policy if the resource does not have a policy set.

## EXAMPLES

The following command gets the IAM policy for the model `my_model`:

  $ {command} my_model
c                     [        U 5        g Nr   r   s    r   ArgsGetIamPolicyBeta.Args:   
     r   c                     [        U5      $ r)   r#   selfr"   s     r   RunGetIamPolicyBeta.Run>       :r    N	__name__
__module____qualname____firstlineno____doc__staticmethodr+   r2   __static_attributes__r5   r   r   r%   r%   +         ! !r   r%   c                   .    \ rS rSrSr\S 5       rS rSrg)r   B   r'   c                     [        U 5        g r)   r*   r   s    r   r+   GetIamPolicy.ArgsQ   r-   r   c                     [        U5      $ r)   r/   r0   s     r   r2   GetIamPolicy.RunU   r4   r   r5   Nr6   r5   r   r   r   r   B   r>   r   r   N)r;   
__future__r   r   r    googlecloudsdk.api_lib.ml_enginer   googlecloudsdk.callioper   $googlecloudsdk.command_lib.ml_enginer   r	   r
   r   r   r#   ReleaseTracksReleaseTrackALPHABETAListCommandr%   GAr   r5   r   r   <module>rO      s    ( &  ' 3 ( > 6 < <)G D%%++T->->-C-CDt''  E, D%%(()4##  *r   