diff --git a/sdk/advisor/arm-advisor/README.md b/sdk/advisor/arm-advisor/README.md index 6e851c5fd17e..4fbf83c05bc9 100644 --- a/sdk/advisor/arm-advisor/README.md +++ b/sdk/advisor/arm-advisor/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-advisor ### How to use -#### nodejs - Authentication, client creation and get recommendationMetadata as an example written in TypeScript. +#### nodejs - client creation and get recommendationMetadata as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { AdvisorManagementClient, AdvisorManagementModels, AdvisorManagementMappers } from "@azure/arm-advisor"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { AdvisorManagementClient } = require("@azure/arm-advisor"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/advisor/arm-advisor/rollup.config.js b/sdk/advisor/arm-advisor/rollup.config.js index 6d406ff2ce84..cdfbdf3becf5 100644 --- a/sdk/advisor/arm-advisor/rollup.config.js +++ b/sdk/advisor/arm-advisor/rollup.config.js @@ -21,8 +21,8 @@ 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. diff --git a/sdk/advisor/arm-advisor/src/advisorManagementClient.ts b/sdk/advisor/arm-advisor/src/advisorManagementClient.ts index a1de4884947a..a36889be7f7e 100644 --- a/sdk/advisor/arm-advisor/src/advisorManagementClient.ts +++ b/sdk/advisor/arm-advisor/src/advisorManagementClient.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/advisor/arm-advisor/src/advisorManagementClientContext.ts b/sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts index e75f0e19b91c..cd431215e56c 100644 --- a/sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts +++ b/sdk/advisor/arm-advisor/src/advisorManagementClientContext.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/advisor/arm-advisor/src/models/configurationsMappers.ts b/sdk/advisor/arm-advisor/src/models/configurationsMappers.ts index ff165cd05db1..2a18552a170b 100644 --- a/sdk/advisor/arm-advisor/src/models/configurationsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/configurationsMappers.ts @@ -1,6 +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 regenerated. diff --git a/sdk/advisor/arm-advisor/src/models/index.ts b/sdk/advisor/arm-advisor/src/models/index.ts index aef287075a97..ab680f690123 100644 --- a/sdk/advisor/arm-advisor/src/models/index.ts +++ b/sdk/advisor/arm-advisor/src/models/index.ts @@ -1,6 +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 regenerated. @@ -288,6 +288,11 @@ export interface SuppressionContract extends Resource { * The duration for which the suppression is valid. */ ttl?: string; + /** + * Gets or sets the expiration time stamp. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly expirationTimeStamp?: Date; } /** @@ -295,7 +300,31 @@ export interface SuppressionContract extends Resource { */ export interface RecommendationsListOptionalParams extends msRest.RequestOptionsBase { /** - * The filter to apply to the recommendations. + * The filter to apply to the recommendations.
Filter can be applied to properties + * ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with + * operators ['eq', 'and', 'or'].
Example:
- $filter=Category eq 'Cost' and ResourceGroup + * eq 'MyResourceGroup' + */ + filter?: string; + /** + * The number of recommendations per page if a paged version of this API is being used. + */ + top?: number; + /** + * The page-continuation token to use with a paged version of this API. + */ + skipToken?: string; +} + +/** + * Optional Parameters. + */ +export interface RecommendationsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The filter to apply to the recommendations.
Filter can be applied to properties + * ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with + * operators ['eq', 'and', 'or'].
Example:
- $filter=Category eq 'Cost' and ResourceGroup + * eq 'MyResourceGroup' */ filter?: string; /** @@ -322,6 +351,20 @@ export interface SuppressionsListOptionalParams extends msRest.RequestOptionsBas skipToken?: string; } +/** + * Optional Parameters. + */ +export interface SuppressionsListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The number of suppressions per page if a paged version of this API is being used. + */ + top?: number; + /** + * The page-continuation token to use with a paged version of this API. + */ + skipToken?: string; +} + /** * An interface representing AdvisorManagementClientOptions. */ @@ -736,7 +779,12 @@ export type OperationsListNextResponse = OperationEntityListResult & { /** * Contains response data for the get operation. */ -export type SuppressionsGetResponse = SuppressionContract & { +export type SuppressionsGetResponse = { + /** + * The parsed response body. + */ + body: any; + /** * The underlying HTTP response. */ @@ -749,7 +797,7 @@ export type SuppressionsGetResponse = SuppressionContract & { /** * The response body as parsed JSON or XML */ - parsedBody: SuppressionContract; + parsedBody: any; }; }; diff --git a/sdk/advisor/arm-advisor/src/models/mappers.ts b/sdk/advisor/arm-advisor/src/models/mappers.ts index 38a96c10028f..85eeb1efc55c 100644 --- a/sdk/advisor/arm-advisor/src/models/mappers.ts +++ b/sdk/advisor/arm-advisor/src/models/mappers.ts @@ -1,6 +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 regenerated. @@ -477,6 +477,13 @@ export const SuppressionContract: msRest.CompositeMapper = { type: { name: "String" } + }, + expirationTimeStamp: { + readOnly: true, + serializedName: "properties.expirationTimeStamp", + type: { + name: "DateTime" + } } } } diff --git a/sdk/advisor/arm-advisor/src/models/operationsMappers.ts b/sdk/advisor/arm-advisor/src/models/operationsMappers.ts index c83dbeabcc21..a0ef9f388153 100644 --- a/sdk/advisor/arm-advisor/src/models/operationsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/operationsMappers.ts @@ -1,6 +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 regenerated. diff --git a/sdk/advisor/arm-advisor/src/models/parameters.ts b/sdk/advisor/arm-advisor/src/models/parameters.ts index 0a32fd06e64c..f8d55f35b336 100644 --- a/sdk/advisor/arm-advisor/src/models/parameters.ts +++ b/sdk/advisor/arm-advisor/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/advisor/arm-advisor/src/models/recommendationMetadataMappers.ts b/sdk/advisor/arm-advisor/src/models/recommendationMetadataMappers.ts index fca081125f33..29ec170f821e 100644 --- a/sdk/advisor/arm-advisor/src/models/recommendationMetadataMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/recommendationMetadataMappers.ts @@ -1,6 +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 regenerated. diff --git a/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts b/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts index d4cb0dcd832b..aaa0f5036e61 100644 --- a/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts @@ -1,6 +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 regenerated. diff --git a/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts b/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts index b15519119bc5..601e8daa228d 100644 --- a/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts +++ b/sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts @@ -1,12 +1,13 @@ /* - * 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. */ export { + ARMErrorResponseBody, BaseResource, CloudError, ConfigData, diff --git a/sdk/advisor/arm-advisor/src/operations/configurations.ts b/sdk/advisor/arm-advisor/src/operations/configurations.ts index 9ea34dae1bff..787b3a58968d 100644 --- a/sdk/advisor/arm-advisor/src/operations/configurations.ts +++ b/sdk/advisor/arm-advisor/src/operations/configurations.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 @@ -292,6 +291,9 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/advisor/arm-advisor/src/operations/index.ts b/sdk/advisor/arm-advisor/src/operations/index.ts index 1b2399089695..bef23b04223a 100644 --- a/sdk/advisor/arm-advisor/src/operations/index.ts +++ b/sdk/advisor/arm-advisor/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/advisor/arm-advisor/src/operations/operations.ts b/sdk/advisor/arm-advisor/src/operations/operations.ts index 8dccfa50fbeb..8d629d815cc5 100644 --- a/sdk/advisor/arm-advisor/src/operations/operations.ts +++ b/sdk/advisor/arm-advisor/src/operations/operations.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 @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/advisor/arm-advisor/src/operations/recommendationMetadata.ts b/sdk/advisor/arm-advisor/src/operations/recommendationMetadata.ts index 487abe86bdca..da7dd0a60835 100644 --- a/sdk/advisor/arm-advisor/src/operations/recommendationMetadata.ts +++ b/sdk/advisor/arm-advisor/src/operations/recommendationMetadata.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 @@ -162,6 +161,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/advisor/arm-advisor/src/operations/recommendations.ts b/sdk/advisor/arm-advisor/src/operations/recommendations.ts index 8ab48e349ad8..12d2ef7f9cd7 100644 --- a/sdk/advisor/arm-advisor/src/operations/recommendations.ts +++ b/sdk/advisor/arm-advisor/src/operations/recommendations.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 @@ -152,7 +151,7 @@ export class Recommendations { * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.RecommendationsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -163,8 +162,8 @@ export class Recommendations { * @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, options: Models.RecommendationsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.RecommendationsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -194,7 +193,8 @@ const generateOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.RecommendationsGenerateHeaders }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.CloudError, + headersMapper: Mappers.RecommendationsGenerateHeaders } }, serializer @@ -280,6 +280,12 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/advisor/arm-advisor/src/operations/suppressions.ts b/sdk/advisor/arm-advisor/src/operations/suppressions.ts index e0ac5c30e4b7..5fa21fd6f752 100644 --- a/sdk/advisor/arm-advisor/src/operations/suppressions.ts +++ b/sdk/advisor/arm-advisor/src/operations/suppressions.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 @@ -43,7 +42,7 @@ export class Suppressions { * @param name The name of the suppression. * @param callback The callback */ - get(resourceUri: string, recommendationId: string, name: string, callback: msRest.ServiceCallback): void; + get(resourceUri: string, recommendationId: string, name: string, callback: msRest.ServiceCallback): void; /** * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to * which the recommendation applies. @@ -52,8 +51,8 @@ export class Suppressions { * @param options The optional parameters * @param callback The callback */ - get(resourceUri: string, recommendationId: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceUri: string, recommendationId: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get(resourceUri: string, recommendationId: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceUri: string, recommendationId: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceUri, @@ -182,7 +181,7 @@ export class Suppressions { * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.SuppressionsListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -193,8 +192,8 @@ export class Suppressions { * @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, options: Models.SuppressionsListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.SuppressionsListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -225,6 +224,9 @@ const getOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.SuppressionContract }, + 404: { + bodyMapper: Mappers.ARMErrorResponseBody + }, default: { bodyMapper: Mappers.CloudError } @@ -319,6 +321,11 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.skipToken + ], headerParameters: [ Parameters.acceptLanguage ],