package google.protobuf

Mouse Melon logoGet desktop application:
View/edit binary Protocol Buffers messages

message Any

any.proto:128

`Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } // or ... if (any.isSameTypeAs(Foo.getDefaultInstance())) { foo = any.unpack(Foo.getDefaultInstance()); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example "foo.bar.com/x/y.z" will yield type name "y.z". JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { "@type": "type.googleapis.com/google.profile.Person", "firstName": <string>, "lastName": <string> } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" }

Used in: api.HttpBody, Option

message DescriptorProto

descriptor.proto:26

Used in: FileDescriptorProto

message DescriptorProto.ExtensionRange

descriptor.proto:39

Used in: DescriptorProto

message DescriptorProto.ReservedRange

descriptor.proto:45

Used in: DescriptorProto

message Enum

type.proto:63

message EnumDescriptorProto

descriptor.proto:101

Used in: DescriptorProto, FileDescriptorProto

message EnumOptions

descriptor.proto:211

Used in: EnumDescriptorProto

message EnumValue

type.proto:72

Used in: Enum

message EnumValueDescriptorProto

descriptor.proto:108

Used in: EnumDescriptorProto

message EnumValueOptions

descriptor.proto:220

Used in: EnumValueDescriptorProto

message Field

type.proto:18

Used in: Type

enum Field.Cardinality

type.proto:54

Used in: Field

enum Field.Kind

type.proto:31

Used in: Field

message FieldDescriptorProto

descriptor.proto:52

Used in: DescriptorProto, FileDescriptorProto

enum FieldDescriptorProto.Label

descriptor.proto:87

Used in: FieldDescriptorProto

enum FieldDescriptorProto.Type

descriptor.proto:65

Used in: FieldDescriptorProto

message FieldOptions

descriptor.proto:175

Used in: FieldDescriptorProto

enum FieldOptions.CType

descriptor.proto:185

Used in: FieldOptions

enum FieldOptions.JSType

descriptor.proto:192

Used in: FieldOptions

message FileDescriptorProto

descriptor.proto:10

Used in: FileDescriptorSet

message FileDescriptorSet

descriptor.proto:5

message FileOptions

descriptor.proto:132

Used in: FileDescriptorProto

enum FileOptions.OptimizeMode

descriptor.proto:150

Used in: FileOptions

message GeneratedCodeInfo

descriptor.proto:275

message GeneratedCodeInfo.Annotation

descriptor.proto:279

Used in: GeneratedCodeInfo

message MessageOptions

descriptor.proto:162

Used in: DescriptorProto

message MethodDescriptorProto

descriptor.proto:122

Used in: ServiceDescriptorProto

message MethodOptions

descriptor.proto:236

Used in: MethodDescriptorProto

message OneofDescriptorProto

descriptor.proto:95

Used in: DescriptorProto

message OneofOptions

descriptor.proto:204

Used in: OneofDescriptorProto

message Option

type.proto:79

Used in: Enum, EnumValue, Field, Type

message ServiceDescriptorProto

descriptor.proto:115

Used in: FileDescriptorProto

message ServiceOptions

descriptor.proto:228

Used in: ServiceDescriptorProto

message SourceCodeInfo

descriptor.proto:261

Used in: FileDescriptorProto

message SourceCodeInfo.Location

descriptor.proto:265

Used in: SourceCodeInfo

message SourceContext

source_context.proto:5

Used in: Enum, Type

enum Syntax

type.proto:85

Used in: Enum, Type

message Type

type.proto:8

message UninterpretedOption

descriptor.proto:244

Used in: EnumOptions, EnumValueOptions, FieldOptions, FileOptions, MessageOptions, MethodOptions, OneofOptions, ServiceOptions

message UninterpretedOption.NamePart

descriptor.proto:254

Used in: UninterpretedOption