HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //lib/google-cloud-sdk/lib/surface/secrets/replication/__pycache__/set.cpython-312.pyc
�

�����dZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZ
dd	lmZdd
lmZe	j$e	j&j(e	j&j*�Gd�de	j,��Zy
)zDescribe a secret's metadata.�)�absolute_import)�division)�unicode_literals)�api)�base)�
exceptions)�args)�log)�utilc�.�eZdZdZdZdZed��Zd�Zy)�SetahSet a secret's replication.

  Sets the replication policy for the given secret as defined in a JSON or YAML
  file. The locations that a Secret is replicated to cannot be changed.

  ## EXAMPLES

  To set the replication of a secret named 'my-secret' to the contents of
  my-file.json, run:

    $ {command} my-secret --replication-policy-file=my-file.json
  z}Cannot set replication for secret [{secret}] because it does not exist. Please use the create command to create a new secret.zFile cannot be empty.c�d�tj|ddd��tj|d��y)Nz	to updateT)�purpose�
positional�required)r)�secrets_args�	AddSecret�AddReplicationPolicyFile)�parsers �&lib/surface/secrets/replication/set.py�ArgszSet.Args1s*��������t�E��)�)�&�4�@�c��tj|j��}tj|j
d��}|jjj�}|s tjd|j��tj|�\}}}tj|��j|�}|�>tjd|jj!|j#�����tj|��j%||||�}t'j�j)|�|S)NF)�	is_binaryzreplication-policy)�api_version�secret)r)�secrets_api�GetApiFromTrack�ReleaseTrack�secrets_util�ReadFileOrStdin�replication_policy_file�CONCEPTSr�Parser�InvalidArgumentException�%REPLICATION_POLICY_FILE_EMPTY_MESSAGE�ParseReplicationFileContents�Secrets�	GetOrNone�SECRET_MISSING_MESSAGE�format�Name�SetReplication�secrets_log�UpdatedReplication)	�selfr	r�replication_policy_contents�
secret_ref�policy�	locations�kms_keysrs	         r�RunzSet.Run7s,���-�-�d�.?�.?�.A�B�K�".�">�">��$�$��#7�����%�%�+�+�-�J�&��/�/�
�� J� J�
L�L�".�"K�"K�#�#%��F�I�x��
 �
 �[�
9�
C�
C�J�
O�F��~��/�/�
�
�
%�
%�
,�
,�J�O�O�4E�
,�
F�
H�H��
 �
 �[�
9�
H�
H��F�I�x��F�����,�,�Z�8��MrN)	�__name__�
__module__�__qualname__�__doc__r*r&�staticmethodrr6�rrr
r
s3���>��,C�'��A��A�
rr
N)r:�
__future__rrr�googlecloudsdk.api_lib.secretsrr�googlecloudsdk.callioperr�"googlecloudsdk.command_lib.secretsr	rr
r.rr �
ReleaseTracksr�BETA�GA�
UpdateCommandr
r<rr�<module>rEsn��$�&��'�=�(�.�C�A�C�����D�%�%�*�*�D�,=�,=�,@�,@�A�3�$�
�
�3�B�3r