-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Quota] SDK validation for TypeSpec #52052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
f16b37c
fb856cf
ba8f163
76301f9
0b65b41
0c7ba79
50144c1
c7ee294
f144949
bb093d1
7fa6ed6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,78 @@ | ||||||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||||||
| // Licensed under the MIT License. | ||||||
|
|
||||||
| #nullable disable | ||||||
|
|
||||||
| using System.Collections.Generic; | ||||||
| using System.Linq; | ||||||
|
|
||||||
| namespace Azure.ResourceManager.Quota.Models | ||||||
| { | ||||||
| public static partial class ArmQuotaModelFactory | ||||||
| { | ||||||
| /// <summary> Initializes a new instance of <see cref="Models.GroupQuotaDetails"/>. </summary> | ||||||
| /// <param name="resourceName"> The resource name, such as SKU name. </param> | ||||||
| /// <param name="limit"> The current Group Quota Limit at the parentId level. </param> | ||||||
| /// <param name="comment"> Any comment related to quota request. </param> | ||||||
| /// <param name="unit"> The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET response in the request body of your PUT operation. </param> | ||||||
| /// <param name="value"> Resource name. </param> | ||||||
| /// <param name="localizedValue"> Resource display name. </param> | ||||||
| /// <param name="availableLimit"> The available Group Quota Limit at the MG level. This Group quota can be allocated to subscription(s). </param> | ||||||
| /// <param name="allocatedToSubscriptionsValue"> Quota allocated to subscriptions. </param> | ||||||
| /// <returns> A new <see cref="Models.GroupQuotaDetails"/> instance for mocking. </returns> | ||||||
| public static GroupQuotaDetails GroupQuotaDetails(string resourceName, long? limit, string comment, string unit, long? availableLimit = null, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Quota.Models.SubscriptionAllocatedQuota> allocatedToSubscriptionsValue = null, string value = null, string localizedValue = null) | ||||||
| { | ||||||
| return GroupQuotaDetails( | ||||||
| resourceName, | ||||||
| limit, | ||||||
| comment, | ||||||
| unit, | ||||||
| value, | ||||||
| localizedValue, | ||||||
| availableLimit, | ||||||
| allocatedToSubscriptionsValue); | ||||||
| } | ||||||
|
|
||||||
| /// <summary> Initializes a new instance of <see cref="Models.GroupQuotaLimitProperties"/>. </summary> | ||||||
| /// <param name="resourceName"> The resource name, such as SKU name. </param> | ||||||
| /// <param name="limit"> The current Group Quota Limit at the parentId level. </param> | ||||||
| /// <param name="comment"> Any comment related to quota request. </param> | ||||||
| /// <param name="unit"> The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET response in the request body of your PUT operation. </param> | ||||||
| /// <param name="value"> Resource name. </param> | ||||||
| /// <param name="localizedValue"> Resource display name. </param> | ||||||
| /// <param name="availableLimit"> The available Group Quota Limit at the MG level. This Group quota can be allocated to subscription(s). </param> | ||||||
| /// <param name="allocatedToSubscriptionsValue"> Quota allocated to subscriptions. </param> | ||||||
| /// <returns> A new <see cref="Models.GroupQuotaLimitProperties"/> instance for mocking. </returns> | ||||||
| public static GroupQuotaLimitProperties GroupQuotaLimitProperties(string resourceName, long? limit, string comment, string unit, long? availableLimit = null, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Quota.Models.SubscriptionAllocatedQuota> allocatedToSubscriptionsValue = null, string value = null, string localizedValue = null) | ||||||
|
||||||
| public static GroupQuotaLimitProperties GroupQuotaLimitProperties(string resourceName, long? limit, string comment, string unit, long? availableLimit = null, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Quota.Models.SubscriptionAllocatedQuota> allocatedToSubscriptionsValue = null, string value = null, string localizedValue = null) | |
| public static GroupQuotaLimitProperties GroupQuotaLimitProperties(string resourceName, long? limit, string comment, string unit, string value = null, string localizedValue = null, long? availableLimit = null, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Quota.Models.SubscriptionAllocatedQuota> allocatedToSubscriptionsValue = null) |
HarveyLink marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using Azure.Core; | ||
|
|
||
| namespace Azure.ResourceManager.Quota.Models | ||
| { | ||
| // This is a workaround for the code generator does not support to rename the type UnknownQuotaLimitJsonObject | ||
| [CodeGenType("UnknownQuotaLimitJsonObject")] | ||
HarveyLink marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| internal partial class UnknownLimitJsonObject | ||
| { | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter order in this method differs from the order used in the internal constructor call (lines 25-33). Consider reordering the parameters to match the constructor signature for better maintainability and to reduce confusion.