Class QuotaLimit
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
System.Object
QuotaLimit
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class QuotaLimit : IMessage<QuotaLimit>, IMessage, IEquatable<QuotaLimit>, IDeepCloneable<QuotaLimit>
Constructors
QuotaLimit()
Declaration
QuotaLimit(QuotaLimit)
Declaration
public QuotaLimit(QuotaLimit other)
Parameters
Fields
DefaultLimitFieldNumber
Field number for the "default_limit" field.
Declaration
public const int DefaultLimitFieldNumber = 3
Field Value
Type |
Description |
System.Int32 |
|
DescriptionFieldNumber
Field number for the "description" field.
Declaration
public const int DescriptionFieldNumber = 2
Field Value
Type |
Description |
System.Int32 |
|
DisplayNameFieldNumber
Field number for the "display_name" field.
Declaration
public const int DisplayNameFieldNumber = 12
Field Value
Type |
Description |
System.Int32 |
|
DurationFieldNumber
Field number for the "duration" field.
Declaration
public const int DurationFieldNumber = 5
Field Value
Type |
Description |
System.Int32 |
|
FreeTierFieldNumber
Field number for the "free_tier" field.
Declaration
public const int FreeTierFieldNumber = 7
Field Value
Type |
Description |
System.Int32 |
|
MaxLimitFieldNumber
Field number for the "max_limit" field.
Declaration
public const int MaxLimitFieldNumber = 4
Field Value
Type |
Description |
System.Int32 |
|
MetricFieldNumber
Field number for the "metric" field.
Declaration
public const int MetricFieldNumber = 8
Field Value
Type |
Description |
System.Int32 |
|
NameFieldNumber
Field number for the "name" field.
Declaration
public const int NameFieldNumber = 6
Field Value
Type |
Description |
System.Int32 |
|
UnitFieldNumber
Field number for the "unit" field.
Declaration
public const int UnitFieldNumber = 9
Field Value
Type |
Description |
System.Int32 |
|
ValuesFieldNumber
Field number for the "values" field.
Declaration
public const int ValuesFieldNumber = 10
Field Value
Type |
Description |
System.Int32 |
|
Properties
DefaultLimit
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.
Declaration
public long DefaultLimit { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
Description
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
).
Declaration
public string Description { get; set; }
Property Value
Type |
Description |
System.String |
|
Descriptor
Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
DisplayName
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.
Declaration
public string DisplayName { get; set; }
Property Value
Type |
Description |
System.String |
|
Duration
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.
Used by group-based quotas only.
Declaration
public string Duration { get; set; }
Property Value
Type |
Description |
System.String |
|
FreeTier
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.
Declaration
public long FreeTier { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
MaxLimit
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.
Declaration
public long MaxLimit { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
Metric
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.
Declaration
public string Metric { get; set; }
Property Value
Type |
Description |
System.String |
|
Name
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.
Declaration
public string Name { get; set; }
Property Value
Type |
Description |
System.String |
|
Parser
Declaration
public static MessageParser<QuotaLimit> Parser { get; }
Property Value
Unit
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.
Declaration
public string Unit { get; set; }
Property Value
Type |
Description |
System.String |
|
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.
Declaration
public MapField<string, long> Values { get; }
Property Value
Type |
Description |
MapField<System.String, System.Int64> |
|
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
Clone()
Declaration
public QuotaLimit Clone()
Returns
Implements
Equals(QuotaLimit)
Declaration
public bool Equals(QuotaLimit other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>.Equals(T)
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
MergeFrom(QuotaLimit)
Declaration
public void MergeFrom(QuotaLimit other)
Parameters
Implements
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
WriteTo(CodedOutputStream)
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Implements
Explicit Interface Implementations
IMessage.Descriptor
Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Implements