
                             S r SSKrSSKJr  SSKJr  SSKJr  SSKJr  \R                   " S S\R                  5      5       rg)	z-Command for spanner databases set-iam-policy.    N)base)iam_util)iam)resource_argsc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	SetIamPolicy   z0Set the IAM policy for a Cloud Spanner database.EXAMPLESam        The following command reads an IAM policy defined in a JSON file
      `policy.json` and sets it for a spanner database with the ID
      `my-database-id`:

        $ {command} my-database-id --instance=my-instance-id policy.json

      See https://cloud.google.com/iam/docs/managing-policies for details of the
      policy file format and contents.
        c                 R    [         R                  " U S5        U R                  SSS9  g)zSee base class.zto set IAM policy binding forpolicy_filez.Name of JSON or YAML file with the IAM policy.)helpN)r   AddDatabaseResourceArgadd_argument)parsers    /lib/surface/spanner/databases/set_iam_policy.pyArgsSetIamPolicy.Args,   s2     (()HJ
L  N    c                     UR                   R                  R                  5       n[        R                  " X!R
                  5      n[        R                  " UR                  5       S5        U$ )zThis is what gets called when the user runs this command.

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

Returns:
  Some value that we want to have printed later.
database)	CONCEPTSr   Parser   SetDatabaseIamPolicyr   r   LogSetIamPolicyName)selfargsdatabase_refresults       r   RunSetIamPolicy.Run4   sP     ==))//1L%%l4D4DEF\..0*=Mr    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r    __static_attributes__r"   r   r   r   r      s=    8 
// 	 	- N Nr   r   )r'   r(   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   "googlecloudsdk.command_lib.spannerr   r   UniverseCompatibleCommandr   r"   r   r   <module>r2      s@    4  ( 3 2 < &4<< & &r   