public sealed class Resource : Protobuf.IMessage<AttributeContext.Types.Resource>, Protobuf.IBufferMessage
This message defines core attributes for a resource. A resource is an
addressable (named) entity provided by the destination service. For
example, a file stored on a network storage service.
Inheritance
Object >
AttributeContext.Types.Resource
Namespace
Google.Rpc.Context
Assembly
Google.Api.CommonProtos.dll
Constructors
Resource()
Resource(AttributeContext.Types.Resource)
public Resource(AttributeContext.Types.Resource other)
Fields
LabelsFieldNumber
public const int LabelsFieldNumber = 4
Field number for the "labels" field.
Field Value |
---|
Type | Description |
Int32 | |
NameFieldNumber
public const int NameFieldNumber = 2
Field number for the "name" field.
Field Value |
---|
Type | Description |
Int32 | |
ServiceFieldNumber
public const int ServiceFieldNumber = 1
Field number for the "service" field.
Field Value |
---|
Type | Description |
Int32 | |
TypeFieldNumber
public const int TypeFieldNumber = 3
Field number for the "type" field.
Field Value |
---|
Type | Description |
Int32 | |
Properties
Descriptor
public static Protobuf.Reflection.MessageDescriptor Descriptor { get; }
Labels
public Protobuf.Collections.MapField<string, string> Labels { get; }
The labels or tags on the resource, such as AWS resource tags and
Kubernetes resource labels.
Name
public string Name { get; set; }
The stable identifier (name) of a resource on the service
. A resource
can be logically identified as "//{resource.service}/{resource.name}".
The differences between a resource name and a URI are:
- Resource name is a logical identifier, independent of network
protocol and API version. For example,
//pubsub.googleapis.com/projects/123/topics/news-feed
.
- URI often includes protocol and version information, so it can
be used directly by applications. For example,
https://pubsub.googleapis.com/v1/projects/123/topics/news-feed
.
See https://cloud.google.com/apis/design/resource_names for details.
Property Value |
---|
Type | Description |
String | |
Parser
public static Protobuf.MessageParser<AttributeContext.Types.Resource> Parser { get; }
Service
public string Service { get; set; }
The name of the service that this resource belongs to, such as
pubsub.googleapis.com
. The service may be different from the DNS
hostname that actually serves the request.
Property Value |
---|
Type | Description |
String | |
Type
public string Type { get; set; }
The type of the resource. The syntax is platform-specific because
different platforms define their resources differently.
For Google APIs, the type format must be "{service}/{kind}".
Property Value |
---|
Type | Description |
String | |
Methods
CalculateSize()
public int CalculateSize()
Returns |
---|
Type | Description |
Int32 | |
Clone()
public AttributeContext.Types.Resource Clone()
Equals(AttributeContext.Types.Resource)
public bool Equals(AttributeContext.Types.Resource other)
Equals(Object)
public override bool Equals(object other)
Parameter |
---|
Name | Description |
other | Object
|
GetHashCode()
public override int GetHashCode()
Returns |
---|
Type | Description |
Int32 | |
MergeFrom(Protobuf.CodedInputStream)
public void MergeFrom(Protobuf.CodedInputStream input)
MergeFrom(AttributeContext.Types.Resource)
public void MergeFrom(AttributeContext.Types.Resource other)
ToString()
public override string ToString()
WriteTo(Protobuf.CodedOutputStream)
public void WriteTo(Protobuf.CodedOutputStream output)