Class Api (3.23.0)

public sealed class Api : IMessage<Api>, IEquatable<Api>, IDeepCloneable<Api>, IBufferMessage, IMessage

Api is a light-weight descriptor for an API Interface.

Interfaces are also described as "protocol buffer services" in some contexts, such as by the "service" keyword in a .proto file, but they are different from API Services, which represent a concrete implementation of an interface as opposed to simply a description of methods and bindings. They are also sometimes simply referred to as "APIs" in other contexts, such as the name of this message itself. See https://cloud.google.com/apis/design/glossary for detailed terminology.

Inheritance

object > Api

Namespace

Google.Protobuf.WellKnownTypes

Assembly

Google.Protobuf.dll

Constructors

Api()

public Api()

Api(Api)

public Api(Api other)
Parameter
NameDescription
otherApi

Fields

MethodsFieldNumber

public const int MethodsFieldNumber = 2

Field number for the "methods" field.

Field Value
TypeDescription
int

MixinsFieldNumber

public const int MixinsFieldNumber = 6

Field number for the "mixins" field.

Field Value
TypeDescription
int

NameFieldNumber

public const int NameFieldNumber = 1

Field number for the "name" field.

Field Value
TypeDescription
int

OptionsFieldNumber

public const int OptionsFieldNumber = 3

Field number for the "options" field.

Field Value
TypeDescription
int

SourceContextFieldNumber

public const int SourceContextFieldNumber = 5

Field number for the "source_context" field.

Field Value
TypeDescription
int

SyntaxFieldNumber

public const int SyntaxFieldNumber = 7

Field number for the "syntax" field.

Field Value
TypeDescription
int

VersionFieldNumber

public const int VersionFieldNumber = 4

Field number for the "version" field.

Field Value
TypeDescription
int

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
MessageDescriptor

Methods

public RepeatedField<Method> Methods { get; }

The methods of this interface, in unspecified order.

Property Value
TypeDescription
RepeatedFieldMethod

Mixins

public RepeatedField<Mixin> Mixins { get; }

Included interfaces. See [Mixin][].

Property Value
TypeDescription
RepeatedFieldMixin

Name

public string Name { get; set; }

The fully qualified name of this interface, including package name followed by the interface's simple name.

Property Value
TypeDescription
string

Options

public RepeatedField<Option> Options { get; }

Any metadata attached to the interface.

Property Value
TypeDescription
RepeatedFieldOption

Parser

public static MessageParser<Api> Parser { get; }
Property Value
TypeDescription
MessageParserApi

SourceContext

public SourceContext SourceContext { get; set; }

Source context for the protocol buffer service represented by this message.

Property Value
TypeDescription
SourceContext

Syntax

public Syntax Syntax { get; set; }

The source syntax of the service.

Property Value
TypeDescription
Syntax

Version

public string Version { get; set; }

A version string for this interface. If specified, must have the form major-version.minor-version, as in 1.10. If the minor version is omitted, it defaults to zero. If the entire version field is empty, the major version is derived from the package name, as outlined below. If the field is not empty, the version in the package name will be verified to be consistent with what is provided here.

The versioning schema uses semantic versioning where the major version number indicates a breaking change and the minor version an additive, non-breaking change. Both version numbers are signals to users what to expect from different versions, and should be carefully chosen based on the product plan.

The major version is also reflected in the package name of the interface, which must end in v<major-version>, as in google.feature.v1. For major versions 0 and 1, the suffix can be omitted. Zero major versions must only be used for experimental, non-GA interfaces.

Property Value
TypeDescription
string

Methods

CalculateSize()

public int CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

Returns
TypeDescription
int

The number of bytes required to write this message to a coded output stream.

Clone()

public Api Clone()

Creates a deep clone of this object.

Returns
TypeDescription
Api

A deep clone of this object.

Equals(Api)

public bool Equals(Api other)
Parameter
NameDescription
otherApi
Returns
TypeDescription
bool

Equals(object)

public override bool Equals(object other)
Parameter
NameDescription
otherobject
Returns
TypeDescription
bool
Overrides

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
int
Overrides

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)

Merges the data from the specified coded input stream with the current message.

Parameter
NameDescription
inputCodedInputStream
Remarks

See the user guide for precise merge semantics.

MergeFrom(Api)

public void MergeFrom(Api other)

Merges the given message into this one.

Parameter
NameDescription
otherApi
Remarks

See the user guide for precise merge semantics.

ToString()

public override string ToString()
Returns
TypeDescription
string
Overrides

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)

Writes the data to the given coded output stream.

Parameter
NameDescription
outputCodedOutputStream

Coded output stream to write the data to. Must not be null.

Extension Methods