�
��g�6 � � � d Z dZ G d� de� � Z G d� de� � Z G d� de� � Z G d� d e� � Zd
� ZdS )z6Contains an abstract base class for protocol messages.z#robinson@google.com (Will Robinson)c � � e Zd ZdZdS )�Errorz Base error type for this module.N��__name__�
__module__�__qualname__�__doc__� � �g/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/google/protobuf/message.pyr r s � � � � � �(�(��$r
r c � � e Zd ZdZdS )�DecodeErrorz-Exception raised when deserializing messages.Nr r r
r r
r
s � � � � � �5�5��$r
r
c � � e Zd ZdZdS )�EncodeErrorz+Exception raised when serializing messages.Nr r r
r r r s � � � � � �3�3��$r
r c �� � e Zd ZdZg ZdZd!d�Zd� Zd� Zd� Z d� Z
d� Zd � Zd
� Z
d� Zd� Zd
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zed� � � Z d� Z!d� Z"d� Z#d � Z$dS )"�Messagez�Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol
compiler. These generated types subclass Message and implement the methods
shown below.
Nc �^ � t | � � � � }|� | � � |S �N)�type� MergeFrom)�self�memo�clones r �__deepcopy__zMessage.__deepcopy__6 s* � ��D��J�J�L�L�E� �O�O�D�����Lr
c � � t �)z9Recursively compares two messages by value and structure.��NotImplementedError�r � other_msgs r �__eq__zMessage.__eq__; � � �
�r
c � � | |k S r r r s r �__ne__zMessage.__ne__? s � ��y� � � r
c � � t d� � �)Nzunhashable object)� TypeError�r s r �__hash__zMessage.__hash__C s � �
�'�
(�
(�(r
c � � t ��z7Outputs a human-readable representation of the message.r r% s r �__str__zMessage.__str__F r r
c � � t �r( r r% s r �__unicode__zMessage.__unicode__J r r
c � � t �)aW Checks if a certain field is set for the message.
Has presence fields return true if the field is set, false if the field is
not set. Fields without presence do raise `ValueError` (this includes
repeated fields, map fields, and implicit presence fields).
If field_name is not defined in the message descriptor, `ValueError` will
be raised.
Note: WKT Struct checks if the key is contained in fields. ListValue checks
if the item is contained in the list.
Args:
field_name_or_key: For Struct, the key (str) of the fields map. For
ListValue, any type that may be contained in the list. For other
messages, name of the field (str) to check for presence.
Returns:
bool: For Struct, whether the item is contained in fields. For ListValue,
whether the item is contained in the list. For other message,
whether a value has been set for the named field.
Raises:
ValueError: For normal messages, if the `field_name_or_key` is not a
member of this message or `field_name_or_key` is not a string.
r )r �field_name_or_keys r �__contains__zMessage.__contains__N s
� �4 �r
c � � t �)a� Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repeated fields are
appended. Singular sub-messages and groups are recursively merged.
Args:
other_msg (Message): A message to merge into the current message.
r r s r r zMessage.MergeFromj s
� � �r
c �d � | |u rdS | � � � | � |� � dS )z�Copies the content of the specified message into the current message.
The method clears the current message and then merges the specified
message using MergeFrom.
Args:
other_msg (Message): A message to copy into the current one.
N)�Clearr r s r �CopyFromzMessage.CopyFromw s9 � � �y����f��J�J�L�L�L��N�N�9�����r
c � � t �)z,Clears all data that was set in the message.r r% s r r1 z
Message.Clear� r r
c � � t �)a Mark this as present in the parent.
This normally happens automatically when you assign a field of a
sub-message, but sometimes you want to make the sub-message
present while keeping it empty. If you find yourself using this,
you may want to reconsider your design.
r r% s r �SetInParentzMessage.SetInParent� �
� � �r
c � � t �)z�Checks if the message is initialized.
Returns:
bool: The method returns True if the message is initialized (i.e. all of
its required fields are set).
r r% s r �
IsInitializedzMessage.IsInitialized� s
� � �r
c � � t �)aE Merges serialized protocol buffer data into this message.
When we find a field in `serialized` that is already present
in this message:
- If it's a "repeated" field, we append to the end of our list.
- Else, if it's a scalar, we overwrite our field.
- Else, (it's a nonrepeated composite), we recursively merge
into the existing composite.
Args:
serialized (bytes): Any object that allows us to call
``memoryview(serialized)`` to access a string of bytes using the
buffer interface.
Returns:
int: The number of bytes read from `serialized`.
For non-group messages, this will always be `len(serialized)`,
but for messages which are actually groups, this will
generally be less than `len(serialized)`, since we must
stop when we reach an ``END_GROUP`` tag. Note that if
we *do* stop because of an ``END_GROUP`` tag, the number
of bytes returned does not include the bytes
for the ``END_GROUP`` tag information.
Raises:
DecodeError: if the input cannot be parsed.
r �r �
serializeds r �MergeFromStringzMessage.MergeFromString� s
� �>