Class Usage (2.8.4)

publicfinalclassUsageextendsGeneratedMessageV3implementsUsageOrBuilder

Configuration controlling usage of a service.

Protobuf typegoogle.api.Usage

Implements

UsageOrBuilder

Inherited Members

Static Fields

PRODUCER_NOTIFICATION_CHANNEL_FIELD_NUMBER

publicstaticfinalintPRODUCER_NOTIFICATION_CHANNEL_FIELD_NUMBER
Field Value
TypeDescription
int

REQUIREMENTS_FIELD_NUMBER

publicstaticfinalintREQUIREMENTS_FIELD_NUMBER
Field Value
TypeDescription
int

RULES_FIELD_NUMBER

publicstaticfinalintRULES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

publicstaticUsagegetDefaultInstance()
Returns
TypeDescription
Usage

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

publicstaticUsage.BuildernewBuilder()
Returns
TypeDescription
Usage.Builder

newBuilder(Usage prototype)

publicstaticUsage.BuildernewBuilder(Usageprototype)
Parameter
NameDescription
prototypeUsage
Returns
TypeDescription
Usage.Builder

parseDelimitedFrom(InputStream input)

publicstaticUsageparseDelimitedFrom(InputStreaminput)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Usage
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticUsageparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Usage
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

publicstaticUsageparseFrom(byte[]data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Usage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticUsageparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Usage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticUsageparseFrom(ByteStringdata)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Usage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticUsageparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Usage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticUsageparseFrom(CodedInputStreaminput)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Usage
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticUsageparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Usage
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

publicstaticUsageparseFrom(InputStreaminput)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Usage
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticUsageparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Usage
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

publicstaticUsageparseFrom(ByteBufferdata)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Usage
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticUsageparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Usage
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

publicstaticParser<Usage>parser()
Returns
TypeDescription
Parser<Usage>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

publicUsagegetDefaultInstanceForType()
Returns
TypeDescription
Usage

getParserForType()

publicParser<Usage>getParserForType()
Returns
TypeDescription
Parser<Usage>
Overrides

getProducerNotificationChannel()

publicStringgetProducerNotificationChannel()

The full resource name of a channel used for sending notifications to the service producer. Google Service Management currently only supportsGoogle 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 inhttps://cloud.google.com/pubsub/docs/overview.

string producer_notification_channel = 7;

Returns
TypeDescription
String

The producerNotificationChannel.

getProducerNotificationChannelBytes()

publicByteStringgetProducerNotificationChannelBytes()

The full resource name of a channel used for sending notifications to the service producer. Google Service Management currently only supportsGoogle 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 inhttps://cloud.google.com/pubsub/docs/overview.

string producer_notification_channel = 7;

Returns
TypeDescription
ByteString

The bytes for producerNotificationChannel.

getRequirements(int index)

publicStringgetRequirements(intindex)

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.

repeated string requirements = 1;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The requirements at the given index.

getRequirementsBytes(int index)

publicByteStringgetRequirementsBytes(intindex)

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.

repeated string requirements = 1;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the requirements at the given index.

getRequirementsCount()

publicintgetRequirementsCount()

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.

repeated string requirements = 1;

Returns
TypeDescription
int

The count of requirements.

getRequirementsList()

publicProtocolStringListgetRequirementsList()

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.

repeated string requirements = 1;

Returns
TypeDescription
ProtocolStringList

A list containing the requirements.

getRules(int index)

publicUsageRulegetRules(intindex)

A list of usage rules that apply to individual API methods.NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.UsageRule rules = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
UsageRule

getRulesCount()

publicintgetRulesCount()

A list of usage rules that apply to individual API methods.NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.UsageRule rules = 6;

Returns
TypeDescription
int

getRulesList()

publicList<UsageRule>getRulesList()

A list of usage rules that apply to individual API methods.NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.UsageRule rules = 6;

Returns
TypeDescription
List<UsageRule>

getRulesOrBuilder(int index)

publicUsageRuleOrBuildergetRulesOrBuilder(intindex)

A list of usage rules that apply to individual API methods.NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.UsageRule rules = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
UsageRuleOrBuilder

getRulesOrBuilderList()

publicList<?extendsUsageRuleOrBuilder>getRulesOrBuilderList()

A list of usage rules that apply to individual API methods.NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.UsageRule rules = 6;

Returns
TypeDescription
List<? extends com.google.api.UsageRuleOrBuilder>

getSerializedSize()

publicintgetSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

publicfinalUnknownFieldSetgetUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

publicinthashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

publicUsage.BuildernewBuilderForType()
Returns
TypeDescription
Usage.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedUsage.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Usage.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

publicUsage.BuildertoBuilder()
Returns
TypeDescription
Usage.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
NameDescription
outputCodedOutputStream
OverridesExceptions
TypeDescription
IOException

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-31 UTC.