google.protobuf.field_mask_pb2

Generated protocol buffer code.

class google.protobuf.field_mask_pb2.FieldMask(**kwargs)
AllFieldsFromDescriptor(message_descriptor)

Gets all direct fields of Message Descriptor to FieldMask.

ByteSize()
CanonicalFormFromMask(mask)

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.

Parameters:

mask – The original FieldMask to be converted.

Clear()
ClearExtension(extension_handle)

Clears the contents of a given extension.

Parameters:

extension_handle – The handle for the extension to clear.

ClearField(field_name)
CopyFrom(other_msg)

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.

Parameters:

other_msg (Message) – A message to copy into the current one.

DESCRIPTOR = <google.protobuf.descriptor.Descriptor object>
DiscardUnknownFields()
FindInitializationErrors()

Finds required fields which are not initialized.

Returns:

A list of strings. Each string is a path to an uninitialized field from the top-level message, e.g. “foo.bar[5].baz”.

FromJsonString(value)

Converts string to FieldMask according to proto3 JSON spec.

static FromString(s)
HasExtension(extension_handle)

Checks if a certain extension is present for this message.

Extensions are retrieved using the Extensions mapping (if present).

Parameters:

extension_handle – The handle for the extension to check.

Returns:

Whether the extension is present for this message.

Return type:

bool

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.

HasField(field_name)
Intersect(mask1, mask2)

Intersects mask1 and mask2 into this FieldMask.

IsInitialized(errors=None)

Checks if all required fields of a message are set.

Parameters:

errors – A list which, if provided, will be populated with the field paths of all missing required fields.

Returns:

True iff the specified message has all required fields set.

IsValidForDescriptor(message_descriptor)

Checks whether the FieldMask is valid for Message Descriptor.

ListFields()
MergeFrom(msg)
MergeFromString(serialized)
MergeMessage(source, destination, replace_message_field=False, replace_repeated_field=False)

Merges fields specified in FieldMask from source to destination.

Parameters:
  • source – Source message.

  • destination – The destination message to be merged into.

  • replace_message_field – Replace message field if True. Merge message field if False.

  • replace_repeated_field – Replace repeated field if True. Append elements of repeated field if False.

PATHS_FIELD_NUMBER = 1
ParseFromString(serialized)

Parse serialized protocol buffer data into this message.

Like MergeFromString(), except we clear the object first.

Raises:

message.DecodeError if the input cannot be parsed.

static RegisterExtension(extension_handle)
SerializePartialToString(**kwargs)
SerializeToString(**kwargs)
SetInParent()

Sets the _cached_byte_size_dirty bit to true, and propagates this to our listener iff this was a state change.

ToJsonString()

Converts FieldMask to string according to proto3 JSON spec.

Union(mask1, mask2)

Merges mask1 and mask2 into this FieldMask.

UnknownFields()
WhichOneof(oneof_name)

Returns the name of the currently set field inside a oneof, or None.

property paths