Class QuotaLimit (2.8.4)

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
TypeDescription
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

DURATION_FIELD_NUMBER

public static final int DURATION_FIELD_NUMBER
Field Value
TypeDescription
int

FREE_TIER_FIELD_NUMBER

public static final int FREE_TIER_FIELD_NUMBER
Field Value
TypeDescription
int

MAX_LIMIT_FIELD_NUMBER

public static final int MAX_LIMIT_FIELD_NUMBER
Field Value
TypeDescription
int

METRIC_FIELD_NUMBER

public static final int METRIC_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

UNIT_FIELD_NUMBER

public static final int UNIT_FIELD_NUMBER
Field Value
TypeDescription
int

VALUES_FIELD_NUMBER

public static final int VALUES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static QuotaLimit getDefaultInstance()
Returns
TypeDescription
QuotaLimit

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static QuotaLimit.Builder newBuilder()
Returns
TypeDescription
QuotaLimit.Builder

newBuilder(QuotaLimit prototype)

public static QuotaLimit.Builder newBuilder(QuotaLimit prototype)
Parameter
NameDescription
prototypeQuotaLimit
Returns
TypeDescription
QuotaLimit.Builder

parseDelimitedFrom(InputStream input)

public static QuotaLimit parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static QuotaLimit parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static QuotaLimit parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static QuotaLimit parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static QuotaLimit parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static QuotaLimit parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static QuotaLimit parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
QuotaLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<QuotaLimit> parser()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public QuotaLimit getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<QuotaLimit> getParserForType()
Returns
TypeDescription
Parser<QuotaLimit>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for unit.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

getValues()

public Map<String,Long> getValues()

Use #getValuesMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValuelong
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
long

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public QuotaLimit.Builder newBuilderForType()
Returns
TypeDescription
QuotaLimit.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected QuotaLimit.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
QuotaLimit.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public QuotaLimit.Builder toBuilder()
Returns
TypeDescription
QuotaLimit.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException