Class Usage (2.15.0)

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

Configuration controlling usage of a service.

Inheritance

object > Usage

Namespace

Google.Api

Assembly

Google.Api.CommonProtos.dll

Constructors

Usage()

public Usage()

Usage(Usage)

public Usage(Usage other)
Parameter
Name Description
other Usage

Fields

ProducerNotificationChannelFieldNumber

public const int ProducerNotificationChannelFieldNumber = 7

Field number for the "producer_notification_channel" field.

Field Value
Type Description
int

RequirementsFieldNumber

public const int RequirementsFieldNumber = 1

Field number for the "requirements" field.

Field Value
Type Description
int

RulesFieldNumber

public const int RulesFieldNumber = 6

Field number for the "rules" field.

Field Value
Type Description
int

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

Parser

public static MessageParser<Usage> Parser { get; }
Property Value
Type Description
MessageParserUsage

ProducerNotificationChannel

public string ProducerNotificationChannel { get; set; }

The full resource name of a channel used for sending notifications to the service producer.

Google Service Management currently only supports Google Cloud Pub/Sub as a notification channel. To use Google Cloud Pub/Sub as the channel, this must be the name of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format documented in https://cloud.google.com/pubsub/docs/overview.

Property Value
Type Description
string

Requirements

public RepeatedField<string> Requirements { get; }

Requirements that must be satisfied before a consumer project can use the service. Each requirement is of the form <service.name>/<requirement-id>; for example 'serviceusage.googleapis.com/billing-enabled'.

For Google APIs, a Terms of Service requirement must be included here. Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". Other Google APIs should include "serviceusage.googleapis.com/tos/universal". Additional ToS can be included based on the business needs.

Property Value
Type Description
RepeatedFieldstring

Rules

public RepeatedField<UsageRule> Rules { get; }

A list of usage rules that apply to individual API methods.

NOTE: All service configuration rules follow "last one wins" order.

Property Value
Type Description
RepeatedFieldUsageRule

Methods

CalculateSize()

public int CalculateSize()

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

Returns
Type Description
int

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

Clone()

public Usage Clone()

Creates a deep clone of this object.

Returns
Type Description
Usage

A deep clone of this object.

Equals(Usage)

public bool Equals(Usage other)
Parameter
Name Description
other Usage
Returns
Type Description
bool

Equals(object)

public override bool Equals(object other)
Parameter
Name Description
other object
Returns
Type Description
bool
Overrides

GetHashCode()

public override int GetHashCode()
Returns
Type Description
int
Overrides

MergeFrom(Usage)

public void MergeFrom(Usage other)

Merges the given message into this one.

Parameter
Name Description
other Usage
Remarks

See the user guide for precise merge semantics.

MergeFrom(CodedInputStream)

public void MergeFrom(CodedInputStream input)

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

Parameter
Name Description
input CodedInputStream
Remarks

See the user guide for precise merge semantics.

ToString()

public override string ToString()
Returns
Type Description
string
Overrides

WriteTo(CodedOutputStream)

public void WriteTo(CodedOutputStream output)

Writes the data to the given coded output stream.

Parameter
Name Description
output CodedOutputStream

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