Class QuotaLimit.Builder (2.44.0)

public static final class QuotaLimit.Builder extends GeneratedMessageV3.Builder<QuotaLimit.Builder> 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 Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public QuotaLimit.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
QuotaLimit.Builder
Overrides

build()

public QuotaLimit build()
Returns
Type Description
QuotaLimit

buildPartial()

public QuotaLimit buildPartial()
Returns
Type Description
QuotaLimit

clear()

public QuotaLimit.Builder clear()
Returns
Type Description
QuotaLimit.Builder
Overrides

clearDefaultLimit()

public QuotaLimit.Builder clearDefaultLimit()

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
QuotaLimit.Builder

This builder for chaining.

clearDescription()

public QuotaLimit.Builder clearDescription()

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
QuotaLimit.Builder

This builder for chaining.

clearDisplayName()

public QuotaLimit.Builder clearDisplayName()

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
QuotaLimit.Builder

This builder for chaining.

clearDuration()

public QuotaLimit.Builder clearDuration()

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

Used by group-based quotas only.

string duration = 5;

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public QuotaLimit.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
QuotaLimit.Builder
Overrides

clearFreeTier()

public QuotaLimit.Builder clearFreeTier()

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
QuotaLimit.Builder

This builder for chaining.

clearMaxLimit()

public QuotaLimit.Builder clearMaxLimit()

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
QuotaLimit.Builder

This builder for chaining.

clearMetric()

public QuotaLimit.Builder clearMetric()

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
QuotaLimit.Builder

This builder for chaining.

clearName()

public QuotaLimit.Builder clearName()

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
QuotaLimit.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public QuotaLimit.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
QuotaLimit.Builder
Overrides

clearUnit()

public QuotaLimit.Builder clearUnit()

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
QuotaLimit.Builder

This builder for chaining.

clearValues()

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

clone()

public QuotaLimit.Builder clone()
Returns
Type Description
QuotaLimit.Builder
Overrides

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

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.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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.

getMutableValues() (deprecated)

public Map<String,Long> getMutableValues()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,Long>

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.

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

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.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(QuotaLimit other)

public QuotaLimit.Builder mergeFrom(QuotaLimit other)
Parameter
Name Description
other QuotaLimit
Returns
Type Description
QuotaLimit.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public QuotaLimit.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
QuotaLimit.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public QuotaLimit.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
QuotaLimit.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final QuotaLimit.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
QuotaLimit.Builder
Overrides

putAllValues(Map<String,Long> values)

public QuotaLimit.Builder putAllValues(Map<String,Long> values)

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
values Map<String,Long>
Returns
Type Description
QuotaLimit.Builder

putValues(String key, long value)

public QuotaLimit.Builder putValues(String key, long value)

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
value long
Returns
Type Description
QuotaLimit.Builder

removeValues(String key)

public QuotaLimit.Builder removeValues(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
QuotaLimit.Builder

setDefaultLimit(long value)

public QuotaLimit.Builder setDefaultLimit(long value)

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;

Parameter
Name Description
value long

The defaultLimit to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setDescription(String value)

public QuotaLimit.Builder setDescription(String value)

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;

Parameter
Name Description
value String

The description to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public QuotaLimit.Builder setDescriptionBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setDisplayName(String value)

public QuotaLimit.Builder setDisplayName(String value)

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;

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public QuotaLimit.Builder setDisplayNameBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setDuration(String value)

public QuotaLimit.Builder setDuration(String value)

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

Used by group-based quotas only.

string duration = 5;

Parameter
Name Description
value String

The duration to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setDurationBytes(ByteString value)

public QuotaLimit.Builder setDurationBytes(ByteString value)

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

Used by group-based quotas only.

string duration = 5;

Parameter
Name Description
value ByteString

The bytes for duration to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public QuotaLimit.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
QuotaLimit.Builder
Overrides

setFreeTier(long value)

public QuotaLimit.Builder setFreeTier(long value)

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;

Parameter
Name Description
value long

The freeTier to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setMaxLimit(long value)

public QuotaLimit.Builder setMaxLimit(long value)

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;

Parameter
Name Description
value long

The maxLimit to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setMetric(String value)

public QuotaLimit.Builder setMetric(String value)

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;

Parameter
Name Description
value String

The metric to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setMetricBytes(ByteString value)

public QuotaLimit.Builder setMetricBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for metric to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setName(String value)

public QuotaLimit.Builder setName(String value)

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;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setNameBytes(ByteString value)

public QuotaLimit.Builder setNameBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public QuotaLimit.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
QuotaLimit.Builder
Overrides

setUnit(String value)

public QuotaLimit.Builder setUnit(String value)

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;

Parameter
Name Description
value String

The unit to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setUnitBytes(ByteString value)

public QuotaLimit.Builder setUnitBytes(ByteString value)

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;

Parameter
Name Description
value ByteString

The bytes for unit to set.

Returns
Type Description
QuotaLimit.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final QuotaLimit.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
QuotaLimit.Builder
Overrides