Class QuotaLimit (2.41.0)

public final class QuotaLimit extends GeneratedMessageV3 implements QuotaLimitOrBuilder

QuotaLimit defines a specific limit that applies over a specified duration for a limit type. There can be at most one limit for a duration and limit type combination defined within a QuotaGroup.

Protobuf type google.api.QuotaLimit

Implements

QuotaLimitOrBuilder

Static Fields

DEFAULT_LIMIT_FIELD_NUMBER

public static final int DEFAULT_LIMIT_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

DURATION_FIELD_NUMBER

public static final int DURATION_FIELD_NUMBER
Field Value
Type Description
int

FREE_TIER_FIELD_NUMBER

public static final int FREE_TIER_FIELD_NUMBER
Field Value
Type Description
int

MAX_LIMIT_FIELD_NUMBER

public static final int MAX_LIMIT_FIELD_NUMBER
Field Value
Type Description
int

METRIC_FIELD_NUMBER

public static final int METRIC_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

UNIT_FIELD_NUMBER

public static final int UNIT_FIELD_NUMBER
Field Value
Type Description
int

VALUES_FIELD_NUMBER

public static final int VALUES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static QuotaLimit getDefaultInstance()
Returns
Type Description
QuotaLimit

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static QuotaLimit.Builder newBuilder()
Returns
Type Description
QuotaLimit.Builder

newBuilder(QuotaLimit prototype)

public static QuotaLimit.Builder newBuilder(QuotaLimit prototype)
Parameter
Name Description
prototype QuotaLimit
Returns
Type Description
QuotaLimit.Builder

parseDelimitedFrom(InputStream input)

public static QuotaLimit parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
QuotaLimit
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
QuotaLimit
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static QuotaLimit parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
QuotaLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
QuotaLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static QuotaLimit parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
QuotaLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
QuotaLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static QuotaLimit parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
QuotaLimit
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
QuotaLimit
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static QuotaLimit parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
QuotaLimit
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
QuotaLimit
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static QuotaLimit parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
QuotaLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
QuotaLimit
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<QuotaLimit> parser()
Returns
Type Description
Parser<QuotaLimit>

Methods

containsValues(String key)

public boolean containsValues(String key)

Tiered limit values. You must specify this as a key:value pair, with an integer value that is the maximum number of requests allowed for the specified unit. Currently only STANDARD is supported.

map<string, int64> values = 10;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public QuotaLimit getDefaultInstanceForType()
Returns
Type Description
QuotaLimit

getDefaultLimit()

public long getDefaultLimit()

Default number of tokens that can be consumed during the specified duration. This is the number of tokens assigned when a client application developer activates the service for his/her project.

Specifying a value of 0 will block all requests. This can be used if you are provisioning quota to selected consumers and blocking others. Similarly, a value of -1 will indicate an unlimited quota. No other negative values are allowed.

Used by group-based quotas only.

int64 default_limit = 3;

Returns
Type Description
long

The defaultLimit.

getDescription()

public String getDescription()

Optional. User-visible, extended description for this quota limit. Should be used only when more context is needed to understand this limit than provided by the limit's display name (see: display_name).

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. User-visible, extended description for this quota limit. Should be used only when more context is needed to understand this limit than provided by the limit's display name (see: display_name).

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getDisplayName()

public String getDisplayName()

User-visible display name for this limit. Optional. If not set, the UI will provide a default display name based on the quota configuration. This field can be used to override the default display name generated from the configuration.

string display_name = 12;

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

User-visible display name for this limit. Optional. If not set, the UI will provide a default display name based on the quota configuration. This field can be used to override the default display name generated from the configuration.

string display_name = 12;

Returns
Type Description
ByteString

The bytes for displayName.

getDuration()

public String getDuration()

Duration of this limit in textual notation. Must be "100s" or "1d".

Used by group-based quotas only.

string duration = 5;

Returns
Type Description
String

The duration.

getDurationBytes()

public ByteString getDurationBytes()

Duration of this limit in textual notation. Must be "100s" or "1d".

Used by group-based quotas only.

string duration = 5;

Returns
Type Description
ByteString

The bytes for duration.

getFreeTier()

public long getFreeTier()

