Class AttributeContext (2.2.0)

public sealed class AttributeContext : Protobuf.IMessage<AttributeContext>, Protobuf.IBufferMessage

This message defines the standard attribute vocabulary for Google APIs.

An attribute is a piece of metadata that describes an activity on a network service. For example, the size of an HTTP request, or the status code of an HTTP response.

Each attribute has a type and a name, which is logically defined as a proto message field in AttributeContext. The field type becomes the attribute type, and the field path becomes the attribute name. For example, the attribute source.ip maps to field AttributeContext.source.ip.

This message definition is guaranteed not to have any wire breaking change. So you can use it directly for passing attributes across different systems.

NOTE: Different system may generate different subset of attributes. Please verify the system specification before relying on an attribute generated a system.

Inheritance

Object > AttributeContext

Namespace

Google.Rpc.Context

Assembly

Google.Api.CommonProtos.dll

Constructors

AttributeContext()

public AttributeContext()

AttributeContext(AttributeContext)

public AttributeContext(AttributeContext other)
Parameter
NameDescription
otherAttributeContext

Fields

ApiFieldNumber

public const int ApiFieldNumber = 6

Field number for the "api" field.

Field Value
TypeDescription
Int32

DestinationFieldNumber

public const int DestinationFieldNumber = 2

Field number for the "destination" field.

Field Value
TypeDescription
Int32

ExtensionsFieldNumber

public const int ExtensionsFieldNumber = 8

Field number for the "extensions" field.

Field Value
TypeDescription
Int32

OriginFieldNumber

public const int OriginFieldNumber = 7

Field number for the "origin" field.

Field Value
TypeDescription
Int32

RequestFieldNumber

public const int RequestFieldNumber = 3

Field number for the "request" field.

Field Value
TypeDescription
Int32

ResourceFieldNumber

public const int ResourceFieldNumber = 5

Field number for the "resource" field.

Field Value
TypeDescription
Int32

ResponseFieldNumber

public const int ResponseFieldNumber = 4

Field number for the "response" field.

Field Value
TypeDescription
Int32

SourceFieldNumber

public const int SourceFieldNumber = 1

Field number for the "source" field.

Field Value
TypeDescription
Int32

Properties

Api

public AttributeContext.Types.Api Api { get; set; }

Represents an API operation that is involved to a network activity.

Property Value
TypeDescription
AttributeContext.Types.Api

Descriptor

public static Protobuf.Reflection.MessageDescriptor Descriptor { get; }
Property Value
TypeDescription
Protobuf.Reflection.MessageDescriptor

Destination

public AttributeContext.Types.Peer Destination { get; set; }

The destination of a network activity, such as accepting a TCP connection. In a multi hop network activity, the destination represents the receiver of the last hop.

Property Value
TypeDescription
AttributeContext.Types.Peer

Extensions

public Protobuf.Collections.RepeatedField<Protobuf.WellKnownTypes.Any> Extensions { get; }

Supports extensions for advanced use cases, such as logs and metrics.

Property Value
TypeDescription
Protobuf.Collections.RepeatedField<Protobuf.WellKnownTypes.Any>

Origin

public AttributeContext.Types.Peer Origin { get; set; }

The origin of a network activity. In a multi hop network activity, the origin represents the sender of the first hop. For the first hop, the source and the origin must have the same content.

Property Value
TypeDescription
AttributeContext.Types.Peer

Parser

public static Protobuf.MessageParser<AttributeContext> Parser { get; }
Property Value
TypeDescription
Protobuf.MessageParser<AttributeContext>

Request

public AttributeContext.Types.Request Request { get; set; }

Represents a network request, such as an HTTP request.

Property Value
TypeDescription
AttributeContext.Types.Request

Resource

public AttributeContext.Types.Resource Resource { get; set; }

Represents a target resource that is involved with a network activity. If multiple resources are involved with an activity, this must be the primary one.

Property Value
TypeDescription
AttributeContext.Types.Resource

Response

public AttributeContext.Types.Response Response { get; set; }

Represents a network response, such as an HTTP response.

Property Value
TypeDescription
AttributeContext.Types.Response

Source

public AttributeContext.Types.Peer Source { get; set; }

The source of a network activity, such as starting a TCP connection. In a multi hop network activity, the source represents the sender of the last hop.

Property Value
TypeDescription
AttributeContext.Types.Peer

Methods

CalculateSize()

public int CalculateSize()
Returns
TypeDescription
Int32

Clone()

public AttributeContext Clone()
Returns
TypeDescription
AttributeContext

Equals(AttributeContext)

public bool Equals(AttributeContext other)
Parameter
NameDescription
otherAttributeContext
Returns
TypeDescription
Boolean

Equals(Object)

public override bool Equals(object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
Boolean

GetHashCode()

public override int GetHashCode()
Returns
TypeDescription
Int32

MergeFrom(Protobuf.CodedInputStream)

public void MergeFrom(Protobuf.CodedInputStream input)
Parameter
NameDescription
inputProtobuf.CodedInputStream

MergeFrom(AttributeContext)

public void MergeFrom(AttributeContext other)
Parameter
NameDescription
otherAttributeContext

ToString()

public override string ToString()
Returns
TypeDescription
String

WriteTo(Protobuf.CodedOutputStream)

public void WriteTo(Protobuf.CodedOutputStream output)
Parameter
NameDescription
outputProtobuf.CodedOutputStream