
    	                        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
 ddl	mZ dd	l	mZ dd
l	mZ d Zd Z ej                   ej"                  j$                  ej"                  j&                         G d dej(                               Z ej                   ej"                  j,                         G d dej(                               Zy)z!Fetch the IAM policy for a model.    )absolute_import)division)unicode_literals)models)base)endpoint_util)flags)models_util)region_utilc                     t        j                  ddd      j                  |        t        j                  d      j                  |        t        j
                  j                  |        y )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                     t        j                  |       }t        j                  |      5  t	        j
                  t        j                         | j                        cd d d        S # 1 sw Y   y xY w)N)region)	r   	GetRegionr   MlEndpointOverridesr
   GetIamPolicyr   ModelsClientmodel)argsr   s     r   _Runr#   %   sI      &&((7##F$7$7$94::F 877s   2A((A1c                   &    e Zd ZdZed        Zd Zy)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                     t        |        y Nr   r   s    r   ArgszGetIamPolicyBeta.Args:   
     r   c                     t        |      S r(   r#   selfr"   s     r   RunzGetIamPolicyBeta.Run>       :r   N__name__
__module____qualname____doc__staticmethodr*   r0    r   r   r%   r%   +         ! !r   r%   c                   &    e Zd ZdZed        Zd Zy)r   r&   c                     t        |        y r(   r)   r   s    r   r*   zGetIamPolicy.ArgsQ   r+   r   c                     t        |      S r(   r-   r.   s     r   r0   zGetIamPolicy.RunU   r1   r   Nr2   r8   r   r   r   r   B   r9   r   r   N)r6   
__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   r8   r   r   <module>rG      s    ( &  ' 3 ( > 6 < <)G D%%++T->->-C-CDt''  E, D%%(()4##  *r   