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/trace/sinks/__pycache__/update.cpython-312.pyc
�

���
����dZddlmZddlmZddlmZddlmZddlmZddlm	Z
ddlmZd	d
d�Z
ejejj �Gd�d
ej"��Ze
e_y)z'trace sinks update' command.�)�absolute_import)�division)�unicode_literals)�util)�base)�
exceptions)�logz�/
        Changes the *[destination]* associated with a sink.
        The new destination must already exist and Stackdriver Trace must have
        permission to write to it.

        Trace spans are exported to the new destination in a few minutes.
    zg/

        $ {command} my-sink bigquery.googleapis.com/projects/my-project/datasets/my_new_dataset
    )�DESCRIPTION�EXAMPLESc�,�eZdZdZed��Zd�Zd�Zy)�UpdatezUpdates a sink.c���|jdd��|jdd��|jdd��|jjd�|jjd	�y	)
z Register flags for this command.�	sink_namezThe name of the sink to update.)�help�destinationz�The new destination for the sink. The destination must be a fully qualified BigQuery resource name. The destination can be for the same Google Cloud project or for a different Google Cloud project in the same organization.z	--projectzSUpdate a sink associated with this project. This will override the default project.�yamlN)�add_argument�display_info�	AddFormat�AddCacheUpdater)�parsers �!lib/surface/trace/sinks/update.py�ArgszUpdate.Args/sz������*K��L�
�����������3��4����!�!�&�)�
���'�'��-�c
���tj�}tj�jj	|j||jdi|��dj|����S)z*Patches a sink specified by the arguments.�,)�name�	traceSink�
updateMask�)r�GetMessages�	GetClient�projects_traceSinks�Patch�(CloudtraceProjectsTraceSinksPatchRequest�	TraceSink�join)�selfr�	sink_data�update_mask�messagess     r�	PatchSinkzUpdate.PatchSink@se�����!�H��>�>��/�/�5�5��9�9��(�h�(�(�5�9�5��x�x��,�	:�	.�/�/rc��tj|j|j�}|j	�}d|i}g}|jd�r"d|ji|d<|jd�|stjd��|j|||�}tj|�tj|�S)z�This 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:
      The updated sink with its new destination.
    rr�outputConfigzoutput_config.destinationz(Please specify the destination to update)r�GetTraceSinkResourcer�project�RelativeName�IsSpecifiedr�append�calliope_exceptions�MinimumArgumentExceptionr,r	�UpdatedResource�FormatTraceSink)r(�args�sink_ref�sink_resource_namer)r*�results       r�Runz
Update.RunIs����(�(�������F�H�!�.�.�0���+�,�I��K����
�&�#0�$�2B�2B�"C�i������4�5���8�8�
4�
6�6��^�^�.�	�;�
G�F�����!�����'�'rN)�__name__�
__module__�__qualname__�__doc__�staticmethodrr,r<r rrr
r
+s!����.��.� /�(rr
N)r@�
__future__rrr�googlecloudsdk.api_lib.tracer�googlecloudsdk.callioperrr4�googlecloudsdk.corer	�
DETAILED_HELP�
ReleaseTracks�ReleaseTrack�ALPHA�
UpdateCommandr
�
detailed_helpr rr�<module>rLsu��$�&��'�-�(�E�#�	�	��
�"����D�%�%�+�+�,�6(�T�
�
�6(�-�6(�r%��r