Free tier value displayed in the Developers Console for this limit. The free tier is the number of tokens that will be subtracted from the billed amount when billing is enabled. This field can only be set on a limit with duration "1d", in a billable group; it is invalid on any other limit. If this field is not set, it defaults to 0, indicating that there is no free tier for this service.

Used by group-based quotas only.

int64 free_tier = 7;

Returns
Type Description
long

The freeTier.

getMaxLimit()

public long getMaxLimit()

Maximum number of tokens that can be consumed during the specified duration. Client application developers can override the default limit up to this maximum. If specified, this value cannot be set to a value less than the default limit. If not specified, it is set to the default limit.

To allow clients to apply overrides with no upper bound, set this to -1, indicating unlimited maximum quota.

Used by group-based quotas only.

int64 max_limit = 4;

Returns
Type Description
long

The maxLimit.

getMetric()

public String getMetric()

The name of the metric this quota limit applies to. The quota limits with the same metric will be checked together during runtime. The metric must be defined within the service config.

string metric = 8;

Returns
Type Description
String

The metric.

getMetricBytes()

public ByteString getMetricBytes()

The name of the metric this quota limit applies to. The quota limits with the same metric will be checked together during runtime. The metric must be defined within the service config.

string metric = 8;

Returns
Type Description
ByteString

The bytes for metric.

getName()

public String getName()

Name of the quota limit.

The name must be provided, and it must be unique within the service. The name can only include alphanumeric characters as well as '-'.

The maximum length of the limit name is 64 characters.

string name = 6;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of the quota limit.

The name must be provided, and it must be unique within the service. The name can only include alphanumeric characters as well as '-'.

The maximum length of the limit name is 64 characters.

string name = 6;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<QuotaLimit> getParserForType()
Returns
Type Description
Parser<QuotaLimit>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUnit()

public String getUnit()

Specify the unit of the quota limit. It uses the same syntax as [Metric.unit][]. The supported unit kinds are determined by the quota backend system.

Here are some examples:

  • "1/min/{project}" for quota per minute per project.

    Note: the order of unit components is insignificant. The "1" at the beginning is required to follow the metric unit syntax.

string unit = 9;

Returns
Type Description
String

The unit.

getUnitBytes()

public ByteString getUnitBytes()

Specify the unit of the quota limit. It uses the same syntax as [Metric.unit][]. The supported unit kinds are determined by the quota backend system.

Here are some examples:

  • "1/min/{project}" for quota per minute per project.

    Note: the order of unit components is insignificant. The "1" at the beginning is required to follow the metric unit syntax.

string unit = 9;

Returns
Type Description
ByteString

The bytes for unit.

getValues() (deprecated)

public Map<String,Long> getValues()

Use #getValuesMap() instead.

Returns
Type Description
Map<String,Long>

getValuesCount()

public int getValuesCount()

Tiered limit values. You must specify this as a key:value pair, with an integer value that is the maximum number of requests allowed for the specified unit. Currently only STANDARD is supported.

map<string, int64> values = 10;

Returns
Type Description
int

getValuesMap()

public Map<String,Long> getValuesMap()

Tiered limit values. You must specify this as a key:value pair, with an integer value that is the maximum number of requests allowed for the specified unit. Currently only STANDARD is supported.

map<string, int64> values = 10;

Returns
Type Description
Map<String,Long>

getValuesOrDefault(String key, long defaultValue)

public long getValuesOrDefault(String key, long defaultValue)

Tiered limit values. You must specify this as a key:value pair, with an integer value that is the maximum number of requests allowed for the specified unit. Currently only STANDARD is supported.

map<string, int64> values = 10;

Parameters
Name Description
key String
defaultValue long
Returns
Type Description
long

getValuesOrThrow(String key)

public long getValuesOrThrow(String key)

Tiered limit values. You must specify this as a key:value pair, with an integer value that is the maximum number of requests allowed for the specified unit. Currently only STANDARD is supported.

map<string, int64> values = 10;

Parameter
Name Description
key String
Returns
Type Description
long

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public QuotaLimit.Builder newBuilderForType()
Returns
Type Description
QuotaLimit.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected QuotaLimit.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
QuotaLimit.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public QuotaLimit.Builder toBuilder()
Returns
Type Description
QuotaLimit.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException