From bb868e8c9b625013a728bc3311317f44b1aa9e5b Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 12 Dec 2025 10:07:21 +0800 Subject: [PATCH 01/31] converted --- .../Commerce.Management/back-compatible.tsp | 43 +++ .../2015-06-01-preview/GetRateCard.json | 35 ++ .../GetUsageAggregatesList.json | 45 +++ .../commerce/Commerce.Management/main.tsp | 42 +++ .../commerce/Commerce.Management/models.tsp | 356 ++++++++++++++++++ .../commerce/Commerce.Management/routes.tsp | 90 +++++ .../Commerce.Management/tspconfig.yaml | 13 + 7 files changed, 624 insertions(+) create mode 100644 specification/commerce/Commerce.Management/back-compatible.tsp create mode 100644 specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json create mode 100644 specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json create mode 100644 specification/commerce/Commerce.Management/main.tsp create mode 100644 specification/commerce/Commerce.Management/models.tsp create mode 100644 specification/commerce/Commerce.Management/routes.tsp create mode 100644 specification/commerce/Commerce.Management/tspconfig.yaml diff --git a/specification/commerce/Commerce.Management/back-compatible.tsp b/specification/commerce/Commerce.Management/back-compatible.tsp new file mode 100644 index 000000000000..d125a155b924 --- /dev/null +++ b/specification/commerce/Commerce.Management/back-compatible.tsp @@ -0,0 +1,43 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using UsageManagementClient; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +@@Legacy.flattenProperty(UsageAggregation.properties); + +@@clientName(ResourceRateCardInfo.Currency, "currency"); +@@clientName(ResourceRateCardInfo.Locale, "locale"); +@@clientName(ResourceRateCardInfo.OfferTerms, "offerTerms"); +@@clientName(ResourceRateCardInfo.Meters, "meters"); + +@@clientName(OfferTermInfoAutoGenerated.Name, "name"); +@@clientName(OfferTermInfoAutoGenerated.EffectiveDate, "effectiveDate"); + +@@clientName(MeterInfo.MeterId, "meterId"); +@@clientName(MeterInfo.MeterName, "meterName"); +@@clientName(MeterInfo.MeterCategory, "meterCategory"); +@@clientName(MeterInfo.MeterSubCategory, "meterSubCategory"); +@@clientName(MeterInfo.Unit, "unit"); +@@clientName(MeterInfo.MeterTags, "meterTags"); +@@clientName(MeterInfo.MeterRegion, "meterRegion"); +@@clientName(MeterInfo.MeterRates, "meterRates"); +@@clientName(MeterInfo.EffectiveDate, "effectiveDate"); +@@clientName(MeterInfo.IncludedQuantity, "includedQuantity"); + +@@clientName(RateCardQueryParameters.OfferDurableId, "offerDurableId"); +@@clientName(RateCardQueryParameters.Currency, "currency"); +@@clientName(RateCardQueryParameters.Locale, "locale"); +@@clientName(RateCardQueryParameters.RegionInfo, "regionInfo"); + +@@clientName(MonetaryCredit.Credit, "credit"); +@@clientName(MonetaryCredit.ExcludedMeterIds, "excludedMeterIds"); + +@@clientName(MonetaryCommitment.TieredDiscount, "tieredDiscount"); +@@clientName(MonetaryCommitment.ExcludedMeterIds, "excludedMeterIds"); + +@@clientName(RecurringCharge.RecurringCharge, "recurringCharge"); + +@@clientLocation(UsageAggregatesOperationGroup.list, "UsageAggregates"); + +@@clientLocation(RateCardOperationGroup.get, "RateCard"); diff --git a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json new file mode 100644 index 000000000000..10c40b144730 --- /dev/null +++ b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "$filter": "OfferDurableId eq 'MS-AZR-0003P' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'", + "api-version": "2015-06-01-preview", + "subscriptionId": "6d61cc05-8f8f-4916-b1b9-f1d9c25aae27" + }, + "title": "GetRateCard", + "responses": { + "200": { + "body": { + "Meters": [ + { + "EffectiveDate": "2017-09-01T00:00:00Z", + "IncludedQuantity": 0, + "MeterCategory": "Test Category", + "MeterId": "1d7518e5-bc2f-4a93-9057-1b3047856645", + "MeterName": "Test Meter", + "MeterRates": { + "0": 1.99, + "100": 0.99 + }, + "MeterRegion": "US West", + "MeterSubCategory": "Test Subcategory", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + } + ], + "OfferTerms": [] + } + } + }, + "operationId": "RateCard_Get" +} \ No newline at end of file diff --git a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json new file mode 100644 index 000000000000..9483fe55e955 --- /dev/null +++ b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "aggregationGranularity": "Daily", + "api-version": "2015-06-01-preview", + "reportedEndTime": "2015-06-01T00:00:00+00:00", + "reportedStartTime": "2014-05-01T00:00:00+00:00", + "showDetails": "true", + "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b" + }, + "title": "GetUsageAggregatesList", + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Daily_BRSDT_20140501_0000", + "type": "Microsoft.Commerce/UsageAggregate", + "id": "/subscriptions/f68815e6-3c41-45ef-bbd8-5f83303c396b/providers/Microsoft.Commerce/UsageAggregates/Daily_BRSDT_20140501_0000", + "properties": { + "infoFields": {}, + "meterCategory": "Storage", + "meterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4", + "meterName": "Standard IO – Page Blob/Disk (GB)", + "meterSubCategory": "Geo Redundant", + "quantity": 0.057865, + "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b", + "unit": "GB", + "usageEndTime": "2015-03-04T00:00:00+00:00", + "usageStartTime": "2015-03-03T00:00:00+00:00" + } + } + ] + } + }, + "202": { + "body": { + "error": { + "code": "aaaaaaaaaaaaaaaaaaaaaa", + "message": "aaaaaaaaaaaaaaaaaaaa" + } + } + } + }, + "operationId": "UsageAggregates_List" +} \ No newline at end of file diff --git a/specification/commerce/Commerce.Management/main.tsp b/specification/commerce/Commerce.Management/main.tsp new file mode 100644 index 000000000000..5239ebe12456 --- /dev/null +++ b/specification/commerce/Commerce.Management/main.tsp @@ -0,0 +1,42 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.12 + * Date: 2025-12-12T02:06:35.769Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; +/** + * // (missing-service-description) Add service description + */ +@armProviderNamespace +@service(#{ title: "UsageManagementClient" }) +@versioned(Versions) +// FIXME: Common type version not set. Set to v3. +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) +namespace UsageManagementClient; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2015-06-01-preview API version. + */ + v2015_06_01_preview: "2015-06-01-preview", +} diff --git a/specification/commerce/Commerce.Management/models.tsp b/specification/commerce/Commerce.Management/models.tsp new file mode 100644 index 000000000000..d27f68756748 --- /dev/null +++ b/specification/commerce/Commerce.Management/models.tsp @@ -0,0 +1,356 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace UsageManagementClient; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" +enum AggregationGranularity { + /** + * Daily + */ + Daily, + + /** + * Hourly + */ + Hourly, +} + +/** + * Name of the offer term + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" +enum OfferTermInfo { + /** + * Recurring Charge + */ + RecurringCharge: "Recurring Charge", + + /** + * Monetary Commitment + */ + MonetaryCommitment: "Monetary Commitment", + + /** + * Monetary Credit + */ + MonetaryCredit: "Monetary Credit", +} + +/** + * Describes the usageAggregation. + */ +model UsageAggregation { + /** + * Unique Id for the usage aggregate. + */ + id?: string; + + /** + * Name of the usage aggregate. + */ + name?: string; + + /** + * Type of the resource being returned. + */ + type?: string; + + /** + * Usage data. + */ + properties?: UsageSample; +} + +/** + * Describes a sample of the usageAggregation. + */ +model UsageSample { + /** + * The subscription identifier for the Azure user. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" + @format("uuid") + subscriptionId?: string; + + /** + * Unique ID for the resource that was consumed (aka ResourceID). + */ + meterId?: string; + + /** + * UTC start time for the usage bucket to which this usage aggregate belongs. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + usageStartTime?: utcDateTime; + + /** + * UTC end time for the usage bucket to which this usage aggregate belongs. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + usageEndTime?: utcDateTime; + + /** + * The amount of the resource consumption that occurred in this time frame. + */ + quantity?: float32; + + /** + * The unit in which the usage for this resource is being counted, e.g. Hours, GB. + */ + unit?: string; + + /** + * Friendly name of the resource being consumed. + */ + meterName?: string; + + /** + * Category of the consumed resource. + */ + meterCategory?: string; + + /** + * Sub-category of the consumed resource. + */ + meterSubCategory?: string; + + /** + * Region of the meterId used for billing purposes + */ + meterRegion?: string; + + /** + * Key-value pairs of instance details (legacy format). + */ + infoFields?: unknown; + + /** + * Key-value pairs of instance details represented as a string. + */ + instanceData?: string; +} + +/** + * Describes the format of Error response with a wrapper object + */ +@error +model ErrorObjectResponse { + /** + * Wrapper object for error information + */ + error?: ErrorResponse; +} + +/** + * Describes the format of Error response. + */ +@error +model ErrorResponse { + /** + * Error code + */ + code?: string; + + /** + * Error message indicating why the operation failed. + */ + message?: string; +} + +/** + * Price and Metadata information for resources + */ +model ResourceRateCardInfo { + /** + * The currency in which the rates are provided. + */ + Currency?: string; + + /** + * The culture in which the resource information is localized. + */ + Locale?: string; + + /** + * All rates are pretax, so this will always be returned as 'false'. + */ + IsTaxIncluded?: boolean; + + /** + * A list of offer terms. + */ + @identifiers(#["Name"]) + OfferTerms?: OfferTermInfoAutoGenerated[]; + + /** + * A list of meters. + */ + @identifiers(#["MeterId"]) + Meters?: MeterInfo[]; +} + +/** + * Describes the offer term. + */ +@discriminator("Name") +model OfferTermInfoAutoGenerated { + /** + * Name of the offer term + */ + Name: OfferTermInfo; + + /** + * Indicates the date from which the offer term is effective. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + EffectiveDate?: utcDateTime; +} + +/** + * Detailed information about the meter. + */ +model MeterInfo { + /** + * The unique identifier of the resource. + */ + #suppress "@azure-tools/typespec-azure-core/no-format" + @format("uuid") + MeterId?: string; + + /** + * The name of the meter, within the given meter category + */ + MeterName?: string; + + /** + * The category of the meter, e.g., 'Cloud services', 'Networking', etc.. + */ + MeterCategory?: string; + + /** + * The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + */ + MeterSubCategory?: string; + + /** + * The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. + */ + Unit?: string; + + /** + * Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party. + */ + MeterTags?: string[]; + + /** + * The region in which the Azure service is available. + */ + MeterRegion?: string; + + /** + * The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + MeterRates?: Record; + + /** + * Indicates the date from which the meter rate is effective. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + EffectiveDate?: utcDateTime; + + /** + * The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged. + */ + IncludedQuantity?: float32; +} + +/** + * Parameters that are used in the odata $filter query parameter for providing RateCard information. + */ +model RateCardQueryParameters { + /** + * The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency. + */ + @pattern("^MS-AZR-\\d{4}P(-\\d{4}P)*$") + OfferDurableId: string; + + /** + * The currency in which the rates need to be provided. + */ + Currency: string; + + /** + * The culture in which the resource metadata needs to be localized. + */ + Locale: string; + + /** + * 2 letter ISO code where the offer was purchased. + */ + RegionInfo: string; +} + +/** + * Indicates that this is a monetary credit offer. + */ +model MonetaryCredit extends OfferTermInfoAutoGenerated { + /** + * The amount of credit provided under the terms of the given offer level. + */ + Credit?: decimal; + + /** + * An array of meter ids that are excluded from the given offer terms. + */ + ExcludedMeterIds?: string[]; + + /** + * Name of the offer term + */ + Name: "Monetary Credit"; +} + +/** + * Indicates that a monetary commitment is required for this offer + */ +model MonetaryCommitment extends OfferTermInfoAutoGenerated { + /** + * The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + TieredDiscount?: Record; + + /** + * An array of meter ids that are excluded from the given offer terms. + */ + ExcludedMeterIds?: string[]; + + /** + * Name of the offer term + */ + Name: "Monetary Commitment"; +} + +/** + * Indicates a recurring charge is present for this offer. + */ +model RecurringCharge extends OfferTermInfoAutoGenerated { + /** + * The amount of recurring charge as per the offer term. + */ + RecurringCharge?: int32; + + /** + * Name of the offer term + */ + Name: "Recurring Charge"; +} diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp new file mode 100644 index 000000000000..0351f79a3ffa --- /dev/null +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -0,0 +1,90 @@ +// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually + +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using TypeSpec.OpenAPI; + +namespace UsageManagementClient; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +interface UsageAggregatesOperationGroup { + /** + * Query aggregated Azure subscription consumption data for a date range. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("UsageAggregates_List") + @autoRoute + @get + @action("UsageAggregates") + list is ArmProviderActionSync< + Response = ResourceListResult & { + @header + contentType: "application/json" | "text/json"; + }, + Scope = SubscriptionActionScope, + Parameters = { + /** + * The start of the time range to retrieve data for. + */ + @query("reportedStartTime") + reportedStartTime: utcDateTime; + + /** + * The end of the time range to retrieve data for. + */ + @query("reportedEndTime") + reportedEndTime: utcDateTime; + + /** + * `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). + */ + @query("showDetails") + showDetails?: boolean; + + /** + * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. + */ + @query("aggregationGranularity") + aggregationGranularity?: AggregationGranularity = AggregationGranularity.Daily; + + /** + * Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. + */ + @query("continuationToken") + continuationToken?: string; + } + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +interface RateCardOperationGroup { + /** + * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + @operationId("RateCard_Get") + @autoRoute + @get + @action("RateCard") + get is ArmProviderActionSync< + Response = ResourceRateCardInfo & { + @header + contentType: "application/json" | "text/json"; + }, + Scope = SubscriptionActionScope, + Parameters = { + /** + * The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter. + */ + @query("$filter") + filter: string; + } + >; +} diff --git a/specification/commerce/Commerce.Management/tspconfig.yaml b/specification/commerce/Commerce.Management/tspconfig.yaml new file mode 100644 index 000000000000..009ffc7baf45 --- /dev/null +++ b/specification/commerce/Commerce.Management/tspconfig.yaml @@ -0,0 +1,13 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + omit-unreachable-types: true + emitter-output-dir: "{project-root}/.." + azure-resource-provider-folder: "resource-manager" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/commerce.json" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager" From 5427c5752a043f1c8a1c518fcfee18ebf798b27e Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 12 Dec 2025 14:23:22 +0800 Subject: [PATCH 02/31] could compile --- .../Commerce.Management/back-compatible.tsp | 2 +- .../commerce/Commerce.Management/main.tsp | 4 +- .../commerce/Commerce.Management/routes.tsp | 2 +- .../Commerce.Management/tspconfig.yaml | 2 +- .../commerce/output/oldNormalizedSwagger.json | 480 ++++++++++++ .../preview/2015-06-01-preview/commerce.json | 713 +++++++++--------- .../examples/GetRateCard.json | 15 +- .../examples/GetUsageAggregatesList.json | 31 +- 8 files changed, 868 insertions(+), 381 deletions(-) create mode 100644 specification/commerce/output/oldNormalizedSwagger.json diff --git a/specification/commerce/Commerce.Management/back-compatible.tsp b/specification/commerce/Commerce.Management/back-compatible.tsp index d125a155b924..b20a0e9e2ba8 100644 --- a/specification/commerce/Commerce.Management/back-compatible.tsp +++ b/specification/commerce/Commerce.Management/back-compatible.tsp @@ -1,7 +1,7 @@ import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; -using UsageManagementClient; +using Microsoft.Commerce; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." @@Legacy.flattenProperty(UsageAggregation.properties); diff --git a/specification/commerce/Commerce.Management/main.tsp b/specification/commerce/Commerce.Management/main.tsp index 5239ebe12456..2f31cd78180b 100644 --- a/specification/commerce/Commerce.Management/main.tsp +++ b/specification/commerce/Commerce.Management/main.tsp @@ -25,11 +25,11 @@ using TypeSpec.Versioning; * // (missing-service-description) Add service description */ @armProviderNamespace -@service(#{ title: "UsageManagementClient" }) +@service(#{ title: "Microsoft.Commerce" }) @versioned(Versions) // FIXME: Common type version not set. Set to v3. @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) -namespace UsageManagementClient; +namespace Microsoft.Commerce; /** * The available API versions. diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp index 0351f79a3ffa..9ba9dad76cb3 100644 --- a/specification/commerce/Commerce.Management/routes.tsp +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -11,7 +11,7 @@ using TypeSpec.Http; using Azure.ResourceManager; using TypeSpec.OpenAPI; -namespace UsageManagementClient; +namespace Microsoft.Commerce; #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" interface UsageAggregatesOperationGroup { diff --git a/specification/commerce/Commerce.Management/tspconfig.yaml b/specification/commerce/Commerce.Management/tspconfig.yaml index 009ffc7baf45..1db9643d9b6f 100644 --- a/specification/commerce/Commerce.Management/tspconfig.yaml +++ b/specification/commerce/Commerce.Management/tspconfig.yaml @@ -5,7 +5,7 @@ options: omit-unreachable-types: true emitter-output-dir: "{project-root}/.." azure-resource-provider-folder: "resource-manager" - output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/commerce.json" + output-file: "{azure-resource-provider-folder}/{service-name}/Commerce/{version-status}/{version}/commerce.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" linter: diff --git a/specification/commerce/output/oldNormalizedSwagger.json b/specification/commerce/output/oldNormalizedSwagger.json new file mode 100644 index 000000000000..ea169659e70b --- /dev/null +++ b/specification/commerce/output/oldNormalizedSwagger.json @@ -0,0 +1,480 @@ +{ + "swagger": "2.0", + "info": { + "title": "UsageManagementClient", + "version": "2015-06-01-preview" + }, + "produces": [ + "application/json", + "text/json" + ], + "consumes": [ + "application/json", + "text/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/providers/microsoft.Commerce/rateCard": { + "get": { + "operationId": "RateCard_Get", + "description": "Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. ", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/commerce/ratecard" + }, + "parameters": [ + { + "name": "$filter", + "in": "query", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "ignore", + "schema": { + "$ref": "#/definitions/ResourceRateCardInfo" + } + }, + "default": { + "description": "ignore", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "GetRateCard": { + "$ref": "./examples/GetRateCard.json" + } + }, + "x-ms-odata": "#/definitions/RateCardQueryParameters" + } + }, + "/subscriptions/{subscriptionId}/providers/microsoft.Commerce/usageAggregates": { + "get": { + "operationId": "UsageAggregates_List", + "description": "Query aggregated Azure subscription consumption data for a date range.", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/commerce/usageaggregates" + }, + "parameters": [ + { + "name": "reportedStartTime", + "in": "query", + "required": true, + "type": "string", + "format": "date-time" + }, + { + "name": "reportedEndTime", + "in": "query", + "required": true, + "type": "string", + "format": "date-time" + }, + { + "name": "showDetails", + "in": "query", + "type": "boolean" + }, + { + "name": "aggregationGranularity", + "in": "query", + "type": "string", + "default": "Daily", + "enum": [ + "Daily", + "Hourly" + ], + "x-ms-enum": { + "name": "AggregationGranularity", + "modelAsString": false + } + }, + { + "name": "continuationToken", + "in": "query", + "type": "string" + } + ], + "responses": { + "200": { + "description": "ignore", + "schema": { + "$ref": "#/definitions/UsageAggregationListResult" + } + }, + "202": { + "description": "ignore", + "schema": { + "$ref": "#/definitions/ErrorObjectResponse" + } + }, + "default": { + "description": "ignore", + "schema": { + "$ref": "#/definitions/ErrorObjectResponse" + } + } + }, + "x-ms-examples": { + "GetUsageAggregatesList": { + "$ref": "./examples/GetUsageAggregatesList.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "ErrorObjectResponse": { + "type": "object", + "description": "Describes the format of Error response with a wrapper object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorResponse", + "description": "Wrapper object for error information" + } + } + }, + "ErrorResponse": { + "type": "object", + "description": "Describes the format of Error response.", + "properties": { + "code": { + "type": "string", + "description": "Error code" + }, + "message": { + "type": "string", + "description": "Error message indicating why the operation failed." + } + } + }, + "InfoField": { + "description": "Key-value pairs of instance details in the legacy format." + }, + "MeterInfo": { + "type": "object", + "description": "Detailed information about the meter.", + "properties": { + "MeterId": { + "type": "string", + "format": "uuid", + "description": "The unique identifier of the resource." + }, + "MeterName": { + "type": "string", + "description": "The name of the meter, within the given meter category" + }, + "MeterCategory": { + "type": "string", + "description": "The category of the meter, e.g., 'Cloud services', 'Networking', etc.." + }, + "MeterSubCategory": { + "type": "string", + "description": "The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.." + }, + "Unit": { + "type": "string", + "description": "The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc." + }, + "MeterTags": { + "type": "array", + "description": "Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party.", + "items": { + "type": "string" + } + }, + "MeterRegion": { + "type": "string", + "description": "The region in which the Azure service is available." + }, + "MeterRates": { + "type": "object", + "description": "The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price", + "additionalProperties": { + "format": "float", + "type": "number" + } + }, + "EffectiveDate": { + "type": "string", + "format": "date-time", + "description": "Indicates the date from which the meter rate is effective." + }, + "IncludedQuantity": { + "type": "number", + "format": "float", + "description": "The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged." + } + } + }, + "MonetaryCommitment": { + "type": "object", + "description": "Indicates that a monetary commitment is required for this offer", + "properties": { + "TieredDiscount": { + "type": "object", + "description": "The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'.", + "additionalProperties": { + "format": "decimal", + "type": "number" + } + }, + "ExcludedMeterIds": { + "type": "array", + "description": "An array of meter ids that are excluded from the given offer terms.", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "allOf": [ + { + "$ref": "#/definitions/OfferTermInfo" + } + ], + "x-ms-discriminator-value": "Monetary Commitment" + }, + "MonetaryCredit": { + "type": "object", + "description": "Indicates that this is a monetary credit offer.", + "properties": { + "Credit": { + "type": "number", + "format": "decimal", + "description": "The amount of credit provided under the terms of the given offer level." + }, + "ExcludedMeterIds": { + "type": "array", + "description": "An array of meter ids that are excluded from the given offer terms.", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "allOf": [ + { + "$ref": "#/definitions/OfferTermInfo" + } + ], + "x-ms-discriminator-value": "Monetary Credit" + }, + "OfferTermInfo": { + "type": "object", + "description": "Describes the offer term.", + "properties": { + "Name": { + "type": "string", + "description": "Name of the offer term", + "enum": [ + "Recurring Charge", + "Monetary Commitment", + "Monetary Credit" + ], + "x-ms-enum": { + "name": "OfferTermInfo", + "modelAsString": false + } + }, + "EffectiveDate": { + "type": "string", + "format": "date-time", + "description": "Indicates the date from which the offer term is effective." + } + }, + "discriminator": "Name", + "required": [ + "Name" + ] + }, + "RateCardQueryParameters": { + "type": "object", + "description": "Parameters that are used in the odata $filter query parameter for providing RateCard information.", + "properties": { + "OfferDurableId": { + "type": "string", + "description": "The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency.", + "pattern": "^MS-AZR-\\d{4}P(-\\d{4}P)*$" + }, + "Currency": { + "type": "string", + "description": "The currency in which the rates need to be provided." + }, + "Locale": { + "type": "string", + "description": "The culture in which the resource metadata needs to be localized." + }, + "RegionInfo": { + "type": "string", + "description": "2 letter ISO code where the offer was purchased." + } + }, + "required": [ + "Currency", + "Locale", + "OfferDurableId", + "RegionInfo" + ] + }, + "RecurringCharge": { + "type": "object", + "description": "Indicates a recurring charge is present for this offer.", + "properties": { + "RecurringCharge": { + "type": "integer", + "description": "The amount of recurring charge as per the offer term." + } + }, + "allOf": [ + { + "$ref": "#/definitions/OfferTermInfo" + } + ], + "x-ms-discriminator-value": "Recurring Charge" + }, + "ResourceRateCardInfo": { + "type": "object", + "description": "Price and Metadata information for resources", + "properties": { + "Currency": { + "type": "string", + "description": "The currency in which the rates are provided." + }, + "Locale": { + "type": "string", + "description": "The culture in which the resource information is localized." + }, + "IsTaxIncluded": { + "type": "boolean", + "description": "All rates are pretax, so this will always be returned as 'false'." + }, + "OfferTerms": { + "type": "array", + "description": "A list of offer terms.", + "items": { + "$ref": "#/definitions/OfferTermInfo" + }, + "x-ms-identifiers": [ + "Name" + ] + }, + "Meters": { + "type": "array", + "description": "A list of meters.", + "items": { + "$ref": "#/definitions/MeterInfo" + }, + "x-ms-identifiers": [ + "MeterId" + ] + } + } + }, + "UsageAggregation": { + "type": "object", + "description": "Describes the usageAggregation.", + "properties": { + "id": { + "type": "string", + "description": "Unique Id for the usage aggregate." + }, + "name": { + "type": "string", + "description": "Name of the usage aggregate." + }, + "type": { + "type": "string", + "description": "Type of the resource being returned." + }, + "properties": { + "$ref": "#/definitions/UsageSample", + "description": "Usage data.", + "x-ms-client-flatten": true + } + } + }, + "UsageAggregationListResult": { + "type": "object", + "description": "[Placeholder] Discription for page model", + "properties": { + "value": { + "type": "array", + "description": "[Placeholder] Discription for value property", + "items": { + "$ref": "#/definitions/UsageAggregation" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "[Placeholder] Discription for nextLink property" + } + } + }, + "UsageSample": { + "type": "object", + "description": "Describes a sample of the usageAggregation.", + "properties": { + "subscriptionId": { + "type": "string", + "format": "uuid", + "description": "The subscription identifier for the Azure user." + }, + "meterId": { + "type": "string", + "description": "Unique ID for the resource that was consumed (aka ResourceID)." + }, + "usageStartTime": { + "type": "string", + "format": "date-time", + "description": "UTC start time for the usage bucket to which this usage aggregate belongs." + }, + "usageEndTime": { + "type": "string", + "format": "date-time", + "description": "UTC end time for the usage bucket to which this usage aggregate belongs." + }, + "quantity": { + "type": "number", + "format": "float", + "description": "The amount of the resource consumption that occurred in this time frame." + }, + "unit": { + "type": "string", + "description": "The unit in which the usage for this resource is being counted, e.g. Hours, GB." + }, + "meterName": { + "type": "string", + "description": "Friendly name of the resource being consumed." + }, + "meterCategory": { + "type": "string", + "description": "Category of the consumed resource." + }, + "meterSubCategory": { + "type": "string", + "description": "Sub-category of the consumed resource." + }, + "meterRegion": { + "type": "string", + "description": "Region of the meterId used for billing purposes" + }, + "infoFields": { + "$ref": "#/definitions/InfoField", + "description": "Key-value pairs of instance details (legacy format)." + }, + "instanceData": { + "type": "string", + "description": "Key-value pairs of instance details represented as a string." + } + } + } + }, + "parameters": {} +} \ No newline at end of file diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json index 7080a52dae90..956c8b180221 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json @@ -1,515 +1,520 @@ { "swagger": "2.0", "info": { - "title": "UsageManagementClient", - "version": "2015-06-01-preview" + "title": "Microsoft.Commerce", + "version": "2015-06-01-preview", + "description": "// (missing-service-description) Add service description", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] }, - "host": "management.azure.com", "schemes": [ "https" ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], "consumes": [ - "application/json", - "text/json" + "application/json" ], - "produces": [ - "application/json", - "text/json" + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [], "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/rateCard": { "get": { - "tags": [ - "UsageAggregates" + "operationId": "RateCard_Get", + "description": "Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.", + "produces": [ + "application/json", + "text/json" ], - "operationId": "UsageAggregates_List", - "description": "Query aggregated Azure subscription consumption data for a date range.", - "externalDocs": { - "url": "https://docs.microsoft.com/rest/api/commerce/usageaggregates" + "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "$filter", + "in": "query", + "description": "The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.", + "required": true, + "type": "string", + "x-ms-client-name": "filter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ResourceRateCardInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } }, "x-ms-examples": { - "GetUsageAggregatesList": { - "$ref": "./examples/GetUsageAggregatesList.json" + "GetRateCard": { + "$ref": "./examples/GetRateCard.json" } - }, + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/usageAggregates": { + "get": { + "operationId": "UsageAggregates_List", + "description": "Query aggregated Azure subscription consumption data for a date range.", + "produces": [ + "application/json", + "text/json" + ], "parameters": [ + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, { "name": "reportedStartTime", "in": "query", + "description": "The start of the time range to retrieve data for.", "required": true, "type": "string", - "format": "date-time", - "description": "The start of the time range to retrieve data for." + "format": "date-time" }, { "name": "reportedEndTime", "in": "query", + "description": "The end of the time range to retrieve data for.", "required": true, "type": "string", - "format": "date-time", - "description": "The end of the time range to retrieve data for." + "format": "date-time" }, { "name": "showDetails", "in": "query", + "description": "`True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).", "required": false, - "type": "boolean", - "description": "`True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime)." + "type": "boolean" }, { "name": "aggregationGranularity", "in": "query", + "description": "`Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity.", "required": false, "type": "string", "default": "Daily", - "description": "`Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity.", "enum": [ "Daily", "Hourly" ], "x-ms-enum": { "name": "AggregationGranularity", - "modelAsString": false + "modelAsString": false, + "values": [ + { + "name": "Daily", + "value": "Daily", + "description": "Daily" + }, + { + "name": "Hourly", + "value": "Hourly", + "description": "Hourly" + } + ] } }, { "name": "continuationToken", "in": "query", + "description": "Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in.", "required": false, - "type": "string", - "description": "Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. " - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" + "type": "string" } ], "responses": { "200": { - "description": "Normal response for a successful query. The response body will contain the data that matches the filters specified in the query parameters.", + "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/UsageAggregationListResult" } }, - "202": { - "description": "Response indicating that a request has been accepted for processing. However, the processing has not been completed.", - "schema": { - "$ref": "#/definitions/ErrorObjectResponse" - } - }, "default": { - "description": "Error response describing why the operation failed.", + "description": "An unexpected error response.", "schema": { - "$ref": "#/definitions/ErrorObjectResponse" + "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/RateCard": { - "get": { - "tags": [ - "RateCard" - ], - "operationId": "RateCard_Get", - "description": "Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. ", - "externalDocs": { - "url": "https://docs.microsoft.com/rest/api/commerce/ratecard" - }, "x-ms-examples": { - "GetRateCard": { - "$ref": "./examples/GetRateCard.json" - } - }, - "parameters": [ - { - "name": "$filter", - "in": "query", - "required": true, - "type": "string", - "description": "The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "Normal response for a successful query. The response body will contain the data that matches the filters specified in the query parameters.", - "schema": { - "$ref": "#/definitions/ResourceRateCardInfo" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } + "GetUsageAggregatesList": { + "$ref": "./examples/GetUsageAggregatesList.json" } - }, - "x-ms-odata": "#/definitions/RateCardQueryParameters" + } } } }, "definitions": { - "InfoField": { - "description": "Key-value pairs of instance details in the legacy format." - }, - "UsageSample": { + "MeterInfo": { + "type": "object", + "description": "Detailed information about the meter.", "properties": { - "subscriptionId": { + "MeterId": { "type": "string", "format": "uuid", - "description": "The subscription identifier for the Azure user." + "description": "The unique identifier of the resource.", + "x-ms-client-name": "meterId" }, - "meterId": { + "MeterName": { "type": "string", - "description": "Unique ID for the resource that was consumed (aka ResourceID)." + "description": "The name of the meter, within the given meter category", + "x-ms-client-name": "meterName" }, - "usageStartTime": { + "MeterCategory": { "type": "string", - "format": "date-time", - "description": "UTC start time for the usage bucket to which this usage aggregate belongs." + "description": "The category of the meter, e.g., 'Cloud services', 'Networking', etc..", + "x-ms-client-name": "meterCategory" }, - "usageEndTime": { + "MeterSubCategory": { "type": "string", - "format": "date-time", - "description": "UTC end time for the usage bucket to which this usage aggregate belongs." - }, - "quantity": { - "type": "number", - "format": "float", - "description": "The amount of the resource consumption that occurred in this time frame." + "description": "The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", + "x-ms-client-name": "meterSubCategory" }, - "unit": { + "Unit": { "type": "string", - "description": "The unit in which the usage for this resource is being counted, e.g. Hours, GB." + "description": "The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc.", + "x-ms-client-name": "unit" }, - "meterName": { - "type": "string", - "description": "Friendly name of the resource being consumed." + "MeterTags": { + "type": "array", + "description": "Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party.", + "items": { + "type": "string" + }, + "x-ms-client-name": "meterTags" }, - "meterCategory": { + "MeterRegion": { "type": "string", - "description": "Category of the consumed resource." + "description": "The region in which the Azure service is available.", + "x-ms-client-name": "meterRegion" }, - "meterSubCategory": { - "type": "string", - "description": "Sub-category of the consumed resource." + "MeterRates": { + "type": "object", + "description": "The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price", + "additionalProperties": { + "format": "float", + "type": "number" + }, + "x-ms-client-name": "meterRates" }, - "meterRegion": { + "EffectiveDate": { "type": "string", - "description": "Region of the meterId used for billing purposes" - }, - "infoFields": { - "$ref": "#/definitions/InfoField", - "description": "Key-value pairs of instance details (legacy format)." + "format": "date-time", + "description": "Indicates the date from which the meter rate is effective.", + "x-ms-client-name": "effectiveDate" }, - "instanceData": { - "type": "string", - "description": "Key-value pairs of instance details represented as a string." + "IncludedQuantity": { + "type": "number", + "format": "float", + "description": "The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged.", + "x-ms-client-name": "includedQuantity" } - }, - "description": "Describes a sample of the usageAggregation." + } }, - "UsageAggregation": { + "MonetaryCommitment": { + "type": "object", + "description": "Indicates that a monetary commitment is required for this offer", "properties": { - "id": { - "type": "string", - "description": "Unique Id for the usage aggregate." - }, - "name": { - "type": "string", - "description": "Name of the usage aggregate." - }, - "type": { - "type": "string", - "description": "Type of the resource being returned." + "TieredDiscount": { + "type": "object", + "description": "The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'.", + "additionalProperties": { + "format": "decimal", + "type": "number" + }, + "x-ms-client-name": "tieredDiscount" }, - "properties": { - "$ref": "#/definitions/UsageSample", - "x-ms-client-flatten": true, - "description": "Usage data." + "ExcludedMeterIds": { + "type": "array", + "description": "An array of meter ids that are excluded from the given offer terms.", + "items": { + "type": "string" + }, + "x-ms-client-name": "excludedMeterIds" } }, - "description": "Describes the usageAggregation." + "allOf": [ + { + "$ref": "#/definitions/OfferTermInfoAutoGenerated" + } + ], + "x-ms-discriminator-value": "Monetary Commitment" }, - "UsageAggregationListResult": { + "MonetaryCredit": { + "type": "object", + "description": "Indicates that this is a monetary credit offer.", "properties": { - "value": { + "Credit": { + "type": "number", + "format": "decimal", + "description": "The amount of credit provided under the terms of the given offer level.", + "x-ms-client-name": "credit" + }, + "ExcludedMeterIds": { "type": "array", + "description": "An array of meter ids that are excluded from the given offer terms.", "items": { - "$ref": "#/definitions/UsageAggregation" + "type": "string" }, - "description": "Gets or sets details for the requested aggregation." - }, - "nextLink": { - "type": "string", - "description": "Gets or sets the link to the next set of results." + "x-ms-client-name": "excludedMeterIds" } }, - "description": "The Get UsageAggregates operation response." + "allOf": [ + { + "$ref": "#/definitions/OfferTermInfoAutoGenerated" + } + ], + "x-ms-discriminator-value": "Monetary Credit" }, - "RateCardQueryParameters": { - "description": "Parameters that are used in the odata $filter query parameter for providing RateCard information.", - "required": [ - "OfferDurableId", - "Currency", - "Locale", - "RegionInfo" + "OfferTermInfo": { + "type": "string", + "description": "Name of the offer term", + "enum": [ + "Recurring Charge", + "Monetary Commitment", + "Monetary Credit" ], + "x-ms-enum": { + "name": "OfferTermInfo", + "modelAsString": false, + "values": [ + { + "name": "RecurringCharge", + "value": "Recurring Charge", + "description": "Recurring Charge" + }, + { + "name": "MonetaryCommitment", + "value": "Monetary Commitment", + "description": "Monetary Commitment" + }, + { + "name": "MonetaryCredit", + "value": "Monetary Credit", + "description": "Monetary Credit" + } + ] + } + }, + "OfferTermInfoAutoGenerated": { + "type": "object", + "description": "Describes the offer term.", "properties": { - "OfferDurableId": { - "description": "The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency.", - "type": "string", - "pattern": "^MS-AZR-\\d{4}P(-\\d{4}P)*$" - }, - "Currency": { - "description": "The currency in which the rates need to be provided.", - "type": "string" - }, - "Locale": { - "description": "The culture in which the resource metadata needs to be localized.", - "type": "string" + "Name": { + "$ref": "#/definitions/OfferTermInfo", + "description": "Name of the offer term", + "x-ms-client-name": "name" }, - "RegionInfo": { - "description": "2 letter ISO code where the offer was purchased.", - "type": "string" + "EffectiveDate": { + "type": "string", + "format": "date-time", + "description": "Indicates the date from which the offer term is effective.", + "x-ms-client-name": "effectiveDate" } - } + }, + "discriminator": "Name", + "required": [ + "Name" + ] + }, + "RecurringCharge": { + "type": "object", + "description": "Indicates a recurring charge is present for this offer.", + "properties": { + "RecurringCharge": { + "type": "integer", + "format": "int32", + "description": "The amount of recurring charge as per the offer term.", + "x-ms-client-name": "recurringCharge" + } + }, + "allOf": [ + { + "$ref": "#/definitions/OfferTermInfoAutoGenerated" + } + ], + "x-ms-discriminator-value": "Recurring Charge" }, "ResourceRateCardInfo": { + "type": "object", "description": "Price and Metadata information for resources", "properties": { "Currency": { + "type": "string", "description": "The currency in which the rates are provided.", - "type": "string" + "x-ms-client-name": "currency" }, "Locale": { + "type": "string", "description": "The culture in which the resource information is localized.", - "type": "string" + "x-ms-client-name": "locale" }, "IsTaxIncluded": { - "description": "All rates are pretax, so this will always be returned as 'false'.", - "type": "boolean" + "type": "boolean", + "description": "All rates are pretax, so this will always be returned as 'false'." }, "OfferTerms": { "type": "array", + "description": "A list of offer terms.", "items": { - "$ref": "#/definitions/OfferTermInfo" + "$ref": "#/definitions/OfferTermInfoAutoGenerated" }, + "x-ms-client-name": "offerTerms", "x-ms-identifiers": [ "Name" - ], - "description": "A list of offer terms." + ] }, "Meters": { "type": "array", + "description": "A list of meters.", "items": { "$ref": "#/definitions/MeterInfo" }, + "x-ms-client-name": "meters", "x-ms-identifiers": [ "MeterId" - ], - "description": "A list of meters." + ] } } }, - "MeterInfo": { - "description": "Detailed information about the meter.", + "UsageAggregation": { + "type": "object", + "description": "Describes the usageAggregation.", "properties": { - "MeterId": { - "description": "The unique identifier of the resource.", + "id": { "type": "string", - "format": "uuid" - }, - "MeterName": { - "description": "The name of the meter, within the given meter category", - "type": "string" - }, - "MeterCategory": { - "description": "The category of the meter, e.g., 'Cloud services', 'Networking', etc..", - "type": "string" - }, - "MeterSubCategory": { - "description": "The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", - "type": "string" - }, - "Unit": { - "description": "The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc.", - "type": "string" - }, - "MeterTags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party." - }, - "MeterRegion": { - "description": "The region in which the Azure service is available.", - "type": "string" - }, - "MeterRates": { - "description": "The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price", - "type": "object", - "additionalProperties": { - "type": "number", - "format": "float" - } + "description": "Unique Id for the usage aggregate." }, - "EffectiveDate": { - "description": "Indicates the date from which the meter rate is effective.", + "name": { "type": "string", - "format": "date-time" + "description": "Name of the usage aggregate." }, - "IncludedQuantity": { - "description": "The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged.", - "type": "number", - "format": "float" - } - } - }, - "OfferTermInfo": { - "description": "Describes the offer term.", - "discriminator": "Name", - "required": [ - "Name" - ], - "properties": { - "Name": { - "description": "Name of the offer term", + "type": { "type": "string", - "enum": [ - "Recurring Charge", - "Monetary Commitment", - "Monetary Credit" - ], - "x-ms-enum": { - "name": "OfferTermInfo", - "modelAsString": false - } + "description": "Type of the resource being returned." }, - "EffectiveDate": { - "description": "Indicates the date from which the offer term is effective.", - "type": "string", - "format": "date-time" + "properties": { + "$ref": "#/definitions/UsageSample", + "description": "Usage data.", + "x-ms-client-flatten": true } } }, - "MonetaryCredit": { - "x-ms-discriminator-value": "Monetary Credit", - "description": "Indicates that this is a monetary credit offer.", - "allOf": [ - { - "$ref": "#/definitions/OfferTermInfo" - } - ], + "UsageAggregationListResult": { + "type": "object", + "description": "The response of a UsageAggregation list operation.", "properties": { - "Credit": { - "description": "The amount of credit provided under the terms of the given offer level.", - "type": "number", - "format": "decimal" - }, - "ExcludedMeterIds": { - "description": "An array of meter ids that are excluded from the given offer terms.", + "value": { "type": "array", + "description": "The UsageAggregation items on this page", "items": { - "type": "string", - "format": "uuid" - } - } - } - }, - "MonetaryCommitment": { - "x-ms-discriminator-value": "Monetary Commitment", - "description": "Indicates that a monetary commitment is required for this offer", - "allOf": [ - { - "$ref": "#/definitions/OfferTermInfo" - } - ], - "properties": { - "TieredDiscount": { - "description": "The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'.", - "type": "object", - "additionalProperties": { - "type": "number", - "format": "decimal" + "$ref": "#/definitions/UsageAggregation" } }, - "ExcludedMeterIds": { - "description": "An array of meter ids that are excluded from the given offer terms.", - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - }, - "RecurringCharge": { - "x-ms-discriminator-value": "Recurring Charge", - "description": "Indicates a recurring charge is present for this offer.", - "allOf": [ - { - "$ref": "#/definitions/OfferTermInfo" - } - ], - "properties": { - "RecurringCharge": { - "description": "The amount of recurring charge as per the offer term.", - "type": "integer" + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" } - } + }, + "required": [ + "value" + ] }, - "ErrorResponse": { - "description": "Describes the format of Error response.", + "UsageSample": { "type": "object", + "description": "Describes a sample of the usageAggregation.", "properties": { - "code": { - "description": "Error code", - "type": "string" + "subscriptionId": { + "type": "string", + "format": "uuid", + "description": "The subscription identifier for the Azure user." }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string" - } - } - }, - "ErrorObjectResponse": { - "description": "Describes the format of Error response with a wrapper object", - "type": "object", - "properties": { - "error": { - "description": "Wrapper object for error information", - "$ref": "#/definitions/ErrorResponse" + "meterId": { + "type": "string", + "description": "Unique ID for the resource that was consumed (aka ResourceID)." + }, + "usageStartTime": { + "type": "string", + "format": "date-time", + "description": "UTC start time for the usage bucket to which this usage aggregate belongs." + }, + "usageEndTime": { + "type": "string", + "format": "date-time", + "description": "UTC end time for the usage bucket to which this usage aggregate belongs." + }, + "quantity": { + "type": "number", + "format": "float", + "description": "The amount of the resource consumption that occurred in this time frame." + }, + "unit": { + "type": "string", + "description": "The unit in which the usage for this resource is being counted, e.g. Hours, GB." + }, + "meterName": { + "type": "string", + "description": "Friendly name of the resource being consumed." + }, + "meterCategory": { + "type": "string", + "description": "Category of the consumed resource." + }, + "meterSubCategory": { + "type": "string", + "description": "Sub-category of the consumed resource." + }, + "meterRegion": { + "type": "string", + "description": "Region of the meterId used for billing purposes" + }, + "infoFields": { + "description": "Key-value pairs of instance details (legacy format)." + }, + "instanceData": { + "type": "string", + "description": "Key-value pairs of instance details represented as a string." } } } }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Client Api Version." - } - } + "parameters": {} } diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json index f3c546fb603e..10c40b144730 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json @@ -1,14 +1,13 @@ { - "title": "Get RateCard", "parameters": { - "subscriptionId": "6d61cc05-8f8f-4916-b1b9-f1d9c25aae27", + "$filter": "OfferDurableId eq 'MS-AZR-0003P' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'", "api-version": "2015-06-01-preview", - "$filter": "OfferDurableId eq 'MS-AZR-0003P' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'" + "subscriptionId": "6d61cc05-8f8f-4916-b1b9-f1d9c25aae27" }, + "title": "GetRateCard", "responses": { "200": { "body": { - "OfferTerms": [], "Meters": [ { "EffectiveDate": "2017-09-01T00:00:00Z", @@ -27,8 +26,10 @@ ], "Unit": "Hours" } - ] + ], + "OfferTerms": [] } } - } -} + }, + "operationId": "RateCard_Get" +} \ No newline at end of file diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json index 3c94bd98b02a..9483fe55e955 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json @@ -1,32 +1,32 @@ { - "title": "Get UsageAggregatesList", "parameters": { - "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b", + "aggregationGranularity": "Daily", "api-version": "2015-06-01-preview", - "reportedStartTime": "2014-05-01T00:00:00+00:00", "reportedEndTime": "2015-06-01T00:00:00+00:00", - "aggregationGranularity": "Daily", - "showDetails": "true" + "reportedStartTime": "2014-05-01T00:00:00+00:00", + "showDetails": "true", + "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b" }, + "title": "GetUsageAggregatesList", "responses": { "200": { "body": { "value": [ { - "id": "/subscriptions/f68815e6-3c41-45ef-bbd8-5f83303c396b/providers/Microsoft.Commerce/UsageAggregates/Daily_BRSDT_20140501_0000", "name": "Daily_BRSDT_20140501_0000", "type": "Microsoft.Commerce/UsageAggregate", + "id": "/subscriptions/f68815e6-3c41-45ef-bbd8-5f83303c396b/providers/Microsoft.Commerce/UsageAggregates/Daily_BRSDT_20140501_0000", "properties": { - "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b", - "usageStartTime": "2015-03-03T00:00:00+00:00", - "usageEndTime": "2015-03-04T00:00:00+00:00", - "meterName": "Standard IO – Page Blob/Disk (GB)", + "infoFields": {}, "meterCategory": "Storage", + "meterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4", + "meterName": "Standard IO – Page Blob/Disk (GB)", "meterSubCategory": "Geo Redundant", + "quantity": 0.057865, + "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b", "unit": "GB", - "meterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4", - "infoFields": {}, - "quantity": 0.057865 + "usageEndTime": "2015-03-04T00:00:00+00:00", + "usageStartTime": "2015-03-03T00:00:00+00:00" } } ] @@ -40,5 +40,6 @@ } } } - } -} + }, + "operationId": "UsageAggregates_List" +} \ No newline at end of file From 3e0f0345ae42b4fac793fc86df311325f02afb9d Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 12 Dec 2025 14:27:50 +0800 Subject: [PATCH 03/31] Update models.tsp --- specification/commerce/Commerce.Management/models.tsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/commerce/Commerce.Management/models.tsp b/specification/commerce/Commerce.Management/models.tsp index d27f68756748..8558ab1c7490 100644 --- a/specification/commerce/Commerce.Management/models.tsp +++ b/specification/commerce/Commerce.Management/models.tsp @@ -7,7 +7,7 @@ using TypeSpec.Http; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; -namespace UsageManagementClient; +namespace Microsoft.Commerce; #suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" #suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" @@ -316,7 +316,7 @@ model MonetaryCredit extends OfferTermInfoAutoGenerated { /** * Name of the offer term */ - Name: "Monetary Credit"; + Name: OfferTermInfo.MonetaryCredit; } /** @@ -337,7 +337,7 @@ model MonetaryCommitment extends OfferTermInfoAutoGenerated { /** * Name of the offer term */ - Name: "Monetary Commitment"; + Name: OfferTermInfo.MonetaryCommitment; } /** @@ -352,5 +352,5 @@ model RecurringCharge extends OfferTermInfoAutoGenerated { /** * Name of the offer term */ - Name: "Recurring Charge"; + Name: OfferTermInfo.RecurringCharge; } From a171a85ecbd99ac8ed82f749710836acb763c01a Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 12 Dec 2025 16:02:35 +0800 Subject: [PATCH 04/31] update --- .../Commerce.Management/back-compatible.tsp | 34 +-- .../commerce/Commerce.Management/main.tsp | 7 +- .../commerce/Commerce.Management/models.tsp | 74 ++++-- .../commerce/Commerce.Management/routes.tsp | 25 +-- .../Commerce.Management/tspconfig.yaml | 34 ++- .../preview/2015-06-01-preview/commerce.json | 212 ++++++++++++------ 6 files changed, 242 insertions(+), 144 deletions(-) diff --git a/specification/commerce/Commerce.Management/back-compatible.tsp b/specification/commerce/Commerce.Management/back-compatible.tsp index b20a0e9e2ba8..10049221f300 100644 --- a/specification/commerce/Commerce.Management/back-compatible.tsp +++ b/specification/commerce/Commerce.Management/back-compatible.tsp @@ -3,41 +3,9 @@ import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; using Microsoft.Commerce; -#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Property flatten for SDK backward compatibility." +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@Legacy.flattenProperty(UsageAggregation.properties); -@@clientName(ResourceRateCardInfo.Currency, "currency"); -@@clientName(ResourceRateCardInfo.Locale, "locale"); -@@clientName(ResourceRateCardInfo.OfferTerms, "offerTerms"); -@@clientName(ResourceRateCardInfo.Meters, "meters"); - -@@clientName(OfferTermInfoAutoGenerated.Name, "name"); -@@clientName(OfferTermInfoAutoGenerated.EffectiveDate, "effectiveDate"); - -@@clientName(MeterInfo.MeterId, "meterId"); -@@clientName(MeterInfo.MeterName, "meterName"); -@@clientName(MeterInfo.MeterCategory, "meterCategory"); -@@clientName(MeterInfo.MeterSubCategory, "meterSubCategory"); -@@clientName(MeterInfo.Unit, "unit"); -@@clientName(MeterInfo.MeterTags, "meterTags"); -@@clientName(MeterInfo.MeterRegion, "meterRegion"); -@@clientName(MeterInfo.MeterRates, "meterRates"); -@@clientName(MeterInfo.EffectiveDate, "effectiveDate"); -@@clientName(MeterInfo.IncludedQuantity, "includedQuantity"); - -@@clientName(RateCardQueryParameters.OfferDurableId, "offerDurableId"); -@@clientName(RateCardQueryParameters.Currency, "currency"); -@@clientName(RateCardQueryParameters.Locale, "locale"); -@@clientName(RateCardQueryParameters.RegionInfo, "regionInfo"); - -@@clientName(MonetaryCredit.Credit, "credit"); -@@clientName(MonetaryCredit.ExcludedMeterIds, "excludedMeterIds"); - -@@clientName(MonetaryCommitment.TieredDiscount, "tieredDiscount"); -@@clientName(MonetaryCommitment.ExcludedMeterIds, "excludedMeterIds"); - -@@clientName(RecurringCharge.RecurringCharge, "recurringCharge"); - @@clientLocation(UsageAggregatesOperationGroup.list, "UsageAggregates"); @@clientLocation(RateCardOperationGroup.get, "RateCard"); diff --git a/specification/commerce/Commerce.Management/main.tsp b/specification/commerce/Commerce.Management/main.tsp index 2f31cd78180b..90e36b6fe221 100644 --- a/specification/commerce/Commerce.Management/main.tsp +++ b/specification/commerce/Commerce.Management/main.tsp @@ -21,11 +21,10 @@ using Azure.ResourceManager.Foundations; using Azure.Core; using Azure.ResourceManager; using TypeSpec.Versioning; -/** - * // (missing-service-description) Add service description - */ + +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @armProviderNamespace -@service(#{ title: "Microsoft.Commerce" }) +@service(#{ title: "UsageManagementClient" }) @versioned(Versions) // FIXME: Common type version not set. Set to v3. @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) diff --git a/specification/commerce/Commerce.Management/models.tsp b/specification/commerce/Commerce.Management/models.tsp index 8558ab1c7490..baae8fa25c79 100644 --- a/specification/commerce/Commerce.Management/models.tsp +++ b/specification/commerce/Commerce.Management/models.tsp @@ -9,8 +9,8 @@ using Azure.ResourceManager.Foundations; namespace Microsoft.Commerce; -#suppress "@azure-tools/typespec-azure-core/documentation-required" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" enum AggregationGranularity { /** * Daily @@ -26,8 +26,8 @@ enum AggregationGranularity { /** * Name of the offer term */ -#suppress "@azure-tools/typespec-azure-core/no-enum" "For backward compatibility" -enum OfferTermInfo { +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum OfferTermInfoEnum { /** * Recurring Charge */ @@ -76,9 +76,7 @@ model UsageSample { /** * The subscription identifier for the Azure user. */ - #suppress "@azure-tools/typespec-azure-core/no-format" - @format("uuid") - subscriptionId?: string; + subscriptionId?: Azure.Core.uuid; /** * Unique ID for the resource that was consumed (aka ResourceID). @@ -130,6 +128,7 @@ model UsageSample { /** * Key-value pairs of instance details (legacy format). */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" infoFields?: unknown; /** @@ -172,27 +171,32 @@ model ResourceRateCardInfo { /** * The currency in which the rates are provided. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" Currency?: string; /** * The culture in which the resource information is localized. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" Locale?: string; /** * All rates are pretax, so this will always be returned as 'false'. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" IsTaxIncluded?: boolean; /** * A list of offer terms. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @identifiers(#["Name"]) - OfferTerms?: OfferTermInfoAutoGenerated[]; + OfferTerms?: OfferTermInfo[]; /** * A list of meters. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @identifiers(#["MeterId"]) Meters?: MeterInfo[]; } @@ -201,15 +205,17 @@ model ResourceRateCardInfo { * Describes the offer term. */ @discriminator("Name") -model OfferTermInfoAutoGenerated { +model OfferTermInfo { /** * Name of the offer term */ - Name: OfferTermInfo; + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoEnum; /** * Indicates the date from which the offer term is effective. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. EffectiveDate?: utcDateTime; } @@ -221,55 +227,63 @@ model MeterInfo { /** * The unique identifier of the resource. */ - #suppress "@azure-tools/typespec-azure-core/no-format" - @format("uuid") - MeterId?: string; + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterId?: Azure.Core.uuid; /** * The name of the meter, within the given meter category */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" MeterName?: string; /** * The category of the meter, e.g., 'Cloud services', 'Networking', etc.. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" MeterCategory?: string; /** * The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" MeterSubCategory?: string; /** * The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" Unit?: string; /** * Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" MeterTags?: string[]; /** * The region in which the Azure service is available. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" MeterRegion?: string; /** * The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price */ - #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" MeterRates?: Record; /** * Indicates the date from which the meter rate is effective. */ // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" EffectiveDate?: utcDateTime; /** * The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" IncludedQuantity?: float32; } @@ -280,77 +294,91 @@ model RateCardQueryParameters { /** * The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @pattern("^MS-AZR-\\d{4}P(-\\d{4}P)*$") OfferDurableId: string; /** * The currency in which the rates need to be provided. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" Currency: string; /** * The culture in which the resource metadata needs to be localized. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" Locale: string; /** * 2 letter ISO code where the offer was purchased. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" RegionInfo: string; } /** * Indicates that this is a monetary credit offer. */ -model MonetaryCredit extends OfferTermInfoAutoGenerated { +model MonetaryCredit extends OfferTermInfo { /** * The amount of credit provided under the terms of the given offer level. */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-generic-numeric" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" Credit?: decimal; /** * An array of meter ids that are excluded from the given offer terms. */ - ExcludedMeterIds?: string[]; + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ExcludedMeterIds?: Azure.Core.uuid[]; /** * Name of the offer term */ - Name: OfferTermInfo.MonetaryCredit; + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoEnum.MonetaryCredit; } /** * Indicates that a monetary commitment is required for this offer */ -model MonetaryCommitment extends OfferTermInfoAutoGenerated { +model MonetaryCommitment extends OfferTermInfo { /** * The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'. */ - #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" TieredDiscount?: Record; /** * An array of meter ids that are excluded from the given offer terms. */ - ExcludedMeterIds?: string[]; + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ExcludedMeterIds?: Azure.Core.uuid[]; /** * Name of the offer term */ - Name: OfferTermInfo.MonetaryCommitment; + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoEnum.MonetaryCommitment; } /** * Indicates a recurring charge is present for this offer. */ -model RecurringCharge extends OfferTermInfoAutoGenerated { +model RecurringCharge extends OfferTermInfo { /** * The amount of recurring charge as per the offer term. */ + #suppress "@azure-tools/typespec-client-generator-core/property-name-conflict" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" RecurringCharge?: int32; /** * Name of the offer term */ - Name: OfferTermInfo.RecurringCharge; + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoEnum.RecurringCharge; } diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp index 9ba9dad76cb3..cd076f7fcc5e 100644 --- a/specification/commerce/Commerce.Management/routes.tsp +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -13,21 +13,21 @@ using TypeSpec.OpenAPI; namespace Microsoft.Commerce; -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" interface UsageAggregatesOperationGroup { /** * Query aggregated Azure subscription consumption data for a date range. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/usageaggregates") @operationId("UsageAggregates_List") @autoRoute @get + @list @action("UsageAggregates") list is ArmProviderActionSync< - Response = ResourceListResult & { - @header - contentType: "application/json" | "text/json"; - }, + Response = ResourceListResult | ArmAcceptedLroResponse, Scope = SubscriptionActionScope, Parameters = { /** @@ -59,25 +59,24 @@ interface UsageAggregatesOperationGroup { */ @query("continuationToken") continuationToken?: string; - } + }, + Error = ErrorObjectResponse >; } -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "For backward compatibility" +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" interface RateCardOperationGroup { /** * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations" + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @operationId("RateCard_Get") @autoRoute @get @action("RateCard") + @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/ratecard") get is ArmProviderActionSync< - Response = ResourceRateCardInfo & { - @header - contentType: "application/json" | "text/json"; - }, + Response = ResourceRateCardInfo, Scope = SubscriptionActionScope, Parameters = { /** diff --git a/specification/commerce/Commerce.Management/tspconfig.yaml b/specification/commerce/Commerce.Management/tspconfig.yaml index 1db9643d9b6f..533acf198cfe 100644 --- a/specification/commerce/Commerce.Management/tspconfig.yaml +++ b/specification/commerce/Commerce.Management/tspconfig.yaml @@ -1,13 +1,45 @@ +parameters: + "service-dir": + default: "sdk/confidentialledger" emit: - "@azure-tools/typespec-autorest" options: "@azure-tools/typespec-autorest": - omit-unreachable-types: true + omit-unreachable-types: false emitter-output-dir: "{project-root}/.." azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/Commerce/{version-status}/{version}/commerce.json" emit-lro-options: "all" examples-dir: "{project-root}/examples" + "@azure-tools/typespec-python": + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-confidentialledger" + namespace: "azure.mgmt.confidentialledger" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-confidentialledger" + namespace: "com.azure.resourcemanager.confidentialledger" + service-name: "ConfidentialLedger" # human-readable service name, whitespace allowed + flavor: azure + "@azure-tools/typespec-ts": + service-dir: sdk/confidentialledger + emitter-output-dir: "{output-dir}/{service-dir}/arm-confidentialledger" + is-modular-library: true + flavor: "azure" + experimental-extensible-enums: true + package-details: + name: "@azure/arm-confidentialledger" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/confidentialledger" + emitter-output-dir: "{output-dir}/{service-dir}/armconfidentialledger" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armconfidentialledger" + fix-const-stuttering: true + flavor: "azure" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json index 956c8b180221..1306d84288a3 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json @@ -1,9 +1,8 @@ { "swagger": "2.0", "info": { - "title": "Microsoft.Commerce", + "title": "UsageManagementClient", "version": "2015-06-01-preview", - "description": "// (missing-service-description) Add service description", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" @@ -44,10 +43,9 @@ "get": { "operationId": "RateCard_Get", "description": "Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.", - "produces": [ - "application/json", - "text/json" - ], + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/commerce/ratecard" + }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -89,10 +87,9 @@ "get": { "operationId": "UsageAggregates_List", "description": "Query aggregated Azure subscription consumption data for a date range.", - "produces": [ - "application/json", - "text/json" - ], + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/commerce/usageaggregates" + }, "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -166,10 +163,24 @@ "$ref": "#/definitions/UsageAggregationListResult" } }, + "202": { + "description": "Resource operation accepted.", + "headers": { + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + }, + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorObjectResponse" } } }, @@ -177,53 +188,100 @@ "GetUsageAggregatesList": { "$ref": "./examples/GetUsageAggregatesList.json" } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } } }, "definitions": { + "AggregationGranularity": { + "type": "string", + "enum": [ + "Daily", + "Hourly" + ], + "x-ms-enum": { + "name": "AggregationGranularity", + "modelAsString": false, + "values": [ + { + "name": "Daily", + "value": "Daily", + "description": "Daily" + }, + { + "name": "Hourly", + "value": "Hourly", + "description": "Hourly" + } + ] + } + }, + "Azure.Core.uuid": { + "type": "string", + "format": "uuid", + "description": "Universally Unique Identifier" + }, + "ErrorObjectResponse": { + "type": "object", + "description": "Describes the format of Error response with a wrapper object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorResponse", + "description": "Wrapper object for error information" + } + } + }, + "ErrorResponse": { + "type": "object", + "description": "Describes the format of Error response.", + "properties": { + "code": { + "type": "string", + "description": "Error code" + }, + "message": { + "type": "string", + "description": "Error message indicating why the operation failed." + } + } + }, "MeterInfo": { "type": "object", "description": "Detailed information about the meter.", "properties": { "MeterId": { - "type": "string", - "format": "uuid", - "description": "The unique identifier of the resource.", - "x-ms-client-name": "meterId" + "$ref": "#/definitions/Azure.Core.uuid", + "description": "The unique identifier of the resource." }, "MeterName": { "type": "string", - "description": "The name of the meter, within the given meter category", - "x-ms-client-name": "meterName" + "description": "The name of the meter, within the given meter category" }, "MeterCategory": { "type": "string", - "description": "The category of the meter, e.g., 'Cloud services', 'Networking', etc..", - "x-ms-client-name": "meterCategory" + "description": "The category of the meter, e.g., 'Cloud services', 'Networking', etc.." }, "MeterSubCategory": { "type": "string", - "description": "The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc..", - "x-ms-client-name": "meterSubCategory" + "description": "The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.." }, "Unit": { "type": "string", - "description": "The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc.", - "x-ms-client-name": "unit" + "description": "The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc." }, "MeterTags": { "type": "array", "description": "Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party.", "items": { "type": "string" - }, - "x-ms-client-name": "meterTags" + } }, "MeterRegion": { "type": "string", - "description": "The region in which the Azure service is available.", - "x-ms-client-name": "meterRegion" + "description": "The region in which the Azure service is available." }, "MeterRates": { "type": "object", @@ -231,20 +289,17 @@ "additionalProperties": { "format": "float", "type": "number" - }, - "x-ms-client-name": "meterRates" + } }, "EffectiveDate": { "type": "string", "format": "date-time", - "description": "Indicates the date from which the meter rate is effective.", - "x-ms-client-name": "effectiveDate" + "description": "Indicates the date from which the meter rate is effective." }, "IncludedQuantity": { "type": "number", "format": "float", - "description": "The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged.", - "x-ms-client-name": "includedQuantity" + "description": "The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged." } } }, @@ -258,21 +313,19 @@ "additionalProperties": { "format": "decimal", "type": "number" - }, - "x-ms-client-name": "tieredDiscount" + } }, "ExcludedMeterIds": { "type": "array", "description": "An array of meter ids that are excluded from the given offer terms.", "items": { - "type": "string" - }, - "x-ms-client-name": "excludedMeterIds" + "$ref": "#/definitions/Azure.Core.uuid" + } } }, "allOf": [ { - "$ref": "#/definitions/OfferTermInfoAutoGenerated" + "$ref": "#/definitions/OfferTermInfo" } ], "x-ms-discriminator-value": "Monetary Commitment" @@ -284,26 +337,43 @@ "Credit": { "type": "number", "format": "decimal", - "description": "The amount of credit provided under the terms of the given offer level.", - "x-ms-client-name": "credit" + "description": "The amount of credit provided under the terms of the given offer level." }, "ExcludedMeterIds": { "type": "array", "description": "An array of meter ids that are excluded from the given offer terms.", "items": { - "type": "string" - }, - "x-ms-client-name": "excludedMeterIds" + "$ref": "#/definitions/Azure.Core.uuid" + } } }, "allOf": [ { - "$ref": "#/definitions/OfferTermInfoAutoGenerated" + "$ref": "#/definitions/OfferTermInfo" } ], "x-ms-discriminator-value": "Monetary Credit" }, "OfferTermInfo": { + "type": "object", + "description": "Describes the offer term.", + "properties": { + "Name": { + "$ref": "#/definitions/OfferTermInfoEnum", + "description": "Name of the offer term" + }, + "EffectiveDate": { + "type": "string", + "format": "date-time", + "description": "Indicates the date from which the offer term is effective." + } + }, + "discriminator": "Name", + "required": [ + "Name" + ] + }, + "OfferTermInfoEnum": { "type": "string", "description": "Name of the offer term", "enum": [ @@ -312,7 +382,7 @@ "Monetary Credit" ], "x-ms-enum": { - "name": "OfferTermInfo", + "name": "OfferTermInfoEnum", "modelAsString": false, "values": [ { @@ -333,25 +403,33 @@ ] } }, - "OfferTermInfoAutoGenerated": { + "RateCardQueryParameters": { "type": "object", - "description": "Describes the offer term.", + "description": "Parameters that are used in the odata $filter query parameter for providing RateCard information.", "properties": { - "Name": { - "$ref": "#/definitions/OfferTermInfo", - "description": "Name of the offer term", - "x-ms-client-name": "name" + "OfferDurableId": { + "type": "string", + "description": "The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency.", + "pattern": "^MS-AZR-\\d{4}P(-\\d{4}P)*$" }, - "EffectiveDate": { + "Currency": { "type": "string", - "format": "date-time", - "description": "Indicates the date from which the offer term is effective.", - "x-ms-client-name": "effectiveDate" + "description": "The currency in which the rates need to be provided." + }, + "Locale": { + "type": "string", + "description": "The culture in which the resource metadata needs to be localized." + }, + "RegionInfo": { + "type": "string", + "description": "2 letter ISO code where the offer was purchased." } }, - "discriminator": "Name", "required": [ - "Name" + "OfferDurableId", + "Currency", + "Locale", + "RegionInfo" ] }, "RecurringCharge": { @@ -361,13 +439,12 @@ "RecurringCharge": { "type": "integer", "format": "int32", - "description": "The amount of recurring charge as per the offer term.", - "x-ms-client-name": "recurringCharge" + "description": "The amount of recurring charge as per the offer term." } }, "allOf": [ { - "$ref": "#/definitions/OfferTermInfoAutoGenerated" + "$ref": "#/definitions/OfferTermInfo" } ], "x-ms-discriminator-value": "Recurring Charge" @@ -378,13 +455,11 @@ "properties": { "Currency": { "type": "string", - "description": "The currency in which the rates are provided.", - "x-ms-client-name": "currency" + "description": "The currency in which the rates are provided." }, "Locale": { "type": "string", - "description": "The culture in which the resource information is localized.", - "x-ms-client-name": "locale" + "description": "The culture in which the resource information is localized." }, "IsTaxIncluded": { "type": "boolean", @@ -394,9 +469,8 @@ "type": "array", "description": "A list of offer terms.", "items": { - "$ref": "#/definitions/OfferTermInfoAutoGenerated" + "$ref": "#/definitions/OfferTermInfo" }, - "x-ms-client-name": "offerTerms", "x-ms-identifiers": [ "Name" ] @@ -407,7 +481,6 @@ "items": { "$ref": "#/definitions/MeterInfo" }, - "x-ms-client-name": "meters", "x-ms-identifiers": [ "MeterId" ] @@ -463,8 +536,7 @@ "description": "Describes a sample of the usageAggregation.", "properties": { "subscriptionId": { - "type": "string", - "format": "uuid", + "$ref": "#/definitions/Azure.Core.uuid", "description": "The subscription identifier for the Azure user." }, "meterId": { From 637a606c30f950a4a03de6a9a277d4161f54f743 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 12 Dec 2025 16:19:32 +0800 Subject: [PATCH 05/31] Update routes.tsp --- specification/commerce/Commerce.Management/routes.tsp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp index cd076f7fcc5e..831517339cfc 100644 --- a/specification/commerce/Commerce.Management/routes.tsp +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -18,10 +18,8 @@ interface UsageAggregatesOperationGroup { /** * Query aggregated Azure subscription consumption data for a date range. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/usageaggregates") - @operationId("UsageAggregates_List") @autoRoute @get @list @@ -69,8 +67,6 @@ interface RateCardOperationGroup { /** * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - @operationId("RateCard_Get") @autoRoute @get @action("RateCard") From dc91025b57d919f8801c7c666966a1b89d97c942 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 12 Dec 2025 16:20:37 +0800 Subject: [PATCH 06/31] update --- .../2015-06-01-preview/GetRateCard.json | 2 +- .../GetUsageAggregatesList.json | 2 +- .../commerce/output/oldNormalizedSwagger.json | 480 ------------------ .../examples/GetRateCard.json | 2 +- .../examples/GetUsageAggregatesList.json | 2 +- 5 files changed, 4 insertions(+), 484 deletions(-) delete mode 100644 specification/commerce/output/oldNormalizedSwagger.json diff --git a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json index 10c40b144730..5741330362fe 100644 --- a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json +++ b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json @@ -32,4 +32,4 @@ } }, "operationId": "RateCard_Get" -} \ No newline at end of file +} diff --git a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json index 9483fe55e955..76de35281fca 100644 --- a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json +++ b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json @@ -42,4 +42,4 @@ } }, "operationId": "UsageAggregates_List" -} \ No newline at end of file +} diff --git a/specification/commerce/output/oldNormalizedSwagger.json b/specification/commerce/output/oldNormalizedSwagger.json deleted file mode 100644 index ea169659e70b..000000000000 --- a/specification/commerce/output/oldNormalizedSwagger.json +++ /dev/null @@ -1,480 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "UsageManagementClient", - "version": "2015-06-01-preview" - }, - "produces": [ - "application/json", - "text/json" - ], - "consumes": [ - "application/json", - "text/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/providers/microsoft.Commerce/rateCard": { - "get": { - "operationId": "RateCard_Get", - "description": "Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. ", - "externalDocs": { - "url": "https://docs.microsoft.com/rest/api/commerce/ratecard" - }, - "parameters": [ - { - "name": "$filter", - "in": "query", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "ignore", - "schema": { - "$ref": "#/definitions/ResourceRateCardInfo" - } - }, - "default": { - "description": "ignore", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "GetRateCard": { - "$ref": "./examples/GetRateCard.json" - } - }, - "x-ms-odata": "#/definitions/RateCardQueryParameters" - } - }, - "/subscriptions/{subscriptionId}/providers/microsoft.Commerce/usageAggregates": { - "get": { - "operationId": "UsageAggregates_List", - "description": "Query aggregated Azure subscription consumption data for a date range.", - "externalDocs": { - "url": "https://docs.microsoft.com/rest/api/commerce/usageaggregates" - }, - "parameters": [ - { - "name": "reportedStartTime", - "in": "query", - "required": true, - "type": "string", - "format": "date-time" - }, - { - "name": "reportedEndTime", - "in": "query", - "required": true, - "type": "string", - "format": "date-time" - }, - { - "name": "showDetails", - "in": "query", - "type": "boolean" - }, - { - "name": "aggregationGranularity", - "in": "query", - "type": "string", - "default": "Daily", - "enum": [ - "Daily", - "Hourly" - ], - "x-ms-enum": { - "name": "AggregationGranularity", - "modelAsString": false - } - }, - { - "name": "continuationToken", - "in": "query", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ignore", - "schema": { - "$ref": "#/definitions/UsageAggregationListResult" - } - }, - "202": { - "description": "ignore", - "schema": { - "$ref": "#/definitions/ErrorObjectResponse" - } - }, - "default": { - "description": "ignore", - "schema": { - "$ref": "#/definitions/ErrorObjectResponse" - } - } - }, - "x-ms-examples": { - "GetUsageAggregatesList": { - "$ref": "./examples/GetUsageAggregatesList.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "ErrorObjectResponse": { - "type": "object", - "description": "Describes the format of Error response with a wrapper object", - "properties": { - "error": { - "$ref": "#/definitions/ErrorResponse", - "description": "Wrapper object for error information" - } - } - }, - "ErrorResponse": { - "type": "object", - "description": "Describes the format of Error response.", - "properties": { - "code": { - "type": "string", - "description": "Error code" - }, - "message": { - "type": "string", - "description": "Error message indicating why the operation failed." - } - } - }, - "InfoField": { - "description": "Key-value pairs of instance details in the legacy format." - }, - "MeterInfo": { - "type": "object", - "description": "Detailed information about the meter.", - "properties": { - "MeterId": { - "type": "string", - "format": "uuid", - "description": "The unique identifier of the resource." - }, - "MeterName": { - "type": "string", - "description": "The name of the meter, within the given meter category" - }, - "MeterCategory": { - "type": "string", - "description": "The category of the meter, e.g., 'Cloud services', 'Networking', etc.." - }, - "MeterSubCategory": { - "type": "string", - "description": "The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.." - }, - "Unit": { - "type": "string", - "description": "The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc." - }, - "MeterTags": { - "type": "array", - "description": "Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party.", - "items": { - "type": "string" - } - }, - "MeterRegion": { - "type": "string", - "description": "The region in which the Azure service is available." - }, - "MeterRates": { - "type": "object", - "description": "The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price", - "additionalProperties": { - "format": "float", - "type": "number" - } - }, - "EffectiveDate": { - "type": "string", - "format": "date-time", - "description": "Indicates the date from which the meter rate is effective." - }, - "IncludedQuantity": { - "type": "number", - "format": "float", - "description": "The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged." - } - } - }, - "MonetaryCommitment": { - "type": "object", - "description": "Indicates that a monetary commitment is required for this offer", - "properties": { - "TieredDiscount": { - "type": "object", - "description": "The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'.", - "additionalProperties": { - "format": "decimal", - "type": "number" - } - }, - "ExcludedMeterIds": { - "type": "array", - "description": "An array of meter ids that are excluded from the given offer terms.", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "allOf": [ - { - "$ref": "#/definitions/OfferTermInfo" - } - ], - "x-ms-discriminator-value": "Monetary Commitment" - }, - "MonetaryCredit": { - "type": "object", - "description": "Indicates that this is a monetary credit offer.", - "properties": { - "Credit": { - "type": "number", - "format": "decimal", - "description": "The amount of credit provided under the terms of the given offer level." - }, - "ExcludedMeterIds": { - "type": "array", - "description": "An array of meter ids that are excluded from the given offer terms.", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "allOf": [ - { - "$ref": "#/definitions/OfferTermInfo" - } - ], - "x-ms-discriminator-value": "Monetary Credit" - }, - "OfferTermInfo": { - "type": "object", - "description": "Describes the offer term.", - "properties": { - "Name": { - "type": "string", - "description": "Name of the offer term", - "enum": [ - "Recurring Charge", - "Monetary Commitment", - "Monetary Credit" - ], - "x-ms-enum": { - "name": "OfferTermInfo", - "modelAsString": false - } - }, - "EffectiveDate": { - "type": "string", - "format": "date-time", - "description": "Indicates the date from which the offer term is effective." - } - }, - "discriminator": "Name", - "required": [ - "Name" - ] - }, - "RateCardQueryParameters": { - "type": "object", - "description": "Parameters that are used in the odata $filter query parameter for providing RateCard information.", - "properties": { - "OfferDurableId": { - "type": "string", - "description": "The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency.", - "pattern": "^MS-AZR-\\d{4}P(-\\d{4}P)*$" - }, - "Currency": { - "type": "string", - "description": "The currency in which the rates need to be provided." - }, - "Locale": { - "type": "string", - "description": "The culture in which the resource metadata needs to be localized." - }, - "RegionInfo": { - "type": "string", - "description": "2 letter ISO code where the offer was purchased." - } - }, - "required": [ - "Currency", - "Locale", - "OfferDurableId", - "RegionInfo" - ] - }, - "RecurringCharge": { - "type": "object", - "description": "Indicates a recurring charge is present for this offer.", - "properties": { - "RecurringCharge": { - "type": "integer", - "description": "The amount of recurring charge as per the offer term." - } - }, - "allOf": [ - { - "$ref": "#/definitions/OfferTermInfo" - } - ], - "x-ms-discriminator-value": "Recurring Charge" - }, - "ResourceRateCardInfo": { - "type": "object", - "description": "Price and Metadata information for resources", - "properties": { - "Currency": { - "type": "string", - "description": "The currency in which the rates are provided." - }, - "Locale": { - "type": "string", - "description": "The culture in which the resource information is localized." - }, - "IsTaxIncluded": { - "type": "boolean", - "description": "All rates are pretax, so this will always be returned as 'false'." - }, - "OfferTerms": { - "type": "array", - "description": "A list of offer terms.", - "items": { - "$ref": "#/definitions/OfferTermInfo" - }, - "x-ms-identifiers": [ - "Name" - ] - }, - "Meters": { - "type": "array", - "description": "A list of meters.", - "items": { - "$ref": "#/definitions/MeterInfo" - }, - "x-ms-identifiers": [ - "MeterId" - ] - } - } - }, - "UsageAggregation": { - "type": "object", - "description": "Describes the usageAggregation.", - "properties": { - "id": { - "type": "string", - "description": "Unique Id for the usage aggregate." - }, - "name": { - "type": "string", - "description": "Name of the usage aggregate." - }, - "type": { - "type": "string", - "description": "Type of the resource being returned." - }, - "properties": { - "$ref": "#/definitions/UsageSample", - "description": "Usage data.", - "x-ms-client-flatten": true - } - } - }, - "UsageAggregationListResult": { - "type": "object", - "description": "[Placeholder] Discription for page model", - "properties": { - "value": { - "type": "array", - "description": "[Placeholder] Discription for value property", - "items": { - "$ref": "#/definitions/UsageAggregation" - } - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "[Placeholder] Discription for nextLink property" - } - } - }, - "UsageSample": { - "type": "object", - "description": "Describes a sample of the usageAggregation.", - "properties": { - "subscriptionId": { - "type": "string", - "format": "uuid", - "description": "The subscription identifier for the Azure user." - }, - "meterId": { - "type": "string", - "description": "Unique ID for the resource that was consumed (aka ResourceID)." - }, - "usageStartTime": { - "type": "string", - "format": "date-time", - "description": "UTC start time for the usage bucket to which this usage aggregate belongs." - }, - "usageEndTime": { - "type": "string", - "format": "date-time", - "description": "UTC end time for the usage bucket to which this usage aggregate belongs." - }, - "quantity": { - "type": "number", - "format": "float", - "description": "The amount of the resource consumption that occurred in this time frame." - }, - "unit": { - "type": "string", - "description": "The unit in which the usage for this resource is being counted, e.g. Hours, GB." - }, - "meterName": { - "type": "string", - "description": "Friendly name of the resource being consumed." - }, - "meterCategory": { - "type": "string", - "description": "Category of the consumed resource." - }, - "meterSubCategory": { - "type": "string", - "description": "Sub-category of the consumed resource." - }, - "meterRegion": { - "type": "string", - "description": "Region of the meterId used for billing purposes" - }, - "infoFields": { - "$ref": "#/definitions/InfoField", - "description": "Key-value pairs of instance details (legacy format)." - }, - "instanceData": { - "type": "string", - "description": "Key-value pairs of instance details represented as a string." - } - } - } - }, - "parameters": {} -} \ No newline at end of file diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json index 10c40b144730..5741330362fe 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetRateCard.json @@ -32,4 +32,4 @@ } }, "operationId": "RateCard_Get" -} \ No newline at end of file +} diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json index 9483fe55e955..76de35281fca 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json @@ -42,4 +42,4 @@ } }, "operationId": "UsageAggregates_List" -} \ No newline at end of file +} From 937a129391281bba80e4beadb7aea9cf11fc758f Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 15 Dec 2025 09:16:38 +0800 Subject: [PATCH 07/31] update --- specification/commerce/Commerce.Management/routes.tsp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp index 831517339cfc..d0ba074679f5 100644 --- a/specification/commerce/Commerce.Management/routes.tsp +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -19,6 +19,7 @@ interface UsageAggregatesOperationGroup { * Query aggregated Azure subscription consumption data for a date range. */ #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/usageaggregates") @autoRoute @get @@ -67,6 +68,7 @@ interface RateCardOperationGroup { /** * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @autoRoute @get @action("RateCard") From 192352d09ef576534dd41e2f41bc8fe593996227 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 15 Dec 2025 09:28:20 +0800 Subject: [PATCH 08/31] update --- specification/commerce/Commerce.Management/routes.tsp | 7 ++++--- .../Commerce/preview/2015-06-01-preview/commerce.json | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp index d0ba074679f5..ead797092a89 100644 --- a/specification/commerce/Commerce.Management/routes.tsp +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -80,8 +80,9 @@ interface RateCardOperationGroup { /** * The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter. */ - @query("$filter") - filter: string; - } + @query + $filter: string; + }, + Error = ErrorResponse >; } diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json index 1306d84288a3..a292d585a79a 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json @@ -58,8 +58,7 @@ "in": "query", "description": "The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.", "required": true, - "type": "string", - "x-ms-client-name": "filter" + "type": "string" } ], "responses": { @@ -72,7 +71,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponse" } } }, From 7e1aace38e024941800e9a7926a948b435a2398b Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 15 Dec 2025 14:14:32 +0800 Subject: [PATCH 09/31] update --- specification/commerce/Commerce.Management/models.tsp | 10 +++++----- .../Commerce/preview/2015-06-01-preview/commerce.json | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/commerce/Commerce.Management/models.tsp b/specification/commerce/Commerce.Management/models.tsp index baae8fa25c79..8bc67af6f373 100644 --- a/specification/commerce/Commerce.Management/models.tsp +++ b/specification/commerce/Commerce.Management/models.tsp @@ -27,7 +27,7 @@ enum AggregationGranularity { * Name of the offer term */ #suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -enum OfferTermInfoEnum { +enum OfferTermInfoName { /** * Recurring Charge */ @@ -210,7 +210,7 @@ model OfferTermInfo { * Name of the offer term */ #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoEnum; + Name: OfferTermInfoName; /** * Indicates the date from which the offer term is effective. @@ -338,7 +338,7 @@ model MonetaryCredit extends OfferTermInfo { * Name of the offer term */ #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoEnum.MonetaryCredit; + Name: OfferTermInfoName.MonetaryCredit; } /** @@ -362,7 +362,7 @@ model MonetaryCommitment extends OfferTermInfo { * Name of the offer term */ #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoEnum.MonetaryCommitment; + Name: OfferTermInfoName.MonetaryCommitment; } /** @@ -380,5 +380,5 @@ model RecurringCharge extends OfferTermInfo { * Name of the offer term */ #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoEnum.RecurringCharge; + Name: OfferTermInfoName.RecurringCharge; } diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json index a292d585a79a..f28a94007fcc 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json @@ -358,7 +358,7 @@ "description": "Describes the offer term.", "properties": { "Name": { - "$ref": "#/definitions/OfferTermInfoEnum", + "$ref": "#/definitions/OfferTermInfoName", "description": "Name of the offer term" }, "EffectiveDate": { @@ -372,7 +372,7 @@ "Name" ] }, - "OfferTermInfoEnum": { + "OfferTermInfoName": { "type": "string", "description": "Name of the offer term", "enum": [ @@ -381,7 +381,7 @@ "Monetary Credit" ], "x-ms-enum": { - "name": "OfferTermInfoEnum", + "name": "OfferTermInfoName", "modelAsString": false, "values": [ { From 3a317efb6eed8c09aedb3243f77970c88b86c291 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 15 Dec 2025 14:25:50 +0800 Subject: [PATCH 10/31] update --- .../commerce/Commerce.Management/models.tsp | 1 + .../commerce/Commerce.Management/routes.tsp | 3 ++- .../Commerce.Management/tspconfig.yaml | 24 +++++++++---------- .../preview/2015-06-01-preview/commerce.json | 5 +++- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/specification/commerce/Commerce.Management/models.tsp b/specification/commerce/Commerce.Management/models.tsp index 8bc67af6f373..ababf7878004 100644 --- a/specification/commerce/Commerce.Management/models.tsp +++ b/specification/commerce/Commerce.Management/models.tsp @@ -210,6 +210,7 @@ model OfferTermInfo { * Name of the offer term */ #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-string-discriminator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" Name: OfferTermInfoName; /** diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp index ead797092a89..cb77c86b7c3a 100644 --- a/specification/commerce/Commerce.Management/routes.tsp +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -26,7 +26,8 @@ interface UsageAggregatesOperationGroup { @list @action("UsageAggregates") list is ArmProviderActionSync< - Response = ResourceListResult | ArmAcceptedLroResponse, + Response = ResourceListResult | (ArmAcceptedLroResponse & + ErrorObjectResponse), Scope = SubscriptionActionScope, Parameters = { /** diff --git a/specification/commerce/Commerce.Management/tspconfig.yaml b/specification/commerce/Commerce.Management/tspconfig.yaml index 533acf198cfe..aadaf4ce6ee8 100644 --- a/specification/commerce/Commerce.Management/tspconfig.yaml +++ b/specification/commerce/Commerce.Management/tspconfig.yaml @@ -1,6 +1,6 @@ parameters: "service-dir": - default: "sdk/confidentialledger" + default: "sdk/commerce" emit: - "@azure-tools/typespec-autorest" options: @@ -12,28 +12,28 @@ options: emit-lro-options: "all" examples-dir: "{project-root}/examples" "@azure-tools/typespec-python": - emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-confidentialledger" - namespace: "azure.mgmt.confidentialledger" + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-commerce" + namespace: "azure.mgmt.commerce" generate-test: true generate-sample: true flavor: "azure" "@azure-tools/typespec-java": - emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-confidentialledger" - namespace: "com.azure.resourcemanager.confidentialledger" - service-name: "ConfidentialLedger" # human-readable service name, whitespace allowed + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-commerce" + namespace: "com.azure.resourcemanager.commerce" + service-name: "Commerce" # human-readable service name, whitespace allowed flavor: azure "@azure-tools/typespec-ts": - service-dir: sdk/confidentialledger - emitter-output-dir: "{output-dir}/{service-dir}/arm-confidentialledger" + service-dir: sdk/commerce + emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" is-modular-library: true flavor: "azure" experimental-extensible-enums: true package-details: - name: "@azure/arm-confidentialledger" + name: "@azure/arm-commerce" "@azure-tools/typespec-go": - service-dir: "sdk/resourcemanager/confidentialledger" - emitter-output-dir: "{output-dir}/{service-dir}/armconfidentialledger" - module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armconfidentialledger" + service-dir: "sdk/resourcemanager/commerce" + emitter-output-dir: "{output-dir}/{service-dir}/armcommerce" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armcommerce" fix-const-stuttering: true flavor: "azure" generate-samples: true diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json index f28a94007fcc..adb922c207af 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json @@ -163,7 +163,10 @@ } }, "202": { - "description": "Resource operation accepted.", + "description": "The request has been accepted for processing, but processing has not yet completed.", + "schema": { + "$ref": "#/definitions/ErrorObjectResponse" + }, "headers": { "Location": { "type": "string", From 25a7455c542ea0786e793febac036d0ae6c1e58b Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:45:27 +0800 Subject: [PATCH 11/31] Update routes.tsp --- .../commerce/Commerce.Management/routes.tsp | 64 ++++++++++--------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp index cb77c86b7c3a..c760555a7059 100644 --- a/specification/commerce/Commerce.Management/routes.tsp +++ b/specification/commerce/Commerce.Management/routes.tsp @@ -13,6 +13,38 @@ using TypeSpec.OpenAPI; namespace Microsoft.Commerce; +alias UsageAggregatesListParameters = { + /** + * The start of the time range to retrieve data for. + */ + @query("reportedStartTime") + reportedStartTime: utcDateTime; + + /** + * The end of the time range to retrieve data for. + */ + @query("reportedEndTime") + reportedEndTime: utcDateTime; + + /** + * `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). + */ + @query("showDetails") + showDetails?: boolean; + + /** + * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. + */ + @query("aggregationGranularity") + aggregationGranularity?: AggregationGranularity = AggregationGranularity.Daily; + + /** + * Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. + */ + @query("continuationToken") + continuationToken?: string; +}; + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" interface UsageAggregatesOperationGroup { /** @@ -29,37 +61,7 @@ interface UsageAggregatesOperationGroup { Response = ResourceListResult | (ArmAcceptedLroResponse & ErrorObjectResponse), Scope = SubscriptionActionScope, - Parameters = { - /** - * The start of the time range to retrieve data for. - */ - @query("reportedStartTime") - reportedStartTime: utcDateTime; - - /** - * The end of the time range to retrieve data for. - */ - @query("reportedEndTime") - reportedEndTime: utcDateTime; - - /** - * `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). - */ - @query("showDetails") - showDetails?: boolean; - - /** - * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. - */ - @query("aggregationGranularity") - aggregationGranularity?: AggregationGranularity = AggregationGranularity.Daily; - - /** - * Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. - */ - @query("continuationToken") - continuationToken?: string; - }, + Parameters = UsageAggregatesListParameters, Error = ErrorObjectResponse >; } From 306689e891c44e16927e49f043c8d936111f8b3f Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:45:53 +0800 Subject: [PATCH 12/31] Create client.tsp --- .../commerce/Commerce.Management/client.tsp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 specification/commerce/Commerce.Management/client.tsp diff --git a/specification/commerce/Commerce.Management/client.tsp b/specification/commerce/Commerce.Management/client.tsp new file mode 100644 index 000000000000..b1ad3ee477de --- /dev/null +++ b/specification/commerce/Commerce.Management/client.tsp @@ -0,0 +1,14 @@ +import "./main.tsp"; +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.Commerce; + +@@clientName(Microsoft.Commerce, "UsageManagementClient", "python"); +@@clientName(OfferTermInfoName, "OfferTermInfoEnum", "python"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy decorator required for Python SDK compatibility" +@@Legacy.clientDefaultValue(UsageAggregatesListParameters.aggregationGranularity, + "Daily", + "python" +); From 003e90e7f4856310c214a12f56aff87d4e39e6b9 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 9 Jan 2026 09:22:08 +0800 Subject: [PATCH 13/31] delete before relocate --- .../Commerce.Management/back-compatible.tsp | 11 - .../commerce/Commerce.Management/client.tsp | 14 - .../2015-06-01-preview/GetRateCard.json | 35 -- .../GetUsageAggregatesList.json | 45 -- .../commerce/Commerce.Management/main.tsp | 41 -- .../commerce/Commerce.Management/models.tsp | 385 ------------------ .../commerce/Commerce.Management/routes.tsp | 91 ----- .../Commerce.Management/tspconfig.yaml | 45 -- 8 files changed, 667 deletions(-) delete mode 100644 specification/commerce/Commerce.Management/back-compatible.tsp delete mode 100644 specification/commerce/Commerce.Management/client.tsp delete mode 100644 specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json delete mode 100644 specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json delete mode 100644 specification/commerce/Commerce.Management/main.tsp delete mode 100644 specification/commerce/Commerce.Management/models.tsp delete mode 100644 specification/commerce/Commerce.Management/routes.tsp delete mode 100644 specification/commerce/Commerce.Management/tspconfig.yaml diff --git a/specification/commerce/Commerce.Management/back-compatible.tsp b/specification/commerce/Commerce.Management/back-compatible.tsp deleted file mode 100644 index 10049221f300..000000000000 --- a/specification/commerce/Commerce.Management/back-compatible.tsp +++ /dev/null @@ -1,11 +0,0 @@ -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using Microsoft.Commerce; - -#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -@@Legacy.flattenProperty(UsageAggregation.properties); - -@@clientLocation(UsageAggregatesOperationGroup.list, "UsageAggregates"); - -@@clientLocation(RateCardOperationGroup.get, "RateCard"); diff --git a/specification/commerce/Commerce.Management/client.tsp b/specification/commerce/Commerce.Management/client.tsp deleted file mode 100644 index b1ad3ee477de..000000000000 --- a/specification/commerce/Commerce.Management/client.tsp +++ /dev/null @@ -1,14 +0,0 @@ -import "./main.tsp"; -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using Microsoft.Commerce; - -@@clientName(Microsoft.Commerce, "UsageManagementClient", "python"); -@@clientName(OfferTermInfoName, "OfferTermInfoEnum", "python"); - -#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy decorator required for Python SDK compatibility" -@@Legacy.clientDefaultValue(UsageAggregatesListParameters.aggregationGranularity, - "Daily", - "python" -); diff --git a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json deleted file mode 100644 index 5741330362fe..000000000000 --- a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetRateCard.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parameters": { - "$filter": "OfferDurableId eq 'MS-AZR-0003P' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'", - "api-version": "2015-06-01-preview", - "subscriptionId": "6d61cc05-8f8f-4916-b1b9-f1d9c25aae27" - }, - "title": "GetRateCard", - "responses": { - "200": { - "body": { - "Meters": [ - { - "EffectiveDate": "2017-09-01T00:00:00Z", - "IncludedQuantity": 0, - "MeterCategory": "Test Category", - "MeterId": "1d7518e5-bc2f-4a93-9057-1b3047856645", - "MeterName": "Test Meter", - "MeterRates": { - "0": 1.99, - "100": 0.99 - }, - "MeterRegion": "US West", - "MeterSubCategory": "Test Subcategory", - "MeterTags": [ - "Third Party" - ], - "Unit": "Hours" - } - ], - "OfferTerms": [] - } - } - }, - "operationId": "RateCard_Get" -} diff --git a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json b/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json deleted file mode 100644 index 76de35281fca..000000000000 --- a/specification/commerce/Commerce.Management/examples/2015-06-01-preview/GetUsageAggregatesList.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "parameters": { - "aggregationGranularity": "Daily", - "api-version": "2015-06-01-preview", - "reportedEndTime": "2015-06-01T00:00:00+00:00", - "reportedStartTime": "2014-05-01T00:00:00+00:00", - "showDetails": "true", - "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b" - }, - "title": "GetUsageAggregatesList", - "responses": { - "200": { - "body": { - "value": [ - { - "name": "Daily_BRSDT_20140501_0000", - "type": "Microsoft.Commerce/UsageAggregate", - "id": "/subscriptions/f68815e6-3c41-45ef-bbd8-5f83303c396b/providers/Microsoft.Commerce/UsageAggregates/Daily_BRSDT_20140501_0000", - "properties": { - "infoFields": {}, - "meterCategory": "Storage", - "meterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4", - "meterName": "Standard IO – Page Blob/Disk (GB)", - "meterSubCategory": "Geo Redundant", - "quantity": 0.057865, - "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b", - "unit": "GB", - "usageEndTime": "2015-03-04T00:00:00+00:00", - "usageStartTime": "2015-03-03T00:00:00+00:00" - } - } - ] - } - }, - "202": { - "body": { - "error": { - "code": "aaaaaaaaaaaaaaaaaaaaaa", - "message": "aaaaaaaaaaaaaaaaaaaa" - } - } - } - }, - "operationId": "UsageAggregates_List" -} diff --git a/specification/commerce/Commerce.Management/main.tsp b/specification/commerce/Commerce.Management/main.tsp deleted file mode 100644 index 90e36b6fe221..000000000000 --- a/specification/commerce/Commerce.Management/main.tsp +++ /dev/null @@ -1,41 +0,0 @@ -/** - * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS - * Generated by package: @autorest/openapi-to-typespec - * Parameters used: - * isFullCompatible: true - * guessResourceKey: false - * Version: 0.11.12 - * Date: 2025-12-12T02:06:35.769Z - */ -import "@typespec/rest"; -import "@typespec/versioning"; -import "@azure-tools/typespec-azure-core"; -import "@azure-tools/typespec-azure-resource-manager"; -import "./models.tsp"; -import "./back-compatible.tsp"; -import "./routes.tsp"; - -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.ResourceManager.Foundations; -using Azure.Core; -using Azure.ResourceManager; -using TypeSpec.Versioning; - -#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -@armProviderNamespace -@service(#{ title: "UsageManagementClient" }) -@versioned(Versions) -// FIXME: Common type version not set. Set to v3. -@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) -namespace Microsoft.Commerce; - -/** - * The available API versions. - */ -enum Versions { - /** - * The 2015-06-01-preview API version. - */ - v2015_06_01_preview: "2015-06-01-preview", -} diff --git a/specification/commerce/Commerce.Management/models.tsp b/specification/commerce/Commerce.Management/models.tsp deleted file mode 100644 index ababf7878004..000000000000 --- a/specification/commerce/Commerce.Management/models.tsp +++ /dev/null @@ -1,385 +0,0 @@ -import "@typespec/rest"; -import "@typespec/http"; -import "@azure-tools/typespec-azure-resource-manager"; - -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.ResourceManager; -using Azure.ResourceManager.Foundations; - -namespace Microsoft.Commerce; - -#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -enum AggregationGranularity { - /** - * Daily - */ - Daily, - - /** - * Hourly - */ - Hourly, -} - -/** - * Name of the offer term - */ -#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -enum OfferTermInfoName { - /** - * Recurring Charge - */ - RecurringCharge: "Recurring Charge", - - /** - * Monetary Commitment - */ - MonetaryCommitment: "Monetary Commitment", - - /** - * Monetary Credit - */ - MonetaryCredit: "Monetary Credit", -} - -/** - * Describes the usageAggregation. - */ -model UsageAggregation { - /** - * Unique Id for the usage aggregate. - */ - id?: string; - - /** - * Name of the usage aggregate. - */ - name?: string; - - /** - * Type of the resource being returned. - */ - type?: string; - - /** - * Usage data. - */ - properties?: UsageSample; -} - -/** - * Describes a sample of the usageAggregation. - */ -model UsageSample { - /** - * The subscription identifier for the Azure user. - */ - subscriptionId?: Azure.Core.uuid; - - /** - * Unique ID for the resource that was consumed (aka ResourceID). - */ - meterId?: string; - - /** - * UTC start time for the usage bucket to which this usage aggregate belongs. - */ - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. - usageStartTime?: utcDateTime; - - /** - * UTC end time for the usage bucket to which this usage aggregate belongs. - */ - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. - usageEndTime?: utcDateTime; - - /** - * The amount of the resource consumption that occurred in this time frame. - */ - quantity?: float32; - - /** - * The unit in which the usage for this resource is being counted, e.g. Hours, GB. - */ - unit?: string; - - /** - * Friendly name of the resource being consumed. - */ - meterName?: string; - - /** - * Category of the consumed resource. - */ - meterCategory?: string; - - /** - * Sub-category of the consumed resource. - */ - meterSubCategory?: string; - - /** - * Region of the meterId used for billing purposes - */ - meterRegion?: string; - - /** - * Key-value pairs of instance details (legacy format). - */ - #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - infoFields?: unknown; - - /** - * Key-value pairs of instance details represented as a string. - */ - instanceData?: string; -} - -/** - * Describes the format of Error response with a wrapper object - */ -@error -model ErrorObjectResponse { - /** - * Wrapper object for error information - */ - error?: ErrorResponse; -} - -/** - * Describes the format of Error response. - */ -@error -model ErrorResponse { - /** - * Error code - */ - code?: string; - - /** - * Error message indicating why the operation failed. - */ - message?: string; -} - -/** - * Price and Metadata information for resources - */ -model ResourceRateCardInfo { - /** - * The currency in which the rates are provided. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Currency?: string; - - /** - * The culture in which the resource information is localized. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Locale?: string; - - /** - * All rates are pretax, so this will always be returned as 'false'. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - IsTaxIncluded?: boolean; - - /** - * A list of offer terms. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - @identifiers(#["Name"]) - OfferTerms?: OfferTermInfo[]; - - /** - * A list of meters. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - @identifiers(#["MeterId"]) - Meters?: MeterInfo[]; -} - -/** - * Describes the offer term. - */ -@discriminator("Name") -model OfferTermInfo { - /** - * Name of the offer term - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - #suppress "@azure-tools/typespec-azure-core/no-string-discriminator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoName; - - /** - * Indicates the date from which the offer term is effective. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. - EffectiveDate?: utcDateTime; -} - -/** - * Detailed information about the meter. - */ -model MeterInfo { - /** - * The unique identifier of the resource. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - MeterId?: Azure.Core.uuid; - - /** - * The name of the meter, within the given meter category - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - MeterName?: string; - - /** - * The category of the meter, e.g., 'Cloud services', 'Networking', etc.. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - MeterCategory?: string; - - /** - * The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - MeterSubCategory?: string; - - /** - * The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Unit?: string; - - /** - * Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - MeterTags?: string[]; - - /** - * The region in which the Azure service is available. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - MeterRegion?: string; - - /** - * The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - MeterRates?: Record; - - /** - * Indicates the date from which the meter rate is effective. - */ - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - EffectiveDate?: utcDateTime; - - /** - * The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - IncludedQuantity?: float32; -} - -/** - * Parameters that are used in the odata $filter query parameter for providing RateCard information. - */ -model RateCardQueryParameters { - /** - * The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - @pattern("^MS-AZR-\\d{4}P(-\\d{4}P)*$") - OfferDurableId: string; - - /** - * The currency in which the rates need to be provided. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Currency: string; - - /** - * The culture in which the resource metadata needs to be localized. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Locale: string; - - /** - * 2 letter ISO code where the offer was purchased. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - RegionInfo: string; -} - -/** - * Indicates that this is a monetary credit offer. - */ -model MonetaryCredit extends OfferTermInfo { - /** - * The amount of credit provided under the terms of the given offer level. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - #suppress "@azure-tools/typespec-azure-core/no-generic-numeric" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Credit?: decimal; - - /** - * An array of meter ids that are excluded from the given offer terms. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - ExcludedMeterIds?: Azure.Core.uuid[]; - - /** - * Name of the offer term - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoName.MonetaryCredit; -} - -/** - * Indicates that a monetary commitment is required for this offer - */ -model MonetaryCommitment extends OfferTermInfo { - /** - * The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - TieredDiscount?: Record; - - /** - * An array of meter ids that are excluded from the given offer terms. - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - ExcludedMeterIds?: Azure.Core.uuid[]; - - /** - * Name of the offer term - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoName.MonetaryCommitment; -} - -/** - * Indicates a recurring charge is present for this offer. - */ -model RecurringCharge extends OfferTermInfo { - /** - * The amount of recurring charge as per the offer term. - */ - #suppress "@azure-tools/typespec-client-generator-core/property-name-conflict" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - RecurringCharge?: int32; - - /** - * Name of the offer term - */ - #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - Name: OfferTermInfoName.RecurringCharge; -} diff --git a/specification/commerce/Commerce.Management/routes.tsp b/specification/commerce/Commerce.Management/routes.tsp deleted file mode 100644 index c760555a7059..000000000000 --- a/specification/commerce/Commerce.Management/routes.tsp +++ /dev/null @@ -1,91 +0,0 @@ -// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually - -import "@azure-tools/typespec-azure-core"; -import "@typespec/rest"; -import "./models.tsp"; -import "@azure-tools/typespec-azure-resource-manager"; -import "@typespec/openapi"; - -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.ResourceManager; -using TypeSpec.OpenAPI; - -namespace Microsoft.Commerce; - -alias UsageAggregatesListParameters = { - /** - * The start of the time range to retrieve data for. - */ - @query("reportedStartTime") - reportedStartTime: utcDateTime; - - /** - * The end of the time range to retrieve data for. - */ - @query("reportedEndTime") - reportedEndTime: utcDateTime; - - /** - * `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). - */ - @query("showDetails") - showDetails?: boolean; - - /** - * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. - */ - @query("aggregationGranularity") - aggregationGranularity?: AggregationGranularity = AggregationGranularity.Daily; - - /** - * Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. - */ - @query("continuationToken") - continuationToken?: string; -}; - -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -interface UsageAggregatesOperationGroup { - /** - * Query aggregated Azure subscription consumption data for a date range. - */ - #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/usageaggregates") - @autoRoute - @get - @list - @action("UsageAggregates") - list is ArmProviderActionSync< - Response = ResourceListResult | (ArmAcceptedLroResponse & - ErrorObjectResponse), - Scope = SubscriptionActionScope, - Parameters = UsageAggregatesListParameters, - Error = ErrorObjectResponse - >; -} - -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" -interface RateCardOperationGroup { - /** - * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. - */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - @autoRoute - @get - @action("RateCard") - @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/ratecard") - get is ArmProviderActionSync< - Response = ResourceRateCardInfo, - Scope = SubscriptionActionScope, - Parameters = { - /** - * The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter. - */ - @query - $filter: string; - }, - Error = ErrorResponse - >; -} diff --git a/specification/commerce/Commerce.Management/tspconfig.yaml b/specification/commerce/Commerce.Management/tspconfig.yaml deleted file mode 100644 index aadaf4ce6ee8..000000000000 --- a/specification/commerce/Commerce.Management/tspconfig.yaml +++ /dev/null @@ -1,45 +0,0 @@ -parameters: - "service-dir": - default: "sdk/commerce" -emit: - - "@azure-tools/typespec-autorest" -options: - "@azure-tools/typespec-autorest": - omit-unreachable-types: false - emitter-output-dir: "{project-root}/.." - azure-resource-provider-folder: "resource-manager" - output-file: "{azure-resource-provider-folder}/{service-name}/Commerce/{version-status}/{version}/commerce.json" - emit-lro-options: "all" - examples-dir: "{project-root}/examples" - "@azure-tools/typespec-python": - emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-commerce" - namespace: "azure.mgmt.commerce" - generate-test: true - generate-sample: true - flavor: "azure" - "@azure-tools/typespec-java": - emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-commerce" - namespace: "com.azure.resourcemanager.commerce" - service-name: "Commerce" # human-readable service name, whitespace allowed - flavor: azure - "@azure-tools/typespec-ts": - service-dir: sdk/commerce - emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" - is-modular-library: true - flavor: "azure" - experimental-extensible-enums: true - package-details: - name: "@azure/arm-commerce" - "@azure-tools/typespec-go": - service-dir: "sdk/resourcemanager/commerce" - emitter-output-dir: "{output-dir}/{service-dir}/armcommerce" - module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armcommerce" - fix-const-stuttering: true - flavor: "azure" - generate-samples: true - generate-fakes: true - head-as-boolean: true - inject-spans: true -linter: - extends: - - "@azure-tools/typespec-azure-rulesets/resource-manager" From 782a3ad9b66caae6eb5aa3bcec29ce08adbc247f Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Fri, 9 Jan 2026 09:27:59 +0800 Subject: [PATCH 14/31] relocate to conform v2 structure --- .../Commerce/back-compatible.tsp | 11 + .../Microsoft.Commerce/Commerce/client.tsp | 14 + .../2015-06-01-preview/GetRateCard.json | 35 ++ .../GetUsageAggregatesList.json | 45 ++ .../Microsoft.Commerce/Commerce/main.tsp | 41 ++ .../Microsoft.Commerce/Commerce/models.tsp | 385 ++++++++++++++++++ .../Microsoft.Commerce/Commerce/routes.tsp | 91 +++++ .../Commerce/suppressions.yaml | 3 - .../Commerce/tspconfig.yaml | 46 +++ 9 files changed, 668 insertions(+), 3 deletions(-) create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetRateCard.json create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/main.tsp create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/models.tsp create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp delete mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/suppressions.yaml create mode 100644 specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp new file mode 100644 index 000000000000..10049221f300 --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp @@ -0,0 +1,11 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.Commerce; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@@Legacy.flattenProperty(UsageAggregation.properties); + +@@clientLocation(UsageAggregatesOperationGroup.list, "UsageAggregates"); + +@@clientLocation(RateCardOperationGroup.get, "RateCard"); diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp new file mode 100644 index 000000000000..b1ad3ee477de --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp @@ -0,0 +1,14 @@ +import "./main.tsp"; +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.Commerce; + +@@clientName(Microsoft.Commerce, "UsageManagementClient", "python"); +@@clientName(OfferTermInfoName, "OfferTermInfoEnum", "python"); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy decorator required for Python SDK compatibility" +@@Legacy.clientDefaultValue(UsageAggregatesListParameters.aggregationGranularity, + "Daily", + "python" +); diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetRateCard.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetRateCard.json new file mode 100644 index 000000000000..5741330362fe --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetRateCard.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "$filter": "OfferDurableId eq 'MS-AZR-0003P' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'", + "api-version": "2015-06-01-preview", + "subscriptionId": "6d61cc05-8f8f-4916-b1b9-f1d9c25aae27" + }, + "title": "GetRateCard", + "responses": { + "200": { + "body": { + "Meters": [ + { + "EffectiveDate": "2017-09-01T00:00:00Z", + "IncludedQuantity": 0, + "MeterCategory": "Test Category", + "MeterId": "1d7518e5-bc2f-4a93-9057-1b3047856645", + "MeterName": "Test Meter", + "MeterRates": { + "0": 1.99, + "100": 0.99 + }, + "MeterRegion": "US West", + "MeterSubCategory": "Test Subcategory", + "MeterTags": [ + "Third Party" + ], + "Unit": "Hours" + } + ], + "OfferTerms": [] + } + } + }, + "operationId": "RateCard_Get" +} diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json new file mode 100644 index 000000000000..76de35281fca --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "aggregationGranularity": "Daily", + "api-version": "2015-06-01-preview", + "reportedEndTime": "2015-06-01T00:00:00+00:00", + "reportedStartTime": "2014-05-01T00:00:00+00:00", + "showDetails": "true", + "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b" + }, + "title": "GetUsageAggregatesList", + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Daily_BRSDT_20140501_0000", + "type": "Microsoft.Commerce/UsageAggregate", + "id": "/subscriptions/f68815e6-3c41-45ef-bbd8-5f83303c396b/providers/Microsoft.Commerce/UsageAggregates/Daily_BRSDT_20140501_0000", + "properties": { + "infoFields": {}, + "meterCategory": "Storage", + "meterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4", + "meterName": "Standard IO – Page Blob/Disk (GB)", + "meterSubCategory": "Geo Redundant", + "quantity": 0.057865, + "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b", + "unit": "GB", + "usageEndTime": "2015-03-04T00:00:00+00:00", + "usageStartTime": "2015-03-03T00:00:00+00:00" + } + } + ] + } + }, + "202": { + "body": { + "error": { + "code": "aaaaaaaaaaaaaaaaaaaaaa", + "message": "aaaaaaaaaaaaaaaaaaaa" + } + } + } + }, + "operationId": "UsageAggregates_List" +} diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/main.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/main.tsp new file mode 100644 index 000000000000..90e36b6fe221 --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/main.tsp @@ -0,0 +1,41 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Parameters used: + * isFullCompatible: true + * guessResourceKey: false + * Version: 0.11.12 + * Date: 2025-12-12T02:06:35.769Z + */ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "./models.tsp"; +import "./back-compatible.tsp"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager.Foundations; +using Azure.Core; +using Azure.ResourceManager; +using TypeSpec.Versioning; + +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +@armProviderNamespace +@service(#{ title: "UsageManagementClient" }) +@versioned(Versions) +// FIXME: Common type version not set. Set to v3. +@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) +namespace Microsoft.Commerce; + +/** + * The available API versions. + */ +enum Versions { + /** + * The 2015-06-01-preview API version. + */ + v2015_06_01_preview: "2015-06-01-preview", +} diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/models.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/models.tsp new file mode 100644 index 000000000000..ababf7878004 --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/models.tsp @@ -0,0 +1,385 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +namespace Microsoft.Commerce; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum AggregationGranularity { + /** + * Daily + */ + Daily, + + /** + * Hourly + */ + Hourly, +} + +/** + * Name of the offer term + */ +#suppress "@azure-tools/typespec-azure-core/no-enum" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +enum OfferTermInfoName { + /** + * Recurring Charge + */ + RecurringCharge: "Recurring Charge", + + /** + * Monetary Commitment + */ + MonetaryCommitment: "Monetary Commitment", + + /** + * Monetary Credit + */ + MonetaryCredit: "Monetary Credit", +} + +/** + * Describes the usageAggregation. + */ +model UsageAggregation { + /** + * Unique Id for the usage aggregate. + */ + id?: string; + + /** + * Name of the usage aggregate. + */ + name?: string; + + /** + * Type of the resource being returned. + */ + type?: string; + + /** + * Usage data. + */ + properties?: UsageSample; +} + +/** + * Describes a sample of the usageAggregation. + */ +model UsageSample { + /** + * The subscription identifier for the Azure user. + */ + subscriptionId?: Azure.Core.uuid; + + /** + * Unique ID for the resource that was consumed (aka ResourceID). + */ + meterId?: string; + + /** + * UTC start time for the usage bucket to which this usage aggregate belongs. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + usageStartTime?: utcDateTime; + + /** + * UTC end time for the usage bucket to which this usage aggregate belongs. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + usageEndTime?: utcDateTime; + + /** + * The amount of the resource consumption that occurred in this time frame. + */ + quantity?: float32; + + /** + * The unit in which the usage for this resource is being counted, e.g. Hours, GB. + */ + unit?: string; + + /** + * Friendly name of the resource being consumed. + */ + meterName?: string; + + /** + * Category of the consumed resource. + */ + meterCategory?: string; + + /** + * Sub-category of the consumed resource. + */ + meterSubCategory?: string; + + /** + * Region of the meterId used for billing purposes + */ + meterRegion?: string; + + /** + * Key-value pairs of instance details (legacy format). + */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + infoFields?: unknown; + + /** + * Key-value pairs of instance details represented as a string. + */ + instanceData?: string; +} + +/** + * Describes the format of Error response with a wrapper object + */ +@error +model ErrorObjectResponse { + /** + * Wrapper object for error information + */ + error?: ErrorResponse; +} + +/** + * Describes the format of Error response. + */ +@error +model ErrorResponse { + /** + * Error code + */ + code?: string; + + /** + * Error message indicating why the operation failed. + */ + message?: string; +} + +/** + * Price and Metadata information for resources + */ +model ResourceRateCardInfo { + /** + * The currency in which the rates are provided. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Currency?: string; + + /** + * The culture in which the resource information is localized. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Locale?: string; + + /** + * All rates are pretax, so this will always be returned as 'false'. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + IsTaxIncluded?: boolean; + + /** + * A list of offer terms. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["Name"]) + OfferTerms?: OfferTermInfo[]; + + /** + * A list of meters. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @identifiers(#["MeterId"]) + Meters?: MeterInfo[]; +} + +/** + * Describes the offer term. + */ +@discriminator("Name") +model OfferTermInfo { + /** + * Name of the offer term + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-string-discriminator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoName; + + /** + * Indicates the date from which the offer term is effective. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + EffectiveDate?: utcDateTime; +} + +/** + * Detailed information about the meter. + */ +model MeterInfo { + /** + * The unique identifier of the resource. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterId?: Azure.Core.uuid; + + /** + * The name of the meter, within the given meter category + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterName?: string; + + /** + * The category of the meter, e.g., 'Cloud services', 'Networking', etc.. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterCategory?: string; + + /** + * The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterSubCategory?: string; + + /** + * The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Unit?: string; + + /** + * Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterTags?: string[]; + + /** + * The region in which the Azure service is available. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterRegion?: string; + + /** + * The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + MeterRates?: Record; + + /** + * Indicates the date from which the meter rate is effective. + */ + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + EffectiveDate?: utcDateTime; + + /** + * The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + IncludedQuantity?: float32; +} + +/** + * Parameters that are used in the odata $filter query parameter for providing RateCard information. + */ +model RateCardQueryParameters { + /** + * The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @pattern("^MS-AZR-\\d{4}P(-\\d{4}P)*$") + OfferDurableId: string; + + /** + * The currency in which the rates need to be provided. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Currency: string; + + /** + * The culture in which the resource metadata needs to be localized. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Locale: string; + + /** + * 2 letter ISO code where the offer was purchased. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + RegionInfo: string; +} + +/** + * Indicates that this is a monetary credit offer. + */ +model MonetaryCredit extends OfferTermInfo { + /** + * The amount of credit provided under the terms of the given offer level. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-generic-numeric" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Credit?: decimal; + + /** + * An array of meter ids that are excluded from the given offer terms. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ExcludedMeterIds?: Azure.Core.uuid[]; + + /** + * Name of the offer term + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoName.MonetaryCredit; +} + +/** + * Indicates that a monetary commitment is required for this offer + */ +model MonetaryCommitment extends OfferTermInfo { + /** + * The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + TieredDiscount?: Record; + + /** + * An array of meter ids that are excluded from the given offer terms. + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + ExcludedMeterIds?: Azure.Core.uuid[]; + + /** + * Name of the offer term + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoName.MonetaryCommitment; +} + +/** + * Indicates a recurring charge is present for this offer. + */ +model RecurringCharge extends OfferTermInfo { + /** + * The amount of recurring charge as per the offer term. + */ + #suppress "@azure-tools/typespec-client-generator-core/property-name-conflict" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + RecurringCharge?: int32; + + /** + * Name of the offer term + */ + #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + Name: OfferTermInfoName.RecurringCharge; +} diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp new file mode 100644 index 000000000000..c760555a7059 --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp @@ -0,0 +1,91 @@ +// FIXME: Operations in this file are not detected as a resource operation, please confirm the conversion result manually + +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using Azure.ResourceManager; +using TypeSpec.OpenAPI; + +namespace Microsoft.Commerce; + +alias UsageAggregatesListParameters = { + /** + * The start of the time range to retrieve data for. + */ + @query("reportedStartTime") + reportedStartTime: utcDateTime; + + /** + * The end of the time range to retrieve data for. + */ + @query("reportedEndTime") + reportedEndTime: utcDateTime; + + /** + * `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). + */ + @query("showDetails") + showDetails?: boolean; + + /** + * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. + */ + @query("aggregationGranularity") + aggregationGranularity?: AggregationGranularity = AggregationGranularity.Daily; + + /** + * Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. + */ + @query("continuationToken") + continuationToken?: string; +}; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface UsageAggregatesOperationGroup { + /** + * Query aggregated Azure subscription consumption data for a date range. + */ + #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/usageaggregates") + @autoRoute + @get + @list + @action("UsageAggregates") + list is ArmProviderActionSync< + Response = ResourceListResult | (ArmAcceptedLroResponse & + ErrorObjectResponse), + Scope = SubscriptionActionScope, + Parameters = UsageAggregatesListParameters, + Error = ErrorObjectResponse + >; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" +interface RateCardOperationGroup { + /** + * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. + */ + #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" + @autoRoute + @get + @action("RateCard") + @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/ratecard") + get is ArmProviderActionSync< + Response = ResourceRateCardInfo, + Scope = SubscriptionActionScope, + Parameters = { + /** + * The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter. + */ + @query + $filter: string; + }, + Error = ErrorResponse + >; +} diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/suppressions.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/suppressions.yaml deleted file mode 100644 index fada9776f3ed..000000000000 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/suppressions.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- tool: TypeSpecRequirement - path: ./preview/2015-06-01-preview/*.json - reason: Brownfield service not ready to migrate diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml new file mode 100644 index 000000000000..793139f04190 --- /dev/null +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml @@ -0,0 +1,46 @@ +parameters: + "service-dir": + default: "sdk/commerce" +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + omit-unreachable-types: false + emitter-output-dir: "{project-root}" + azure-resource-provider-folder: "resource-manager" + output-file: "{version-status}/{version}/commerce.json" + arm-types-dir: "{project-root}/../../../../common-types/resource-management" + emit-lro-options: "all" + examples-dir: "{project-root}/examples" + "@azure-tools/typespec-python": + emitter-output-dir: "{output-dir}/{service-dir}/azure-mgmt-commerce" + namespace: "azure.mgmt.commerce" + generate-test: true + generate-sample: true + flavor: "azure" + "@azure-tools/typespec-java": + emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-commerce" + namespace: "com.azure.resourcemanager.commerce" + service-name: "Commerce" # human-readable service name, whitespace allowed + flavor: azure + "@azure-tools/typespec-ts": + service-dir: sdk/commerce + emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" + is-modular-library: true + flavor: "azure" + experimental-extensible-enums: true + package-details: + name: "@azure/arm-commerce" + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/commerce" + emitter-output-dir: "{output-dir}/{service-dir}/armcommerce" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/armcommerce" + fix-const-stuttering: true + flavor: "azure" + generate-samples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/resource-manager" From d5468d8624423ceff3447b962b796abb7187abe8 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Fri, 9 Jan 2026 15:43:38 +0800 Subject: [PATCH 15/31] feat(commerce): add Java client customizations and update emitter options - Add @clientName decorator for UsageManager in Java - Add @alternateType mapping for UsageSample infoFields to ClientCustomizations.InfoField - Configure tspconfig.yaml with Azure-specific options: - Enable object usage for unknown types - Enable client-side validations - Set UUID as number instead of string - Set float32 as double instead of float --- .../Microsoft.Commerce/Commerce/client.tsp | 7 +++++++ .../Microsoft.Commerce/Commerce/tspconfig.yaml | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp index b1ad3ee477de..51c8ee35c8b7 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp @@ -12,3 +12,10 @@ using Microsoft.Commerce; "Daily", "python" ); + +@@clientName(Microsoft.Commerce, "UsageManager", "java"); + +@@alternateType(Microsoft.Commerce.UsageSample.infoFields, + ClientCustomizations.InfoField, + "java" +); diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml index 793139f04190..02d1e4b4f277 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml @@ -23,6 +23,10 @@ options: namespace: "com.azure.resourcemanager.commerce" service-name: "Commerce" # human-readable service name, whitespace allowed flavor: azure + use-object-for-unknown: true + client-side-validations: true + uuid-as-string: false + float32-as-double: false "@azure-tools/typespec-ts": service-dir: sdk/commerce emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" From f0598019a4d9915fd8634110dc6b435e34f1a895 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Fri, 9 Jan 2026 16:53:54 +0800 Subject: [PATCH 16/31] Update routes.tsp --- .../Microsoft.Commerce/Commerce/routes.tsp | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp index c760555a7059..cb77c86b7c3a 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp @@ -13,38 +13,6 @@ using TypeSpec.OpenAPI; namespace Microsoft.Commerce; -alias UsageAggregatesListParameters = { - /** - * The start of the time range to retrieve data for. - */ - @query("reportedStartTime") - reportedStartTime: utcDateTime; - - /** - * The end of the time range to retrieve data for. - */ - @query("reportedEndTime") - reportedEndTime: utcDateTime; - - /** - * `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). - */ - @query("showDetails") - showDetails?: boolean; - - /** - * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. - */ - @query("aggregationGranularity") - aggregationGranularity?: AggregationGranularity = AggregationGranularity.Daily; - - /** - * Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. - */ - @query("continuationToken") - continuationToken?: string; -}; - #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" interface UsageAggregatesOperationGroup { /** @@ -61,7 +29,37 @@ interface UsageAggregatesOperationGroup { Response = ResourceListResult | (ArmAcceptedLroResponse & ErrorObjectResponse), Scope = SubscriptionActionScope, - Parameters = UsageAggregatesListParameters, + Parameters = { + /** + * The start of the time range to retrieve data for. + */ + @query("reportedStartTime") + reportedStartTime: utcDateTime; + + /** + * The end of the time range to retrieve data for. + */ + @query("reportedEndTime") + reportedEndTime: utcDateTime; + + /** + * `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). + */ + @query("showDetails") + showDetails?: boolean; + + /** + * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. + */ + @query("aggregationGranularity") + aggregationGranularity?: AggregationGranularity = AggregationGranularity.Daily; + + /** + * Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. + */ + @query("continuationToken") + continuationToken?: string; + }, Error = ErrorObjectResponse >; } From 2ad75ad13f186e39ecfd08230999109972d8c4b1 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Fri, 9 Jan 2026 16:55:25 +0800 Subject: [PATCH 17/31] Update client.tsp --- .../Microsoft.Commerce/Commerce/client.tsp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp index 51c8ee35c8b7..f4df02b49ea6 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp @@ -5,13 +5,6 @@ using Azure.ClientGenerator.Core; using Microsoft.Commerce; @@clientName(Microsoft.Commerce, "UsageManagementClient", "python"); -@@clientName(OfferTermInfoName, "OfferTermInfoEnum", "python"); - -#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy decorator required for Python SDK compatibility" -@@Legacy.clientDefaultValue(UsageAggregatesListParameters.aggregationGranularity, - "Daily", - "python" -); @@clientName(Microsoft.Commerce, "UsageManager", "java"); From 5bbbde2978f574664204833580d9a87db79b6158 Mon Sep 17 00:00:00 2001 From: v-huizhu2 Date: Mon, 12 Jan 2026 11:51:42 +0800 Subject: [PATCH 18/31] Remove Java client and alternate type from client.tsp Removed Java client name and alternate type definition. --- .../resource-manager/Microsoft.Commerce/Commerce/client.tsp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp index f4df02b49ea6..1fc22d06f16a 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp @@ -6,9 +6,3 @@ using Microsoft.Commerce; @@clientName(Microsoft.Commerce, "UsageManagementClient", "python"); -@@clientName(Microsoft.Commerce, "UsageManager", "java"); - -@@alternateType(Microsoft.Commerce.UsageSample.infoFields, - ClientCustomizations.InfoField, - "java" -); From 9077a5005e1f2e99514578a0636756557eab2376 Mon Sep 17 00:00:00 2001 From: v-huizhu2 Date: Mon, 12 Jan 2026 13:57:40 +0800 Subject: [PATCH 19/31] Add stream-style-serialization option to tspconfig --- .../resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml index 02d1e4b4f277..9d5b39e48983 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml @@ -27,6 +27,7 @@ options: client-side-validations: true uuid-as-string: false float32-as-double: false + stream-style-serialization: false "@azure-tools/typespec-ts": service-dir: sdk/commerce emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" From f96c2c928894608e99740acfeead94e92b92a59e Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 12 Jan 2026 14:24:37 +0800 Subject: [PATCH 20/31] Update client.tsp --- .../resource-manager/Microsoft.Commerce/Commerce/client.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp index 1fc22d06f16a..54bc9ce519d0 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp @@ -5,4 +5,3 @@ using Azure.ClientGenerator.Core; using Microsoft.Commerce; @@clientName(Microsoft.Commerce, "UsageManagementClient", "python"); - From 4a1289adf5d0a3d8894167da3cc8be4f43283c85 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 12 Jan 2026 14:29:17 +0800 Subject: [PATCH 21/31] update --- .../examples/2015-06-01-preview/GetUsageAggregatesList.json | 6 ++++-- .../2015-06-01-preview/examples/GetUsageAggregatesList.json | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json index 76de35281fca..c42a5ce12cce 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json @@ -35,8 +35,10 @@ "202": { "body": { "error": { - "code": "aaaaaaaaaaaaaaaaaaaaaa", - "message": "aaaaaaaaaaaaaaaaaaaa" + "ErrorResponse": { + "code": "aaaaaaaaaaaaaaaaaaaaaa", + "message": "aaaaaaaaaaaaaaaaaaaa" + } } } } diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json index 76de35281fca..c42a5ce12cce 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json @@ -35,8 +35,10 @@ "202": { "body": { "error": { - "code": "aaaaaaaaaaaaaaaaaaaaaa", - "message": "aaaaaaaaaaaaaaaaaaaa" + "ErrorResponse": { + "code": "aaaaaaaaaaaaaaaaaaaaaa", + "message": "aaaaaaaaaaaaaaaaaaaa" + } } } } From 9260462c1ae07be2e39bc63b3e7d18e0179b8cb7 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 12 Jan 2026 14:31:16 +0800 Subject: [PATCH 22/31] Revert "update" This reverts commit 4a1289adf5d0a3d8894167da3cc8be4f43283c85. --- .../examples/2015-06-01-preview/GetUsageAggregatesList.json | 6 ++---- .../2015-06-01-preview/examples/GetUsageAggregatesList.json | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json index c42a5ce12cce..76de35281fca 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/examples/2015-06-01-preview/GetUsageAggregatesList.json @@ -35,10 +35,8 @@ "202": { "body": { "error": { - "ErrorResponse": { - "code": "aaaaaaaaaaaaaaaaaaaaaa", - "message": "aaaaaaaaaaaaaaaaaaaa" - } + "code": "aaaaaaaaaaaaaaaaaaaaaa", + "message": "aaaaaaaaaaaaaaaaaaaa" } } } diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json index c42a5ce12cce..76de35281fca 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/examples/GetUsageAggregatesList.json @@ -35,10 +35,8 @@ "202": { "body": { "error": { - "ErrorResponse": { - "code": "aaaaaaaaaaaaaaaaaaaaaa", - "message": "aaaaaaaaaaaaaaaaaaaa" - } + "code": "aaaaaaaaaaaaaaaaaaaaaa", + "message": "aaaaaaaaaaaaaaaaaaaa" } } } From d844ee7507de5e5e1df9453bcb773f093f74f443 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 12 Jan 2026 14:46:31 +0800 Subject: [PATCH 23/31] update --- .../Commerce/preview/2015-06-01-preview/commerce.json | 4 ---- .../resource-manager/Microsoft.Commerce/Commerce/routes.tsp | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json index adb922c207af..0abc27061aeb 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json @@ -168,10 +168,6 @@ "$ref": "#/definitions/ErrorObjectResponse" }, "headers": { - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - }, "Retry-After": { "type": "integer", "format": "int32", diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp index cb77c86b7c3a..6b8a75ab2cbf 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp @@ -18,6 +18,7 @@ interface UsageAggregatesOperationGroup { /** * Query aggregated Azure subscription consumption data for a date range. */ + #suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/usageaggregates") @@ -26,7 +27,7 @@ interface UsageAggregatesOperationGroup { @list @action("UsageAggregates") list is ArmProviderActionSync< - Response = ResourceListResult | (ArmAcceptedLroResponse & + Response = ResourceListResult | (ArmAcceptedResponse & ErrorObjectResponse), Scope = SubscriptionActionScope, Parameters = { From fcd15da99a045d38a5e434b31fa0250d179db0b0 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 12 Jan 2026 16:00:53 +0800 Subject: [PATCH 24/31] Update specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml --- .../Microsoft.Commerce/Commerce/tspconfig.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml index 9d5b39e48983..793139f04190 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml @@ -23,11 +23,6 @@ options: namespace: "com.azure.resourcemanager.commerce" service-name: "Commerce" # human-readable service name, whitespace allowed flavor: azure - use-object-for-unknown: true - client-side-validations: true - uuid-as-string: false - float32-as-double: false - stream-style-serialization: false "@azure-tools/typespec-ts": service-dir: sdk/commerce emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" From f1f98754f570b7b15a5338db23aabdffd2c07099 Mon Sep 17 00:00:00 2001 From: Judy Liu Date: Mon, 12 Jan 2026 16:17:06 +0800 Subject: [PATCH 25/31] add go config --- .../Microsoft.Commerce/Commerce/back-compatible.tsp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp index 10049221f300..2f1ad92bee56 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp @@ -9,3 +9,7 @@ using Microsoft.Commerce; @@clientLocation(UsageAggregatesOperationGroup.list, "UsageAggregates"); @@clientLocation(RateCardOperationGroup.get, "RateCard"); + +@@alternateType(MonetaryCommitment.Name, OfferTermInfo.Name, "go"); +@@alternateType(MonetaryCredit.Name, OfferTermInfo.Name, "go"); +@@alternateType(RecurringCharge.Name, OfferTermInfo.Name, "go"); From c850c67356c8b8d0a09f1f49eb9ecbd412314785 Mon Sep 17 00:00:00 2001 From: Judy Liu Date: Mon, 12 Jan 2026 16:26:25 +0800 Subject: [PATCH 26/31] revert go config --- .../Microsoft.Commerce/Commerce/back-compatible.tsp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp index 2f1ad92bee56..10049221f300 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/back-compatible.tsp @@ -9,7 +9,3 @@ using Microsoft.Commerce; @@clientLocation(UsageAggregatesOperationGroup.list, "UsageAggregates"); @@clientLocation(RateCardOperationGroup.get, "RateCard"); - -@@alternateType(MonetaryCommitment.Name, OfferTermInfo.Name, "go"); -@@alternateType(MonetaryCredit.Name, OfferTermInfo.Name, "go"); -@@alternateType(RecurringCharge.Name, OfferTermInfo.Name, "go"); From 24ffc18de3061481d83b7d0442440bca53222086 Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:38:50 +0800 Subject: [PATCH 27/31] Update tspconfig.yaml by removing unused properties Removed service-dir and is-modular-library properties. --- .../resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml index 793139f04190..9d30d1aa62a1 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml @@ -24,9 +24,7 @@ options: service-name: "Commerce" # human-readable service name, whitespace allowed flavor: azure "@azure-tools/typespec-ts": - service-dir: sdk/commerce emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" - is-modular-library: true flavor: "azure" experimental-extensible-enums: true package-details: From 896ca84cf22bd21fadb69ca84081948e2088b81e Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" Date: Thu, 15 Jan 2026 14:04:13 +0800 Subject: [PATCH 28/31] update client name --- .../resource-manager/Microsoft.Commerce/Commerce/client.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp index 54bc9ce519d0..dcc506c0e169 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/client.tsp @@ -4,4 +4,4 @@ import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; using Microsoft.Commerce; -@@clientName(Microsoft.Commerce, "UsageManagementClient", "python"); +@@clientName(Microsoft.Commerce, "UsageManagementClient", "python, javascript"); From c0defab58abbf4ba551cbfb918f824a592a9f84f Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:51:07 +0800 Subject: [PATCH 29/31] Enable compatibility-lro in tspconfig.yaml --- .../resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml index 9d30d1aa62a1..55fe131b608e 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml @@ -26,6 +26,7 @@ options: "@azure-tools/typespec-ts": emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" flavor: "azure" + compatibility-lro: true experimental-extensible-enums: true package-details: name: "@azure/arm-commerce" From 07724ef2a61a77b1c8c41dd36e85dc4cb9e50bab Mon Sep 17 00:00:00 2001 From: "Jiao Di (MSFT)" <80496810+v-jiaodi@users.noreply.github.com> Date: Mon, 2 Feb 2026 10:28:27 +0800 Subject: [PATCH 30/31] Remove compatibility-lro from tspconfig.yaml Removed compatibility-lro setting from TypeSpec configuration. --- .../resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml index 55fe131b608e..9d30d1aa62a1 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/tspconfig.yaml @@ -26,7 +26,6 @@ options: "@azure-tools/typespec-ts": emitter-output-dir: "{output-dir}/{service-dir}/arm-commerce" flavor: "azure" - compatibility-lro: true experimental-extensible-enums: true package-details: name: "@azure/arm-commerce" From 4e5aebcc507951bedd26732c7a599c628bbd8aac Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Tue, 10 Feb 2026 15:37:13 +0800 Subject: [PATCH 31/31] update --- .../preview/2015-06-01-preview/commerce.json | 15 ++++++++++++++- .../Microsoft.Commerce/Commerce/routes.tsp | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json index 0abc27061aeb..24cda41fbe60 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/preview/2015-06-01-preview/commerce.json @@ -37,11 +37,21 @@ } } }, - "tags": [], + "tags": [ + { + "name": "UsageAggregates" + }, + { + "name": "RateCard" + } + ], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/rateCard": { "get": { "operationId": "RateCard_Get", + "tags": [ + "RateCard" + ], "description": "Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.", "externalDocs": { "url": "https://docs.microsoft.com/rest/api/commerce/ratecard" @@ -85,6 +95,9 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/usageAggregates": { "get": { "operationId": "UsageAggregates_List", + "tags": [ + "UsageAggregates" + ], "description": "Query aggregated Azure subscription consumption data for a date range.", "externalDocs": { "url": "https://docs.microsoft.com/rest/api/commerce/usageaggregates" diff --git a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp index 6b8a75ab2cbf..e674bfc6d0bc 100644 --- a/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp +++ b/specification/commerce/resource-manager/Microsoft.Commerce/Commerce/routes.tsp @@ -25,6 +25,7 @@ interface UsageAggregatesOperationGroup { @autoRoute @get @list + @tag("UsageAggregates") @action("UsageAggregates") list is ArmProviderActionSync< Response = ResourceListResult | (ArmAcceptedResponse & @@ -73,6 +74,7 @@ interface RateCardOperationGroup { #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @autoRoute @get + @tag("RateCard") @action("RateCard") @OpenAPI.externalDocs("https://docs.microsoft.com/rest/api/commerce/ratecard") get is ArmProviderActionSync<