Ë
    €Ï;
  ã                   ó†   — 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  G d	„ d
ej                  «      Zy)z%Add IAM Policy Binding for EkmConfig.é    )Úabsolute_import)Údivision)Úunicode_literals)Úiam)Úbase)Úiam_util)Úresource_argsc                   ó&   — e Zd ZdZed„ «       Zd„ Zy)ÚAddIamPolicyBindingaã  Add IAM policy binding to an EkmConfig.

  Adds a policy binding to the IAM policy of a kms EkmConfig. A binding consists
  of at least one member, a role, and an optional condition.

  ## EXAMPLES
  To add an IAM policy binding for the role of 'roles/editor' for the user
  `test-user@gmail.com` on the EkmConfig with location `us-central1`, run:

    $ {command} --location='us-central1' --member='user:test-user@gmail.com'
    --role='roles/editor'

  To add an IAM policy binding which expires at the end of the year 2022 for the
  role of 'roles/editor' and the user `test-user@gmail.com` and location
  `us-central1`, run:

    $ {command} --location='us-central1' --member='user:test-user@gmail.com'
    --role='roles/editor' --condition='expression=request.time <
    timestamp("2023-01-01T00:00:00Z"),title=expires_end_of_2022,description=Expires
    at midnight on 2022-12-31'

  See https://cloud.google.com/iam/docs/managing-policies for details of
  policy role and member types.
  c                 ó`   — t        j                  | dd«       t        j                  | d¬«       y )NTz
--location)Úadd_condition)r	   ÚAddKmsLocationResourceArgForKMSr   ÚAddArgsForAddIamPolicyBinding)Úparsers    ú4lib/surface/kms/ekm_config/add_iam_policy_binding.pyÚArgszAddIamPolicyBinding.Args5   s$   € ä×1Ñ1°&¸$ÀÔMÜ×*Ñ*¨6ÀÖFó    c                 ó  — |j                   j                  j                  «       }dj                  |j                  |j
                  «      }t        j                  ||j                  |j                  «      }t        j                  |d«       |S )Nz$projects/{0}/locations/{1}/ekmConfigÚ	EkmConfig)ÚCONCEPTSÚlocationÚParseÚformatÚ
projectsIdÚlocationsIdr   ÚAddPolicyBindingToEkmConfigÚmemberÚroler   ÚLogSetIamPolicy)ÚselfÚargsÚlocation_refÚekm_config_nameÚresults        r   ÚRunzAddIamPolicyBinding.Run:   so   € Ø—=‘=×)Ñ)×/Ñ/Ó1€LØ<×CÑCØ×Ñ ×!9Ñ!9ó;€Oä×,Ñ,¨_¸d¿k¹kØ-1¯Y©Yó8€Fä×Ñ˜_¨kÔ:Ø€Mr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr   r%   © r   r   r   r      s"   „ ñð2 ñGó ðGór   r   N)r)   Ú
__future__r   r   r   Úgooglecloudsdk.api_lib.cloudkmsr   Úgooglecloudsdk.callioper   Úgooglecloudsdk.command_lib.iamr   Úgooglecloudsdk.command_lib.kmsr	   ÚCommandr   r+   r   r   Ú<module>r2      s/   ðñ ,å &Ý Ý 'å /Ý (Ý 3Ý 8ô&˜$Ÿ,™,õ &r   