Repository URL to install this package:
Version:
0.1.10 ▾
|
odigos
/
etc
/
odigos-vmagent
/
instrumentations
/
python
/
google
/
protobuf
/
__pycache__
/
message.cpython-311.pyc
|
---|
§ QÄ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__© ó ú>/tmp/pip-target-0z7lll2b/lib/python/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!dZd 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* ØDJJLLEØ OODÑÔÐØ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ØJJLLLØNN9ÑÔÐÐÐ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 õ>