hf8dZdZGddeZGddeZGddeZGdd eZd Zd S) z6Contains an abstract base class for protocol messages.z#robinson@google.com (Will Robinson)ceZdZdZdS)Errorz Base error type for this module.N__name__ __module__ __qualname____doc__y/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/google/protobuf/message.pyrr's(($r rceZdZdZdS) DecodeErrorz-Exception raised when deserializing messages.Nrr r r r r ,s55$r r ceZdZdZdS) EncodeErrorz+Exception raised when serializing messages.Nrr r r rr1s33$r rceZdZdZgZdZd!dZdZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZedZe dZ!dZ"dZ#dZ$d Z%dS)"MessagezAbstract 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|}|||SN)type MergeFrom)selfmemoclones r __deepcopy__zMessage.__deepcopy__Qs* DJJLLE OOD Lr ct)z9Recursively compares two messages by value and structure.NotImplementedErrorr other_msgs r __eq__zMessage.__eq__V r c||k Srr rs r __ne__zMessage.__ne__Zsy  r c td)Nzunhashable object) TypeErrorrs r __hash__zMessage.__hash__^s ' ( ((r ctz7Outputs a human-readable representation of the message.rr%s r __str__zMessage.__str__ar r ctr(rr%s r __unicode__zMessage.__unicode__er r ct)aMerges 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. rrs r rzMessage.MergeFromis  r cd||urdS|||dS)zCopies 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)Clearrrs r CopyFromzMessage.CopyFromvs9 y fJJLLLNN9r ct)z,Clears all data that was set in the message.rr%s r r.z Message.Clearr r ct)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. rr%s r SetInParentzMessage.SetInParent  r ct)zChecks 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). rr%s r IsInitializedzMessage.IsInitializeds  r ct)aEMerges 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. rr serializeds r MergeFromStringzMessage.MergeFromStrings > r cT|||S)zParse serialized protocol buffer data in binary form into this message. Like :func:`MergeFromString()`, except we clear the object first. Raises: message.DecodeError if the input cannot be parsed. )r.r9r7s r ParseFromStringzMessage.ParseFromStrings% JJLLL    + ++r c t)aSerializes the protocol message to a binary string. Keyword Args: deterministic (bool): If true, requests deterministic serialization of the protobuf, with predictable ordering of map keys. Returns: A binary string representation of the message if all of the required fields in the message are set (i.e. the message is initialized). Raises: EncodeError: if the message isn't initialized (see :func:`IsInitialized`). rrkwargss r SerializeToStringzMessage.SerializeToString  r c t)aSerializes the protocol message to a binary string. This method is similar to SerializeToString but doesn't check if the message is initialized. Keyword Args: deterministic (bool): If true, requests deterministic serialization of the protobuf, with predictable ordering of map keys. Returns: bytes: A serialized representation of the partial message. rr=s r SerializePartialToStringz Message.SerializePartialToString  r ct)a'Returns a list of (FieldDescriptor, value) tuples for present fields. A message field is non-empty if HasField() would return true. A singular primitive field is non-empty if HasField() would return true in proto2 or it is non zero in proto3. A repeated field is non-empty if it contains at least one element. The fields are ordered by field number. Returns: list[tuple(FieldDescriptor, value)]: field descriptors and values for all fields in the message which are not empty. The values vary by field type. rr%s r ListFieldszMessage.ListFieldsrCr ct)aChecks if a certain field is set for the message. For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, :exc:`ValueError` will be raised. Args: field_name (str): The name of the field to check for presence. Returns: bool: Whether a value has been set for the named field. Raises: ValueError: if the `field_name` is not a member of this message. rr field_names r HasFieldzMessage.HasField  r ct)a^Clears the contents of a given field. Inside a oneof group, clears the field set. If the name neither refers to a defined field or oneof group, :exc:`ValueError` is raised. Args: field_name (str): The name of the field to check for presence. Raises: ValueError: if the `field_name` is not a member of this message. rrGs r ClearFieldzMessage.ClearFields  r ct)aEReturns the name of the field that is set inside a oneof group. If no field is set, returns None. Args: oneof_group (str): the name of the oneof group to check. Returns: str or None: The name of the group that is set, or None. Raises: ValueError: no group with the given name exists r)r oneof_groups r WhichOneofzMessage.WhichOneof+r@r ct)aChecks if a certain extension is present for this message. Extensions are retrieved using the :attr:`Extensions` mapping (if present). Args: field_descriptor: The field descriptor for the extension to check. Returns: bool: Whether the extension is present for this message. Raises: KeyError: if the extension is repeated. Similar to repeated fields, there is no separate notion of presence: a "not present" repeated extension is an empty list. rrfield_descriptors r HasExtensionzMessage.HasExtension;rJr ct)zClears the contents of a given extension. Args: field_descriptor: The field descriptor for the extension to clear. rrQs r ClearExtensionzMessage.ClearExtensionM r ct)zqReturns the UnknownFieldSet. Returns: UnknownFieldSet: The unknown fields stored in this message. rr%s r UnknownFieldszMessage.UnknownFieldsUrVr ct)zlClears all fields in the :class:`UnknownFieldSet`. This operation is recursive for nested message. rr%s r DiscardUnknownFieldszMessage.DiscardUnknownFields]s r ct)zReturns the serialized size of this message. Recursively calls ByteSize() on all contained messages. Returns: int: The number of bytes required to serialize this message. rr%s r ByteSizezMessage.ByteSizedr3r ctrr)clsss r FromStringzMessage.FromStringnr r ctrr)rRs r RegisterExtensionzMessage.RegisterExtensionrr r ct)a6Internal method used by the protocol message implementation. Clients should not call this directly. Sets a listener that this message will call on certain state transitions. The purpose of this method is to register back-edges from children to parents at runtime, for the purpose of setting "has" bits and byte-size-dirty bits in the parent and ancestor objects whenever a child or descendant object is modified. If the client wants to disconnect this Message from the object tree, she explicitly sets callback to None. If message_listener is None, unregisters any existing listener. Otherwise, message_listener must implement the MessageListener interface in internal/message_listener.py, and we discard any listener registered via a previous _SetListener() call. r)rmessage_listeners r _SetListenerzMessage._SetListenervs & r cFt|S)Support the pickle protocol.)r8)dictrBr%s r __getstate__zMessage.__getstate__s 488:: ; ; ;;r c||d}t|ts|d}||dS)rgr8latin1N)__init__ isinstancebytesencoder;)rstater8s r __setstate__zMessage.__setstate__sZMMOOO|$J j% ( (/$$X..j$$$$$r c|j}|j$t|d|fS|}t|jf|fS)Nr ) DESCRIPTORcontaining_typerri_InternalConstructMessage full_name)rmessage_descriptor containers r __reduce__zMessage.__reduce__s])1 $ZZT..00 00#I % (;'=      !!r r)&rrrr __slots__rsrrr"r&r)r+rr/r.r2r5r9r;r?rBrErIrLrOrSrUrXrZr\ classmethodr` staticmethodrbrerirqryr r r rr6s &)* !!!)))      B , , ,   >   $    $;<*<<<%%% ! ! ! ! !r rclddlm}||S)zConstructs a nested message.)symbol_database)google.protobufrDefault GetSymbol)rvrs r rurus<------ 7 " " , ,Y 7 7 9 99r N) r __author__ Exceptionrr robjectrrur r r rsF=< 2 I % % l!l!l!l!l!fl!l!l!^ :::::r