관리-도구
편집 파일: field_mask.cpython-311.pyc
� P�Dg�- � �x � d Z ddlmZ G d� de� � Zd� Zd� Zd� Zd� Z G d � d e� � Z d� Z d� Zd � ZdS )zContains FieldMask class.� )�FieldDescriptorc �J � e Zd ZdZdZd� Zd� Zd� Zd� Zd� Z d� Z d � Z d d�ZdS )� FieldMaskz!Class for FieldMask message type.� c � � g }| j D ]$}|� t |� � � � �%d� |� � S )z;Converts FieldMask to string according to proto3 JSON spec.�,)�paths�append�_SnakeCaseToCamelCase�join)�self�camelcase_paths�paths ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/google/protobuf/internal/field_mask.py�ToJsonStringzFieldMask.ToJsonString) sJ � ��O�� � :� :�����2�4�8�8�9�9�9�9��8�8�O�$�$�$� c �" � t |t � � s"t d� |� � � � �| � � � |r?|� d� � D ]+}| j � t |� � � � �*dS dS )z;Converts string to FieldMask according to proto3 JSON spec.z'FieldMask JSON value not a string: {!r}r N) � isinstance�str� ValueError�format�Clear�splitr r �_CamelCaseToSnakeCase)r �valuer s r �FromJsonStringzFieldMask.FromJsonString0 s� � ��e�S�!�!� P��@�G�G��N�N�O�O�O��J�J�L�L�L�� 7��+�+�c�"�"� 7� 7�$�� ���/��5�5�6�6�6�6�7� 7�7� 7r c �@ � | j D ]}t ||� � s dS �dS )z=Checks whether the FieldMask is valid for Message Descriptor.FT)r �_IsValidPath)r �message_descriptorr s r �IsValidForDescriptorzFieldMask.IsValidForDescriptor9 s7 � �� � � �� �,�d� 3� 3� ��u�u���4r c � � | � � � |j D ]!}| j � |j � � �"dS )z:Gets all direct fields of Message Descriptor to FieldMask.N)r �fieldsr r �name)r r �fields r �AllFieldsFromDescriptorz!FieldMask.AllFieldsFromDescriptor@ sF � ��J�J�L�L�L�#�*� $� $�� �j���� �#�#�#�#�$� $r c �N � t |� � }|� | � � dS )a: Converts a FieldMask to the canonical form. Removes paths that are covered by another path. For example, "foo.bar" is covered by "foo" and will be removed if "foo" is also in the FieldMask. Then sorts all paths in alphabetical order. Args: mask: The original FieldMask to be converted. N)�_FieldMaskTree�ToFieldMask)r �mask�trees r �CanonicalFormFromMaskzFieldMask.CanonicalFormFromMaskF s+ � � �$���D����T�����r c � � t |� � t |� � t |� � }|� |� � |� | � � dS )z+Merges mask1 and mask2 into this FieldMask.N)�_CheckFieldMaskMessager'