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
Static Fields
DEFAULT_LIMIT_FIELD_NUMBER
public static final int DEFAULT_LIMIT_FIELD_NUMBER
Field Value
DESCRIPTION_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
Field Value
DISPLAY_NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
DURATION_FIELD_NUMBER
public static final int DURATION_FIELD_NUMBER
Field Value
FREE_TIER_FIELD_NUMBER
public static final int FREE_TIER_FIELD_NUMBER
Field Value
MAX_LIMIT_FIELD_NUMBER
public static final int MAX_LIMIT_FIELD_NUMBER
Field Value
METRIC_FIELD_NUMBER
public static final int METRIC_FIELD_NUMBER
Field Value
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value
UNIT_FIELD_NUMBER
public static final int UNIT_FIELD_NUMBER
Field Value
VALUES_FIELD_NUMBER
public static final int VALUES_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static QuotaLimit getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static QuotaLimit.Builder newBuilder()
Returns
newBuilder(QuotaLimit prototype)
public static QuotaLimit.Builder newBuilder(QuotaLimit prototype)
Parameter
Returns
public static QuotaLimit parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static QuotaLimit parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static QuotaLimit parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static QuotaLimit parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static QuotaLimit parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static QuotaLimit parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static QuotaLimit parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static QuotaLimit parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static QuotaLimit parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static QuotaLimit parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static QuotaLimit parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static QuotaLimit parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<QuotaLimit> parser()
Returns
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
Returns
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstanceForType()
public QuotaLimit getDefaultInstanceForType()
Returns
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
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
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
getParserForType()
public Parser<QuotaLimit> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
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
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
getValues()
public Map<String,Long> getValues()
Returns
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
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
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
Returns
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
Returns
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public QuotaLimit.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected QuotaLimit.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public QuotaLimit.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions