QuotaLimit class
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
.
- Inheritance
-
- Object
- GeneratedMessage
- QuotaLimit
- Available extensions
Constructors
-
QuotaLimit.new({String? description, Int64? defaultLimit, Int64? maxLimit, String? duration, String? name, Int64? freeTier, String? metric, String? unit, PbMap<
String, Int64> ? values, String? displayName}) -
factory
-
QuotaLimit.fromBuffer(List<
int> i, [ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) -
factory
- QuotaLimit.fromJson(String i, [ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY])
-
factory
Properties
- defaultLimit ↔ Int64
-
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.
getter/setter pair
- description ↔ String
-
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
).getter/setter pair - displayName ↔ String
-
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.
getter/setter pair
- duration ↔ String
-
Duration of this limit in textual notation. Example: "100s", "24h", "1d".
For duration longer than a day, only multiple of days is supported. We
support only "100s" and "1d" for now. Additional support will be added in
the future. "0" indicates indefinite duration.
getter/setter pair
- freeTier ↔ Int64
-
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.
getter/setter pair
- hashCode → int
-
Calculates a hash code based on the contents of the protobuf.
no setterinherited
- info_ → BuilderInfo
-
no setteroverride
- isFrozen → bool
-
Returns
true
if this message is marked read-only. Otherwisefalse
.no setterinherited - maxLimit ↔ Int64
-
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.
getter/setter pair
- metric ↔ String
-
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.
getter/setter pair
- name ↔ String
-
Name of the quota limit. The name is used to refer to the limit when
overriding the default limit on per-consumer basis.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unit ↔ String
-
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.getter/setter pair - unknownFields → UnknownFieldSet
-
no setterinherited
-
values
→ PbMap<
String, Int64> -
Tiered limit values. Also allows for regional or zone overrides for these
values if "/{region}" or "/{zone}" is specified in the unit field.
no setter
Methods
-
addExtension(
Extension extension, Object? value) → void -
Adds an extension field value to a repeated field.
inherited
-
check(
) → void -
Throws a StateError if the message has required fields without a value.
inherited
-
clear(
) → void -
Clears all data that was set in this message.
inherited
-
clearDefaultLimit(
) → void -
clearDescription(
) → void -
clearDisplayName(
) → void -
clearDuration(
) → void -
clearExtension(
Extension extension) → void -
Clears an extension field and also removes the extension.
inherited
-
clearField(
int tagNumber) → void -
Clears the contents of a given field.
inherited
-
clearFreeTier(
) → void -
clearMaxLimit(
) → void -
clearMetric(
) → void -
clearName(
) → void -
clearUnit(
) → void -
clone(
) → QuotaLimit -
Creates a deep copy of the fields in this message.
(The generated code uses mergeFromMessage.)
override
-
copyWith(
void updates(QuotaLimit)) → QuotaLimit -
Apply
updates
to a copy of this message.override -
createEmptyInstance(
) → QuotaLimit -
Creates an empty instance of the same message type as this.
override
-
deepCopy(
) → T -
Available on T, provided by the GeneratedMessageGenericExtensions extension
Returns a writable deep copy of this message. -
extensionsAreInitialized(
) → bool -
inherited
-
freeze(
) → GeneratedMessage -
Make this message read-only.
inherited
-
getDefaultForField(
int tagNumber) → dynamic -
Returns the default value for the given field.
inherited
-
getExtension(
Extension extension) → dynamic -
Returns the value of
extension
.inherited -
getField(
int tagNumber) → dynamic -
Returns the value of the field associated with
tagNumber
, or the default value if it is not set.inherited -
getFieldOrNull(
int tagNumber) → dynamic -
Returns the value of a field, ignoring any defaults.
inherited
-
getTagNumber(
String fieldName) → int? -
inherited
-
hasDefaultLimit(
) → bool -
hasDescription(
) → bool -
hasDisplayName(
) → bool -
hasDuration(
) → bool -
hasExtension(
Extension extension) → bool -
Returns
true
if a value ofextension
is present.inherited -
hasField(
int tagNumber) → bool -
Whether this message has a field associated with
tagNumber
.inherited -
hasFreeTier(
) → bool -
hasMaxLimit(
) → bool -
hasMetric(
) → bool -
hasName(
) → bool -
hasRequiredFields(
) → bool -
Whether the message has required fields.
inherited
-
hasUnit(
) → bool -
isInitialized(
) → bool -
Whether all required fields in the message and embedded messages are set.
inherited
-
mergeFromBuffer(
List< int> input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges serialized protocol buffer data into this message.
inherited
-
mergeFromCodedBufferReader(
CodedBufferReader input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Same as
mergeFromBuffer
, but takes aCodedBufferReader
input.inherited -
mergeFromJson(
String data, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges field values from
data
, a JSON object, encoded as described byGeneratedMessage.writeToJson
.inherited -
mergeFromJsonMap(
Map< String, dynamic> json, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges field values from a JSON object represented as a Dart map.
inherited
-
mergeFromMessage(
GeneratedMessage other) → void -
Merges the contents of the
other
into this message.inherited -
mergeFromProto3Json(
Object? json, {TypeRegistry typeRegistry = const TypeRegistry.empty(), bool ignoreUnknownFields = false, bool supportNamesWithUnderscores = true, bool permissiveEnums = false}) → void -
Merges field values from
json
, a JSON object using proto3 encoding.inherited -
mergeUnknownFields(
UnknownFieldSet unknownFieldSet) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rebuild(
void updates(T)) → T -
Available on T, provided by the GeneratedMessageGenericExtensions extension
Applyupdates
to a copy of this message. -
setExtension(
Extension extension, Object value) → void -
Sets the value of a non-repeated extension field to
value
.inherited -
setField(
int tagNumber, Object value) → void -
Sets the value of a field by its
tagNumber
.inherited -
toBuilder(
) → GeneratedMessage -
Creates a writable, shallow copy of this message.
inherited
-
toDebugString(
) → String -
Returns a String representation of this message.
inherited
-
toProto3Json(
{TypeRegistry typeRegistry = const TypeRegistry.empty()}) → Object? -
Returns an Object representing Proto3 JSON serialization of
this
.inherited -
toString(
) → String -
Returns a String representation of this message.
inherited
-
writeToBuffer(
) → Uint8List -
Serialize the message as the protobuf binary format.
inherited
-
writeToCodedBufferWriter(
CodedBufferWriter output) → void -
Same as
writeToBuffer
, but serializes to the givenCodedBufferWriter
.inherited -
writeToJson(
) → String -
Returns a JSON string that encodes this message.
inherited
-
writeToJsonMap(
) → Map< String, dynamic> -
Returns the JSON encoding of this message as a Dart Map.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
) → QuotaLimit -
createRepeated(
) → PbList< QuotaLimit> -
getDefault(
) → QuotaLimit