public sealed class UsageResourceAllowanceSpec.Types.Limit : IMessage<UsageResourceAllowanceSpec.Types.Limit>, IEquatable<UsageResourceAllowanceSpec.Types.Limit>, IDeepCloneable<UsageResourceAllowanceSpec.Types.Limit>, IBufferMessage, IMessage
Reference documentation and code samples for the Batch v1alpha API class UsageResourceAllowanceSpec.Types.Limit.
Required. Limit value of a UsageResourceAllowance within its one
duration.
Limit cannot be a negative value. Default is 0.
For example, you can set limit as 10000.0 with duration of the current
month by setting calendar_period field as monthly. That means in your
current month, 10000.0 is the core hour limitation that your resources
are allowed to consume.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis documentation provides details for the \u003ccode\u003eUsageResourceAllowanceSpec.Types.Limit\u003c/code\u003e class within the Batch v1alpha API, which is designed to define limitations on resource usage allowance.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUsageResourceAllowanceSpec.Types.Limit\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, allowing for various object manipulations and comparisons.\u003c/p\u003e\n"],["\u003cp\u003eThe class has a \u003ccode\u003eLimit_\u003c/code\u003e property that represents the maximum allowable value for resource usage within a specified duration and it cannot be negative with the default value of 0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCalendarPeriod\u003c/code\u003e property allows for specifying the time period (e.g., monthly) for the limit to apply, providing control over the duration of the usage allowance.\u003c/p\u003e\n"],["\u003cp\u003eThere are two constructor overloads, one default and one that takes an existing \u003ccode\u003eUsageResourceAllowanceSpec.Types.Limit\u003c/code\u003e instance, enabling both initial creation and copying of \u003ccode\u003eLimit\u003c/code\u003e objects.\u003c/p\u003e\n"]]],[],null,["# Batch v1alpha API - Class UsageResourceAllowanceSpec.Types.Limit (1.0.0-alpha31)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-alpha31 (latest)](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types.Limit)\n- [1.0.0-alpha30](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/1.0.0-alpha30/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types.Limit) \n\n public sealed class UsageResourceAllowanceSpec.Types.Limit : IMessage\u003cUsageResourceAllowanceSpec.Types.Limit\u003e, IEquatable\u003cUsageResourceAllowanceSpec.Types.Limit\u003e, IDeepCloneable\u003cUsageResourceAllowanceSpec.Types.Limit\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Batch v1alpha API class UsageResourceAllowanceSpec.Types.Limit.\n\nUsageResourceAllowance limitation. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e UsageResourceAllowanceSpec.Types.Limit \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[UsageResourceAllowanceSpec](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types)[Limit](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types.Limit), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[UsageResourceAllowanceSpec](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types)[Limit](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types.Limit), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[UsageResourceAllowanceSpec](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types)[Limit](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.UsageResourceAllowanceSpec.Types.Limit), [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.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Batch.V1Alpha](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha)\n\nAssembly\n--------\n\nGoogle.Cloud.Batch.V1Alpha.dll\n\nConstructors\n------------\n\n### Limit()\n\n public Limit()\n\n### Limit(Limit)\n\n public Limit(UsageResourceAllowanceSpec.Types.Limit other)\n\nProperties\n----------\n\n### CalendarPeriod\n\n public CalendarPeriod CalendarPeriod { get; set; }\n\nOptional. A CalendarPeriod represents the abstract concept of a time\nperiod that has a canonical start.\n\n### DurationCase\n\n public UsageResourceAllowanceSpec.Types.Limit.DurationOneofCase DurationCase { get; }\n\n### HasCalendarPeriod\n\n public bool HasCalendarPeriod { get; }\n\nGets whether the \"calendar_period\" field is set\n\n### HasLimit_\n\n public bool HasLimit_ { get; }\n\nGets whether the \"limit\" field is set\n\n### Limit_\n\n public double Limit_ { get; set; }\n\nRequired. Limit value of a UsageResourceAllowance within its one\nduration.\n\nLimit cannot be a negative value. Default is 0.\nFor example, you can set `limit` as 10000.0 with duration of the current\nmonth by setting `calendar_period` field as monthly. That means in your\ncurrent month, 10000.0 is the core hour limitation that your resources\nare allowed to consume."]]