Skip to content

Commit

Permalink
CodeGen from PR 12020 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 72c25a709f306216ad670282e6b27e66363b1165 into 7b34c62199a8d84f7252dcb8b08c1b593ae65124
  • Loading branch information
SDKAuto committed Dec 10, 2020
1 parent 6c6ce54 commit 4f106f9
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 66 deletions.
9 changes: 4 additions & 5 deletions sdk/advisor/arm-advisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions sdk/advisor/arm-advisor/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions sdk/advisor/arm-advisor/src/advisorManagementClient.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions sdk/advisor/arm-advisor/src/advisorManagementClientContext.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions sdk/advisor/arm-advisor/src/models/configurationsMappers.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
67 changes: 60 additions & 7 deletions sdk/advisor/arm-advisor/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -288,14 +288,43 @@ 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;
}

/**
* Optional Parameters.
*/
export interface RecommendationsListOptionalParams extends msRest.RequestOptionsBase {
/**
* The filter to apply to the recommendations.
* The filter to apply to the recommendations.<br>Filter can be applied to properties
* ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with
* operators ['eq', 'and', 'or'].<br>Example:<br>- $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.<br>Filter can be applied to properties
* ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', '[Category](#category)'] with
* operators ['eq', 'and', 'or'].<br>Example:<br>- $filter=Category eq 'Cost' and ResourceGroup
* eq 'MyResourceGroup'
*/
filter?: string;
/**
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand All @@ -749,14 +797,19 @@ export type SuppressionsGetResponse = SuppressionContract & {
/**
* The response body as parsed JSON or XML
*/
parsedBody: SuppressionContract;
parsedBody: any;
};
};

/**
* Contains response data for the create operation.
*/
export type SuppressionsCreateResponse = SuppressionContract & {
export type SuppressionsCreateResponse = {
/**
* The parsed response body.
*/
body: any;

/**
* The underlying HTTP response.
*/
Expand All @@ -769,7 +822,7 @@ export type SuppressionsCreateResponse = SuppressionContract & {
/**
* The response body as parsed JSON or XML
*/
parsedBody: SuppressionContract;
parsedBody: any;
};
};

Expand Down
11 changes: 9 additions & 2 deletions sdk/advisor/arm-advisor/src/models/mappers.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -477,6 +477,13 @@ export const SuppressionContract: msRest.CompositeMapper = {
type: {
name: "String"
}
},
expirationTimeStamp: {
readOnly: true,
serializedName: "properties.expirationTimeStamp",
type: {
name: "DateTime"
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/advisor/arm-advisor/src/models/operationsMappers.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 2 additions & 3 deletions sdk/advisor/arm-advisor/src/models/parameters.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions sdk/advisor/arm-advisor/src/models/recommendationsMappers.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 4 additions & 2 deletions sdk/advisor/arm-advisor/src/models/suppressionsMappers.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/*
* 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 {
ArmErrorResponse,
ARMErrorResponseBody,
BaseResource,
CloudError,
ConfigData,
Expand Down
8 changes: 5 additions & 3 deletions sdk/advisor/arm-advisor/src/operations/configurations.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -292,6 +291,9 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = {
urlParameters: [
Parameters.nextPageLink
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
Expand Down
5 changes: 2 additions & 3 deletions sdk/advisor/arm-advisor/src/operations/index.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 5 additions & 3 deletions sdk/advisor/arm-advisor/src/operations/operations.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = {
urlParameters: [
Parameters.nextPageLink
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -162,6 +161,9 @@ const listNextOperationSpec: msRest.OperationSpec = {
urlParameters: [
Parameters.nextPageLink
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
Expand Down
20 changes: 13 additions & 7 deletions sdk/advisor/arm-advisor/src/operations/recommendations.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -152,7 +151,7 @@ export class Recommendations {
* @param [options] The optional parameters
* @returns Promise<Models.RecommendationsListNextResponse>
*/
listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.RecommendationsListNextResponse>;
listNext(nextPageLink: string, options?: Models.RecommendationsListNextOptionalParams): Promise<Models.RecommendationsListNextResponse>;
/**
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param callback The callback
Expand All @@ -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<Models.ResourceRecommendationBaseListResult>): void;
listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ResourceRecommendationBaseListResult>, callback?: msRest.ServiceCallback<Models.ResourceRecommendationBaseListResult>): Promise<Models.RecommendationsListNextResponse> {
listNext(nextPageLink: string, options: Models.RecommendationsListNextOptionalParams, callback: msRest.ServiceCallback<Models.ResourceRecommendationBaseListResult>): void;
listNext(nextPageLink: string, options?: Models.RecommendationsListNextOptionalParams | msRest.ServiceCallback<Models.ResourceRecommendationBaseListResult>, callback?: msRest.ServiceCallback<Models.ResourceRecommendationBaseListResult>): Promise<Models.RecommendationsListNextResponse> {
return this.client.sendOperationRequest(
{
nextPageLink,
Expand Down Expand Up @@ -194,7 +193,8 @@ const generateOperationSpec: msRest.OperationSpec = {
headersMapper: Mappers.RecommendationsGenerateHeaders
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.CloudError,
headersMapper: Mappers.RecommendationsGenerateHeaders
}
},
serializer
Expand Down Expand Up @@ -280,6 +280,12 @@ const listNextOperationSpec: msRest.OperationSpec = {
urlParameters: [
Parameters.nextPageLink
],
queryParameters: [
Parameters.apiVersion,
Parameters.filter,
Parameters.top,
Parameters.skipToken
],
headerParameters: [
Parameters.acceptLanguage
],
Expand Down
Loading

0 comments on commit 4f106f9

Please sign in to comment.