diff --git a/sdk/commerce/arm-commerce/LICENSE.txt b/sdk/commerce/arm-commerce/LICENSE.txt index a70e8cf66038..2d3163745319 100644 --- a/sdk/commerce/arm-commerce/LICENSE.txt +++ b/sdk/commerce/arm-commerce/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/commerce/arm-commerce/README.md b/sdk/commerce/arm-commerce/README.md index 1179d4d83ce4..dbcfeeb61d0d 100644 --- a/sdk/commerce/arm-commerce/README.md +++ b/sdk/commerce/arm-commerce/README.md @@ -1,11 +1,11 @@ ## Azure UsageManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for UsageManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for UsageManagementClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-commerce @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and list usageAggregates as an example written in JavaScript. ##### Sample code @@ -90,7 +88,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmCommerce.UsageManagementClient(creds, subscriptionId); const reportedStartTime = new Date().toISOString(); diff --git a/sdk/commerce/arm-commerce/package.json b/sdk/commerce/arm-commerce/package.json index 35bab095144f..120dfe5ec6c7 100644 --- a/sdk/commerce/arm-commerce/package.json +++ b/sdk/commerce/arm-commerce/package.json @@ -4,10 +4,10 @@ "description": "UsageManagementClient Library with typescript type definitions for node.js and browser.", "version": "2.2.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.4.0", - "@azure/ms-rest-js": "^1.11.0", + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-js": "^2.2.0", "@azure/core-auth": "^1.1.4", - "tslib": "^1.9.3" + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -22,18 +22,18 @@ "types": "./esm/usageManagementClient.d.ts", "devDependencies": { "typescript": "^3.6.0", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.4.9" + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/main/sdk/commerce/arm-commerce", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/commerce/arm-commerce", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", diff --git a/sdk/commerce/arm-commerce/rollup.config.js b/sdk/commerce/arm-commerce/rollup.config.js index 4dac60a49527..1e10437d4dab 100644 --- a/sdk/commerce/arm-commerce/rollup.config.js +++ b/sdk/commerce/arm-commerce/rollup.config.js @@ -21,15 +21,15 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }), + nodeResolve({ mainFields: ['module', 'main'] }), sourcemaps() ] }; diff --git a/sdk/commerce/arm-commerce/src/models/index.ts b/sdk/commerce/arm-commerce/src/models/index.ts index f9ba948659c4..33d6f56055d9 100644 --- a/sdk/commerce/arm-commerce/src/models/index.ts +++ b/sdk/commerce/arm-commerce/src/models/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; @@ -13,128 +11,104 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; - /** - * @interface - * An interface representing InfoField. * Key-value pairs of instance details in the legacy format. - * */ export interface InfoField { /** - * @member {string} [project] Identifies the name of the instance provisioned - * by the user. + * Identifies the name of the instance provisioned by the user. */ project?: string; } /** - * @interface - * An interface representing UsageAggregation. * Describes the usageAggregation. - * */ export interface UsageAggregation { /** - * @member {string} [id] Unique Id for the usage aggregate. + * Unique Id for the usage aggregate. */ id?: string; /** - * @member {string} [name] Name of the usage aggregate. + * Name of the usage aggregate. */ name?: string; /** - * @member {string} [type] Type of the resource being returned. + * Type of the resource being returned. */ type?: string; /** - * @member {string} [subscriptionId] The subscription identifier for the - * Azure user. + * The subscription identifier for the Azure user. */ subscriptionId?: string; /** - * @member {string} [meterId] Unique ID for the resource that was consumed - * (aka ResourceID). + * Unique ID for the resource that was consumed (aka ResourceID). */ meterId?: string; /** - * @member {Date} [usageStartTime] UTC start time for the usage bucket to - * which this usage aggregate belongs. + * UTC start time for the usage bucket to which this usage aggregate belongs. */ usageStartTime?: Date; /** - * @member {Date} [usageEndTime] UTC end time for the usage bucket to which - * this usage aggregate belongs. + * UTC end time for the usage bucket to which this usage aggregate belongs. */ usageEndTime?: Date; /** - * @member {number} [quantity] The amount of the resource consumption that - * occurred in this time frame. + * The amount of the resource consumption that occurred in this time frame. */ quantity?: number; /** - * @member {string} [unit] The unit in which the usage for this resource is - * being counted, e.g. Hours, GB. + * The unit in which the usage for this resource is being counted, e.g. Hours, GB. */ unit?: string; /** - * @member {string} [meterName] Friendly name of the resource being consumed. + * Friendly name of the resource being consumed. */ meterName?: string; /** - * @member {string} [meterCategory] Category of the consumed resource. + * Category of the consumed resource. */ meterCategory?: string; /** - * @member {string} [meterSubCategory] Sub-category of the consumed resource. + * Sub-category of the consumed resource. */ meterSubCategory?: string; /** - * @member {string} [meterRegion] Region of the meterId used for billing - * purposes + * Region of the meterId used for billing purposes */ meterRegion?: string; /** - * @member {InfoField} [infoFields] Key-value pairs of instance details - * (legacy format). + * Key-value pairs of instance details (legacy format). */ infoFields?: InfoField; /** - * @member {string} [instanceData] Key-value pairs of instance details - * represented as a string. + * Key-value pairs of instance details represented as a string. */ instanceData?: string; } /** - * @interface - * An interface representing RateCardQueryParameters. - * Parameters that are used in the odata $filter query parameter for providing - * RateCard information. - * + * Parameters that are used in the odata $filter query parameter for providing RateCard + * information. */ export interface RateCardQueryParameters { /** - * @member {string} offerDurableId 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. + * 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. */ offerDurableId: string; /** - * @member {string} currency The currency in which the rates need to be - * provided. + * The currency in which the rates need to be provided. */ currency: string; /** - * @member {string} locale The culture in which the resource metadata needs - * to be localized. + * The culture in which the resource metadata needs to be localized. */ locale: string; /** - * @member {string} regionInfo 2 letter ISO code where the offer was - * purchased. + * 2 letter ISO code where the offer was purchased. */ regionInfo: string; } @@ -145,270 +119,237 @@ export interface RateCardQueryParameters { export type OfferTermInfoUnion = OfferTermInfo | MonetaryCredit | MonetaryCommitment | RecurringCharge; /** - * @interface - * An interface representing OfferTermInfo. * Describes the offer term. - * */ export interface OfferTermInfo { /** - * @member {string} name Polymorphic Discriminator + * Polymorphic Discriminator */ name: "OfferTermInfo"; /** - * @member {Date} [effectiveDate] Indicates the date from which the offer - * term is effective. + * Indicates the date from which the offer term is effective. */ effectiveDate?: Date; } /** - * @interface - * An interface representing MeterInfo. * Detailed information about the meter. - * */ export interface MeterInfo { /** - * @member {string} [meterId] The unique identifier of the resource. + * The unique identifier of the resource. */ meterId?: string; /** - * @member {string} [meterName] The name of the meter, within the given meter - * category + * The name of the meter, within the given meter category */ meterName?: string; /** - * @member {string} [meterCategory] The category of the meter, e.g., 'Cloud - * services', 'Networking', etc.. + * The category of the meter, e.g., 'Cloud services', 'Networking', etc.. */ meterCategory?: string; /** - * @member {string} [meterSubCategory] The subcategory of the meter, e.g., - * 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. + * The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. */ meterSubCategory?: string; /** - * @member {string} [unit] The unit in which the meter consumption is - * charged, e.g., 'Hours', 'GB', etc. + * The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. */ unit?: string; /** - * @member {string[]} [meterTags] Provides additional meter data. 'Third - * Party' indicates a meter with no discount. Blanks indicate First Party. + * Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks + * indicate First Party. */ meterTags?: string[]; /** - * @member {string} [meterRegion] The region in which the Azure service is - * available. + * The region in which the Azure service is available. */ meterRegion?: string; /** - * @member {{ [propertyName: string]: number }} [meterRates] 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 + * 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 */ meterRates?: { [propertyName: string]: number }; /** - * @member {Date} [effectiveDate] Indicates the date from which the meter - * rate is effective. + * Indicates the date from which the meter rate is effective. */ effectiveDate?: Date; /** - * @member {number} [includedQuantity] The resource quantity that is included - * in the offer at no cost. Consumption beyond this quantity will be charged. + * The resource quantity that is included in the offer at no cost. Consumption beyond this + * quantity will be charged. */ includedQuantity?: number; } /** - * @interface - * An interface representing ResourceRateCardInfo. * Price and Metadata information for resources - * */ export interface ResourceRateCardInfo { /** - * @member {string} [currency] The currency in which the rates are provided. + * The currency in which the rates are provided. */ currency?: string; /** - * @member {string} [locale] The culture in which the resource information is - * localized. + * The culture in which the resource information is localized. */ locale?: string; /** - * @member {boolean} [isTaxIncluded] All rates are pretax, so this will - * always be returned as 'false'. + * All rates are pretax, so this will always be returned as 'false'. */ isTaxIncluded?: boolean; /** - * @member {OfferTermInfoUnion[]} [offerTerms] A list of offer terms. + * A list of offer terms. */ offerTerms?: OfferTermInfoUnion[]; /** - * @member {MeterInfo[]} [meters] A list of meters. + * A list of meters. */ meters?: MeterInfo[]; } /** - * @interface - * An interface representing MonetaryCredit. * Indicates that this is a monetary credit offer. - * */ export interface MonetaryCredit { /** - * @member {string} name Polymorphic Discriminator + * Polymorphic Discriminator */ name: "Monetary Credit"; /** - * @member {Date} [effectiveDate] Indicates the date from which the offer - * term is effective. + * Indicates the date from which the offer term is effective. */ effectiveDate?: Date; /** - * @member {number} [credit] The amount of credit provided under the terms of - * the given offer level. + * The amount of credit provided under the terms of the given offer level. */ credit?: number; /** - * @member {string[]} [excludedMeterIds] An array of meter ids that are - * excluded from the given offer terms. + * An array of meter ids that are excluded from the given offer terms. */ excludedMeterIds?: string[]; } /** - * @interface - * An interface representing MonetaryCommitment. * Indicates that a monetary commitment is required for this offer - * */ export interface MonetaryCommitment { /** - * @member {string} name Polymorphic Discriminator + * Polymorphic Discriminator */ name: "Monetary Commitment"; /** - * @member {Date} [effectiveDate] Indicates the date from which the offer - * term is effective. + * Indicates the date from which the offer term is effective. */ effectiveDate?: Date; /** - * @member {{ [propertyName: string]: number }} [tieredDiscount] 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'. + * 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'. */ tieredDiscount?: { [propertyName: string]: number }; /** - * @member {string[]} [excludedMeterIds] An array of meter ids that are - * excluded from the given offer terms. + * An array of meter ids that are excluded from the given offer terms. */ excludedMeterIds?: string[]; } /** - * @interface - * An interface representing RecurringCharge. * Indicates a recurring charge is present for this offer. - * */ export interface RecurringCharge { /** - * @member {string} name Polymorphic Discriminator + * Polymorphic Discriminator */ name: "Recurring Charge"; /** - * @member {Date} [effectiveDate] Indicates the date from which the offer - * term is effective. + * Indicates the date from which the offer term is effective. */ effectiveDate?: Date; /** - * @member {number} [recurringCharge] The amount of recurring charge as per - * the offer term. + * The amount of recurring charge as per the offer term. */ recurringCharge?: number; } /** - * @interface - * An interface representing ErrorResponse. * Describes the format of Error response. - * */ export interface ErrorResponse { /** - * @member {string} [code] Error code + * Error code */ code?: string; /** - * @member {string} [message] Error message indicating why the operation - * failed. + * Error message indicating why the operation failed. */ message?: string; } /** - * @interface - * An interface representing UsageAggregatesListOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface UsageAggregatesListOptionalParams extends msRest.RequestOptionsBase { /** - * @member {boolean} [showDetails] `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). + * `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). */ showDetails?: boolean; /** - * @member {AggregationGranularity} [aggregationGranularity] `Daily` - * (default) returns the data in daily granularity, `Hourly` returns the data - * in hourly granularity. Possible values include: 'Daily', 'Hourly'. Default - * value: 'Daily' . + * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly + * granularity. Possible values include: 'Daily', 'Hourly'. Default value: 'Daily'. */ aggregationGranularity?: AggregationGranularity; /** - * @member {string} [continuationToken] 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 + * 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. */ continuationToken?: string; } /** - * @interface - * An interface representing UsageManagementClientOptions. - * @extends AzureServiceClientOptions + * Optional Parameters. */ -export interface UsageManagementClientOptions extends AzureServiceClientOptions { +export interface UsageAggregatesListNextOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [baseUri] + * `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). */ - baseUri?: string; + showDetails?: boolean; + /** + * `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly + * granularity. Possible values include: 'Daily', 'Hourly'. Default value: 'Daily'. + */ + aggregationGranularity?: AggregationGranularity; + /** + * 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. + */ + continuationToken?: string; } +/** + * An interface representing UsageManagementClientOptions. + */ +export interface UsageManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} /** * @interface - * An interface representing the UsageAggregationListResult. * The Get UsageAggregates operation response. - * * @extends Array */ export interface UsageAggregationListResult extends Array { /** - * @member {string} [nextLink] Gets or sets the link to the next set of - * results. + * Gets or sets the link to the next set of results. */ nextLink?: string; } @@ -433,6 +374,7 @@ export type UsageAggregatesListResponse = UsageAggregationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -452,6 +394,7 @@ export type UsageAggregatesListNextResponse = UsageAggregationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -471,6 +414,7 @@ export type RateCardGetResponse = ResourceRateCardInfo & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ diff --git a/sdk/commerce/arm-commerce/src/models/mappers.ts b/sdk/commerce/arm-commerce/src/models/mappers.ts index d35dd7532add..2b101aa827ed 100644 --- a/sdk/commerce/arm-commerce/src/models/mappers.ts +++ b/sdk/commerce/arm-commerce/src/models/mappers.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; @@ -471,4 +469,5 @@ export const discriminators = { 'OfferTermInfo.Monetary Credit' : MonetaryCredit, 'OfferTermInfo.Monetary Commitment' : MonetaryCommitment, 'OfferTermInfo.Recurring Charge' : RecurringCharge + }; diff --git a/sdk/commerce/arm-commerce/src/models/parameters.ts b/sdk/commerce/arm-commerce/src/models/parameters.ts index 20a436455b21..30b581253bcb 100644 --- a/sdk/commerce/arm-commerce/src/models/parameters.ts +++ b/sdk/commerce/arm-commerce/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/commerce/arm-commerce/src/models/rateCardMappers.ts b/sdk/commerce/arm-commerce/src/models/rateCardMappers.ts index 7be716abd051..ba41476397e1 100644 --- a/sdk/commerce/arm-commerce/src/models/rateCardMappers.ts +++ b/sdk/commerce/arm-commerce/src/models/rateCardMappers.ts @@ -1,21 +1,18 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { discriminators, - ResourceRateCardInfo, - OfferTermInfo, - MeterInfo, ErrorResponse, - MonetaryCredit, + MeterInfo, MonetaryCommitment, - RecurringCharge + MonetaryCredit, + OfferTermInfo, + RecurringCharge, + ResourceRateCardInfo } from "../models/mappers"; - diff --git a/sdk/commerce/arm-commerce/src/models/usageAggregatesMappers.ts b/sdk/commerce/arm-commerce/src/models/usageAggregatesMappers.ts index a6537c2d3c95..9687a81ba565 100644 --- a/sdk/commerce/arm-commerce/src/models/usageAggregatesMappers.ts +++ b/sdk/commerce/arm-commerce/src/models/usageAggregatesMappers.ts @@ -1,18 +1,15 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { discriminators, - UsageAggregationListResult, - UsageAggregation, + ErrorResponse, InfoField, - ErrorResponse + UsageAggregation, + UsageAggregationListResult } from "../models/mappers"; - diff --git a/sdk/commerce/arm-commerce/src/operations/index.ts b/sdk/commerce/arm-commerce/src/operations/index.ts index fc774b66d368..9374c2b622f7 100644 --- a/sdk/commerce/arm-commerce/src/operations/index.ts +++ b/sdk/commerce/arm-commerce/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/commerce/arm-commerce/src/operations/rateCard.ts b/sdk/commerce/arm-commerce/src/operations/rateCard.ts index 698888d775ad..3bbef6439994 100644 --- a/sdk/commerce/arm-commerce/src/operations/rateCard.ts +++ b/sdk/commerce/arm-commerce/src/operations/rateCard.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/commerce/arm-commerce/src/operations/usageAggregates.ts b/sdk/commerce/arm-commerce/src/operations/usageAggregates.ts index d7f83c33bac2..fb152845409d 100644 --- a/sdk/commerce/arm-commerce/src/operations/usageAggregates.ts +++ b/sdk/commerce/arm-commerce/src/operations/usageAggregates.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -61,25 +60,33 @@ export class UsageAggregates { /** * Query aggregated Azure subscription consumption data for a date range. * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param reportedStartTime The start of the time range to retrieve data for. + * @param reportedEndTime The end of the time range to retrieve data for. * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, reportedStartTime: Date | string, reportedEndTime: Date | string, options?: Models.UsageAggregatesListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param reportedStartTime The start of the time range to retrieve data for. + * @param reportedEndTime The end of the time range to retrieve data for. * @param callback The callback */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, reportedStartTime: Date | string, reportedEndTime: Date | string, callback: msRest.ServiceCallback): void; /** * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param reportedStartTime The start of the time range to retrieve data for. + * @param reportedEndTime The end of the time range to retrieve data for. * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, reportedStartTime: Date | string, reportedEndTime: Date | string, options: Models.UsageAggregatesListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, reportedStartTime: Date | string, reportedEndTime: Date | string, options?: Models.UsageAggregatesListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, + reportedStartTime, + reportedEndTime, options }, listNextOperationSpec, @@ -124,6 +131,14 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.reportedStartTime, + Parameters.reportedEndTime, + Parameters.showDetails, + Parameters.aggregationGranularity, + Parameters.continuationToken, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/commerce/arm-commerce/src/usageManagementClient.ts b/sdk/commerce/arm-commerce/src/usageManagementClient.ts index dcd1922bb0cd..e6681a2745c2 100644 --- a/sdk/commerce/arm-commerce/src/usageManagementClient.ts +++ b/sdk/commerce/arm-commerce/src/usageManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is diff --git a/sdk/commerce/arm-commerce/src/usageManagementClientContext.ts b/sdk/commerce/arm-commerce/src/usageManagementClientContext.ts index 5e9e2eca1fbc..b7013b8bd73f 100644 --- a/sdk/commerce/arm-commerce/src/usageManagementClientContext.ts +++ b/sdk/commerce/arm-commerce/src/usageManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -10,8 +9,8 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-commerce"; const packageVersion = "2.2.0"; @@ -44,7 +43,7 @@ export class UsageManagementClientContext extends msRestAzure.AzureServiceClient if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } @@ -59,10 +58,10 @@ export class UsageManagementClientContext extends msRestAzure.AzureServiceClient this.credentials = credentials; this.subscriptionId = subscriptionId; - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/commerce/arm-commerce/tsconfig.json b/sdk/commerce/arm-commerce/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/commerce/arm-commerce/tsconfig.json +++ b/sdk/commerce/arm-commerce/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true