public sealed class QuotaLimit : IMessage<QuotaLimit>, IEquatable<QuotaLimit>, IDeepCloneable<QuotaLimit>, IBufferMessage, IMessage
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.
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.
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).
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.
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.
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.
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.
Specify the unit of the quota limit. It uses the same syntax as
[MetricDescriptor.unit][google.api.MetricDescriptor.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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003e\u003ccode\u003eQuotaLimit\u003c/code\u003e is a class that defines a specific limit within a \u003ccode\u003eQuotaGroup\u003c/code\u003e, applicable over a specified duration and for a specific limit type.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eQuotaLimit\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing functionalities such as deep cloning and protocol buffer message handling.\u003c/p\u003e\n"],["\u003cp\u003eIt contains properties like \u003ccode\u003eDefaultLimit\u003c/code\u003e, \u003ccode\u003eMaxLimit\u003c/code\u003e, and \u003ccode\u003eFreeTier\u003c/code\u003e, allowing for the configuration of default, maximum, and free tier token consumption limits.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eQuotaLimit\u003c/code\u003e includes properties such as \u003ccode\u003eDuration\u003c/code\u003e, \u003ccode\u003eMetric\u003c/code\u003e, and \u003ccode\u003eUnit\u003c/code\u003e for defining the time frame, applicable metric, and unit of measurement for a quota limit, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers methods for message manipulation like \u003ccode\u003eClone\u003c/code\u003e, \u003ccode\u003eEquals\u003c/code\u003e, \u003ccode\u003eMergeFrom\u003c/code\u003e, \u003ccode\u003eCalculateSize\u003c/code\u003e, and \u003ccode\u003eWriteTo\u003c/code\u003e to manage and interact with the QuotaLimit object.\u003c/p\u003e\n"]]],[],null,["# Class QuotaLimit (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.QuotaLimit)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.QuotaLimit)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.QuotaLimit)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.QuotaLimit) \n\n public sealed class QuotaLimit : IMessage\u003cQuotaLimit\u003e, IEquatable\u003cQuotaLimit\u003e, IDeepCloneable\u003cQuotaLimit\u003e, IBufferMessage, IMessage\n\n`QuotaLimit` defines a specific limit that applies over a specified duration\nfor a limit type. There can be at most one limit for a duration and limit\ntype combination defined within a `QuotaGroup`. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e QuotaLimit \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[QuotaLimit](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.QuotaLimit), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[QuotaLimit](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.QuotaLimit), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[QuotaLimit](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.QuotaLimit), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Api](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### QuotaLimit()\n\n public QuotaLimit()\n\n### QuotaLimit(QuotaLimit)\n\n public QuotaLimit(QuotaLimit other)\n\nFields\n------\n\n### DefaultLimitFieldNumber\n\n public const int DefaultLimitFieldNumber = 3\n\nField number for the \"default_limit\" field.\n\n### DescriptionFieldNumber\n\n public const int DescriptionFieldNumber = 2\n\nField number for the \"description\" field.\n\n### DisplayNameFieldNumber\n\n public const int DisplayNameFieldNumber = 12\n\nField number for the \"display_name\" field.\n\n### DurationFieldNumber\n\n public const int DurationFieldNumber = 5\n\nField number for the \"duration\" field.\n\n### FreeTierFieldNumber\n\n public const int FreeTierFieldNumber = 7\n\nField number for the \"free_tier\" field.\n\n### MaxLimitFieldNumber\n\n public const int MaxLimitFieldNumber = 4\n\nField number for the \"max_limit\" field.\n\n### MetricFieldNumber\n\n public const int MetricFieldNumber = 8\n\nField number for the \"metric\" field.\n\n### NameFieldNumber\n\n public const int NameFieldNumber = 6\n\nField number for the \"name\" field.\n\n### UnitFieldNumber\n\n public const int UnitFieldNumber = 9\n\nField number for the \"unit\" field.\n\n### ValuesFieldNumber\n\n public const int ValuesFieldNumber = 10\n\nField number for the \"values\" field.\n\nProperties\n----------\n\n### DefaultLimit\n\n public long DefaultLimit { get; set; }\n\nDefault number of tokens that can be consumed during the specified\nduration. This is the number of tokens assigned when a client\napplication developer activates the service for his/her project.\n\nSpecifying a value of 0 will block all requests. This can be used if you\nare provisioning quota to selected consumers and blocking others.\nSimilarly, a value of -1 will indicate an unlimited quota. No other\nnegative values are allowed.\n\nUsed by group-based quotas only.\n\n### Description\n\n public string Description { get; set; }\n\nOptional. User-visible, extended description for this quota limit.\nShould be used only when more context is needed to understand this limit\nthan provided by the limit's display name (see: `display_name`).\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### DisplayName\n\n public string DisplayName { get; set; }\n\nUser-visible display name for this limit.\nOptional. If not set, the UI will provide a default display name based on\nthe quota configuration. This field can be used to override the default\ndisplay name generated from the configuration.\n\n### Duration\n\n public string Duration { get; set; }\n\nDuration of this limit in textual notation. Must be \"100s\" or \"1d\".\n\nUsed by group-based quotas only.\n\n### FreeTier\n\n public long FreeTier { get; set; }\n\nFree tier value displayed in the Developers Console for this limit.\nThe free tier is the number of tokens that will be subtracted from the\nbilled amount when billing is enabled.\nThis field can only be set on a limit with duration \"1d\", in a billable\ngroup; it is invalid on any other limit. If this field is not set, it\ndefaults to 0, indicating that there is no free tier for this service.\n\nUsed by group-based quotas only.\n\n### MaxLimit\n\n public long MaxLimit { get; set; }\n\nMaximum number of tokens that can be consumed during the specified\nduration. Client application developers can override the default limit up\nto this maximum. If specified, this value cannot be set to a value less\nthan the default limit. If not specified, it is set to the default limit.\n\nTo allow clients to apply overrides with no upper bound, set this to -1,\nindicating unlimited maximum quota.\n\nUsed by group-based quotas only.\n\n### Metric\n\n public string Metric { get; set; }\n\nThe name of the metric this quota limit applies to. The quota limits with\nthe same metric will be checked together during runtime. The metric must be\ndefined within the service config.\n\n### Name\n\n public string Name { get; set; }\n\nName of the quota limit.\n\nThe name must be provided, and it must be unique within the service. The\nname can only include alphanumeric characters as well as '-'.\n\nThe maximum length of the limit name is 64 characters.\n\n### Parser\n\n public static MessageParser\u003cQuotaLimit\u003e Parser { get; }\n\n### Unit\n\n public string Unit { get; set; }\n\nSpecify the unit of the quota limit. It uses the same syntax as\n\\[MetricDescriptor.unit\\]\\[google.api.MetricDescriptor.unit\\]. The supported\nunit kinds are determined by the quota backend system.\n\nHere are some examples:\n\n- \"1/min/{project}\" for quota per minute per project.\n\nNote: the order of unit components is insignificant.\nThe \"1\" at the beginning is required to follow the metric unit syntax.\n\n### Values\n\n public MapField\u003cstring, long\u003e Values { get; }\n\nTiered limit values. You must specify this as a key:value pair, with an\ninteger value that is the maximum number of requests allowed for the\nspecified unit. Currently only STANDARD is supported.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public QuotaLimit Clone()\n\n### Equals(QuotaLimit)\n\n public bool Equals(QuotaLimit other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(QuotaLimit)\n\n public void MergeFrom(QuotaLimit other)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]