
    	                        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  ej                  ej                  j                  ej                  j                         G d	 d
ej                                Zy)z4Command to describe the access policy for a service.    )absolute_import)division)unicode_literals)services_util)base)arg_parsers)common_flagsc                   &    e Zd ZdZed        Zd Zy)GetIamPolicyzDescribes the IAM policy for a service.

  Gets the IAM policy for a produced service, given the service name.

  ## EXAMPLES

  To print the IAM policy for a service named `my-service`, run:

    $ {command} my-service
  c                     t        j                  d      }|j                  |        t        j                  j                  |        y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    z#whose IAM policy is to be described)suffixN)r	   producer_service_flagAddToParserr   URI_FLAGRemoveFromParser)parserservice_flags     0lib/surface/endpoints/services/get_iam_policy.pyArgszGetIamPolicy.Args)   s7      5546LV$MM""6*    c                     t        j                         }t        j                         }t        j                  |j
                        }|j                  |      }|j                  j                  |      S )a<  Run 'service-management get-iam-policy'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      The response from the access API call.

    Raises:
      HttpException: An http error response was received while executing api
          request.
    )
servicesId)	r   GetMessagesModuleGetClientInstancer   GetServiceNameFromArgservice,ServicemanagementServicesGetIamPolicyRequestservicesr   )selfargsmessagesclientr   requests         r   RunzGetIamPolicy.Run7   sd     ..0H,,.F//=GCC D G ??''00r   N)__name__
__module____qualname____doc__staticmethodr   r$    r   r   r   r      s     	 + +1r   r   N)r(   
__future__r   r   r    googlecloudsdk.api_lib.endpointsr   googlecloudsdk.callioper   $googlecloudsdk.command_lib.endpointsr   r	   ReleaseTracksReleaseTrackBETAGAListCommandr   r*   r   r   <module>r4      sh     ; &  ' : ( < = D%%**D,=,=,@,@A014## 01 B01r   