diff --git a/sdk/advisor/arm-advisor/LICENSE.txt b/sdk/advisor/arm-advisor/LICENSE.txt new file mode 100644 index 000000000000..8f3d856145c5 --- /dev/null +++ b/sdk/advisor/arm-advisor/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/advisor/arm-advisor/README.md b/sdk/advisor/arm-advisor/README.md new file mode 100644 index 000000000000..ffbaf450e150 --- /dev/null +++ b/sdk/advisor/arm-advisor/README.md @@ -0,0 +1,96 @@ +## Azure AdvisorManagementClient SDK for JavaScript + +This package contains an isomorphic SDK for AdvisorManagementClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-advisor +``` + +### How to use + +#### nodejs - Authentication, client creation and listBySubscription configurations as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +```bash +npm install @azure/ms-rest-nodeauth +``` + +##### Sample code + +```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 subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new AdvisorManagementClient(creds, subscriptionId); + client.configurations.listBySubscription().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and listBySubscription configurations as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-advisor sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/sdk/advisor/arm-advisor/lib/advisorManagementClient.ts b/sdk/advisor/arm-advisor/lib/advisorManagementClient.ts new file mode 100644 index 000000000000..643eaf226574 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/advisorManagementClient.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { AdvisorManagementClientContext } from "./advisorManagementClientContext"; + + +class AdvisorManagementClient extends AdvisorManagementClientContext { + // Operation groups + configurations: operations.Configurations; + recommendations: operations.Recommendations; + operations: operations.Operations; + suppressions: operations.Suppressions; + + /** + * Initializes a new instance of the AdvisorManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AdvisorManagementClientOptions) { + super(credentials, subscriptionId, options); + this.configurations = new operations.Configurations(this); + this.recommendations = new operations.Recommendations(this); + this.operations = new operations.Operations(this); + this.suppressions = new operations.Suppressions(this); + } +} + +// Operation Specifications + +export { + AdvisorManagementClient, + AdvisorManagementClientContext, + Models as AdvisorManagementModels, + Mappers as AdvisorManagementMappers +}; +export * from "./operations"; diff --git a/sdk/advisor/arm-advisor/lib/advisorManagementClientContext.ts b/sdk/advisor/arm-advisor/lib/advisorManagementClientContext.ts new file mode 100644 index 000000000000..db1466619c1d --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/advisorManagementClientContext.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-advisor"; +const packageVersion = "1.2.0"; + +export class AdvisorManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the AdvisorManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AdvisorManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2017-04-19'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/advisor/arm-advisor/lib/models/configurationsMappers.ts b/sdk/advisor/arm-advisor/lib/models/configurationsMappers.ts new file mode 100644 index 000000000000..7e0bc956ab06 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/models/configurationsMappers.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + ConfigurationListResult, + ConfigData, + ConfigDataProperties, + CloudError, + ARMErrorResponseBody +} from "../models/mappers"; + diff --git a/sdk/advisor/arm-advisor/lib/models/index.ts b/sdk/advisor/arm-advisor/lib/models/index.ts new file mode 100644 index 000000000000..21d9a82bd89e --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/models/index.ts @@ -0,0 +1,698 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing ConfigDataProperties. + * The list of property name/value pairs. + * + */ +export interface ConfigDataProperties { + /** + * @member {boolean} [exclude] Exclude the resource from Advisor evaluations. + * Valid values: False (default) or True. + */ + exclude?: boolean; + /** + * @member {string} [lowCpuThreshold] Minimum percentage threshold for + * Advisor low CPU utilization evaluation. Valid only for subscriptions. + * Valid values: 5 (default), 10, 15 or 20. + */ + lowCpuThreshold?: string; + /** + * @property Describes unknown properties. The value of an unknown property + * can be of "any" type. + */ + [property: string]: any; +} + +/** + * @interface + * An interface representing ConfigData. + * The Advisor configuration data structure. + * + */ +export interface ConfigData { + /** + * @member {string} [id] The resource Id of the configuration resource. + */ + id?: string; + /** + * @member {string} [type] The type of the configuration resource. + */ + type?: string; + /** + * @member {string} [name] The name of the configuration resource. + */ + name?: string; + /** + * @member {ConfigDataProperties} [properties] The list of property + * name/value pairs. + */ + properties?: ConfigDataProperties; +} + +/** + * @interface + * An interface representing ARMErrorResponseBody. + * ARM error response body. + * + */ +export interface ARMErrorResponseBody { + /** + * @member {string} [message] Gets or sets the string that describes the + * error in detail and provides debugging information. + */ + message?: string; + /** + * @member {string} [code] Gets or sets the string that can be used to + * programmatically identify the error. + */ + code?: string; +} + +/** + * @interface + * An interface representing ShortDescription. + * A summary of the recommendation. + * + */ +export interface ShortDescription { + /** + * @member {string} [problem] The issue or opportunity identified by the + * recommendation. + */ + problem?: string; + /** + * @member {string} [solution] The remediation action suggested by the + * recommendation. + */ + solution?: string; +} + +/** + * @interface + * An interface representing Resource. + * An Azure resource. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] The resource ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing ResourceRecommendationBase. + * Advisor Recommendation. + * + * @extends Resource + */ +export interface ResourceRecommendationBase extends Resource { + /** + * @member {Category} [category] The category of the recommendation. Possible + * values include: 'HighAvailability', 'Security', 'Performance', 'Cost' + */ + category?: Category; + /** + * @member {Impact} [impact] The business impact of the recommendation. + * Possible values include: 'High', 'Medium', 'Low' + */ + impact?: Impact; + /** + * @member {string} [impactedField] The resource type identified by Advisor. + */ + impactedField?: string; + /** + * @member {string} [impactedValue] The resource identified by Advisor. + */ + impactedValue?: string; + /** + * @member {Date} [lastUpdated] The most recent time that Advisor checked the + * validity of the recommendation. + */ + lastUpdated?: Date; + /** + * @member {{ [propertyName: string]: any }} [metadata] The recommendation + * metadata. + */ + metadata?: { [propertyName: string]: any }; + /** + * @member {string} [recommendationTypeId] The recommendation-type GUID. + */ + recommendationTypeId?: string; + /** + * @member {Risk} [risk] The potential risk of not implementing the + * recommendation. Possible values include: 'Error', 'Warning', 'None' + */ + risk?: Risk; + /** + * @member {ShortDescription} [shortDescription] A summary of the + * recommendation. + */ + shortDescription?: ShortDescription; + /** + * @member {string[]} [suppressionIds] The list of snoozed and dismissed + * rules for the recommendation. + */ + suppressionIds?: string[]; + /** + * @member {{ [propertyName: string]: string }} [extendedProperties] Extended + * properties + */ + extendedProperties?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing OperationDisplayInfo. + * The operation supported by Advisor. + * + */ +export interface OperationDisplayInfo { + /** + * @member {string} [description] The description of the operation. + */ + description?: string; + /** + * @member {string} [operation] The action that users can perform, based on + * their permission level. + */ + operation?: string; + /** + * @member {string} [provider] Service provider: Microsoft Advisor. + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed. + */ + resource?: string; +} + +/** + * @interface + * An interface representing OperationEntity. + * The operation supported by Advisor. + * + */ +export interface OperationEntity { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation}. + */ + name?: string; + /** + * @member {OperationDisplayInfo} [display] The operation supported by + * Advisor. + */ + display?: OperationDisplayInfo; +} + +/** + * @interface + * An interface representing SuppressionContract. + * The details of the snoozed or dismissed rule; for example, the duration, + * name, and GUID associated with the rule. + * + * @extends Resource + */ +export interface SuppressionContract extends Resource { + /** + * @member {string} [suppressionId] The GUID of the suppression. + */ + suppressionId?: string; + /** + * @member {string} [ttl] The duration for which the suppression is valid. + */ + ttl?: string; +} + +/** + * @interface + * An interface representing RecommendationsListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface RecommendationsListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [filter] The filter to apply to the recommendations. + */ + filter?: string; + /** + * @member {number} [top] The number of recommendations per page if a paged + * version of this API is being used. + */ + top?: number; + /** + * @member {string} [skipToken] The page-continuation token to use with a + * paged version of this API. + */ + skipToken?: string; +} + +/** + * @interface + * An interface representing SuppressionsListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface SuppressionsListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [top] The number of suppressions per page if a paged + * version of this API is being used. + */ + top?: number; + /** + * @member {string} [skipToken] The page-continuation token to use with a + * paged version of this API. + */ + skipToken?: string; +} + +/** + * @interface + * An interface representing AdvisorManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface AdvisorManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + +/** + * @interface + * An interface representing RecommendationsGenerateHeaders. + * Defines headers for Generate operation. + * + */ +export interface RecommendationsGenerateHeaders { + /** + * @member {string} [location] The URL where the status of the asynchronous + * operation can be checked. + */ + location: string; + /** + * @member {string} [retryAfter] The amount of delay to use while the status + * of the operation is checked. The value is expressed in seconds. + */ + retryAfter: string; +} + + +/** + * @interface + * An interface representing the ConfigurationListResult. + * The list of Advisor configurations. + * + * @extends Array + */ +export interface ConfigurationListResult extends Array { + /** + * @member {string} [nextLink] The link used to get the next page of + * configurations. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ResourceRecommendationBaseListResult. + * The list of Advisor recommendations. + * + * @extends Array + */ +export interface ResourceRecommendationBaseListResult extends Array { + /** + * @member {string} [nextLink] The link used to get the next page of + * recommendations. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the OperationEntityListResult. + * The list of Advisor operations. + * + * @extends Array + */ +export interface OperationEntityListResult extends Array { + /** + * @member {string} [nextLink] The link used to get the next page of + * operations. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the SuppressionContractListResult. + * The list of Advisor suppressions. + * + * @extends Array + */ +export interface SuppressionContractListResult extends Array { + /** + * @member {string} [nextLink] The link used to get the next page of + * suppressions. + */ + nextLink?: string; +} + +/** + * Defines values for Category. + * Possible values include: 'HighAvailability', 'Security', 'Performance', 'Cost' + * @readonly + * @enum {string} + */ +export type Category = 'HighAvailability' | 'Security' | 'Performance' | 'Cost'; + +/** + * Defines values for Impact. + * Possible values include: 'High', 'Medium', 'Low' + * @readonly + * @enum {string} + */ +export type Impact = 'High' | 'Medium' | 'Low'; + +/** + * Defines values for Risk. + * Possible values include: 'Error', 'Warning', 'None' + * @readonly + * @enum {string} + */ +export type Risk = 'Error' | 'Warning' | 'None'; + +/** + * Contains response data for the listBySubscription operation. + */ +export type ConfigurationsListBySubscriptionResponse = ConfigurationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConfigurationListResult; + }; +}; + +/** + * Contains response data for the createInSubscription operation. + */ +export type ConfigurationsCreateInSubscriptionResponse = ARMErrorResponseBody & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ARMErrorResponseBody; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type ConfigurationsListByResourceGroupResponse = ConfigurationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConfigurationListResult; + }; +}; + +/** + * Contains response data for the createInResourceGroup operation. + */ +export type ConfigurationsCreateInResourceGroupResponse = ARMErrorResponseBody & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ARMErrorResponseBody; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type ConfigurationsListBySubscriptionNextResponse = ConfigurationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConfigurationListResult; + }; +}; + +/** + * Contains response data for the generate operation. + */ +export type RecommendationsGenerateResponse = RecommendationsGenerateHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: RecommendationsGenerateHeaders; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type RecommendationsListResponse = ResourceRecommendationBaseListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceRecommendationBaseListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type RecommendationsGetResponse = ResourceRecommendationBase & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceRecommendationBase; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type RecommendationsListNextResponse = ResourceRecommendationBaseListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceRecommendationBaseListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationEntityListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationEntityListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationEntityListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationEntityListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type SuppressionsGetResponse = SuppressionContract & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SuppressionContract; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type SuppressionsCreateResponse = SuppressionContract & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SuppressionContract; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type SuppressionsListResponse = SuppressionContractListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SuppressionContractListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type SuppressionsListNextResponse = SuppressionContractListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: SuppressionContractListResult; + }; +}; diff --git a/sdk/advisor/arm-advisor/lib/models/mappers.ts b/sdk/advisor/arm-advisor/lib/models/mappers.ts new file mode 100644 index 000000000000..ffd0fb954f60 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/models/mappers.ts @@ -0,0 +1,464 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const ConfigDataProperties: msRest.CompositeMapper = { + serializedName: "ConfigData_properties", + type: { + name: "Composite", + className: "ConfigDataProperties", + modelProperties: { + exclude: { + serializedName: "exclude", + type: { + name: "Boolean" + } + }, + lowCpuThreshold: { + serializedName: "low_cpu_threshold", + type: { + name: "String" + } + } + }, + additionalProperties: { + type: { + name: "Object" + } + } + } +}; + +export const ConfigData: msRest.CompositeMapper = { + serializedName: "ConfigData", + type: { + name: "Composite", + className: "ConfigData", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ConfigDataProperties", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + } +}; + +export const ARMErrorResponseBody: msRest.CompositeMapper = { + serializedName: "ARMErrorResponseBody", + type: { + name: "Composite", + className: "ARMErrorResponseBody", + modelProperties: { + message: { + serializedName: "message", + type: { + name: "String" + } + }, + code: { + serializedName: "code", + type: { + name: "String" + } + } + } + } +}; + +export const ShortDescription: msRest.CompositeMapper = { + serializedName: "ShortDescription", + type: { + name: "Composite", + className: "ShortDescription", + modelProperties: { + problem: { + serializedName: "problem", + type: { + name: "String" + } + }, + solution: { + serializedName: "solution", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceRecommendationBase: msRest.CompositeMapper = { + serializedName: "ResourceRecommendationBase", + type: { + name: "Composite", + className: "ResourceRecommendationBase", + modelProperties: { + ...Resource.type.modelProperties, + category: { + serializedName: "properties.category", + type: { + name: "String" + } + }, + impact: { + serializedName: "properties.impact", + type: { + name: "String" + } + }, + impactedField: { + serializedName: "properties.impactedField", + type: { + name: "String" + } + }, + impactedValue: { + serializedName: "properties.impactedValue", + type: { + name: "String" + } + }, + lastUpdated: { + serializedName: "properties.lastUpdated", + type: { + name: "DateTime" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Dictionary", + value: { + type: { + name: "Object" + } + } + } + }, + recommendationTypeId: { + serializedName: "properties.recommendationTypeId", + type: { + name: "String" + } + }, + risk: { + serializedName: "properties.risk", + type: { + name: "String" + } + }, + shortDescription: { + serializedName: "properties.shortDescription", + type: { + name: "Composite", + className: "ShortDescription" + } + }, + suppressionIds: { + serializedName: "properties.suppressionIds", + type: { + name: "Sequence", + element: { + type: { + name: "Uuid" + } + } + } + }, + extendedProperties: { + serializedName: "properties.extendedProperties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const OperationDisplayInfo: msRest.CompositeMapper = { + serializedName: "OperationDisplayInfo", + type: { + name: "Composite", + className: "OperationDisplayInfo", + modelProperties: { + description: { + serializedName: "description", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + } + } + } +}; + +export const OperationEntity: msRest.CompositeMapper = { + serializedName: "OperationEntity", + type: { + name: "Composite", + className: "OperationEntity", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplayInfo" + } + } + } + } +}; + +export const SuppressionContract: msRest.CompositeMapper = { + serializedName: "SuppressionContract", + type: { + name: "Composite", + className: "SuppressionContract", + modelProperties: { + ...Resource.type.modelProperties, + suppressionId: { + serializedName: "properties.suppressionId", + type: { + name: "String" + } + }, + ttl: { + serializedName: "properties.ttl", + type: { + name: "String" + } + } + } + } +}; + +export const RecommendationsGenerateHeaders: msRest.CompositeMapper = { + serializedName: "recommendations-generate-headers", + type: { + name: "Composite", + className: "RecommendationsGenerateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String" + } + } + } + } +}; + +export const ConfigurationListResult: msRest.CompositeMapper = { + serializedName: "ConfigurationListResult", + type: { + name: "Composite", + className: "ConfigurationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConfigData" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceRecommendationBaseListResult: msRest.CompositeMapper = { + serializedName: "ResourceRecommendationBaseListResult", + type: { + name: "Composite", + className: "ResourceRecommendationBaseListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceRecommendationBase" + } + } + } + } + } + } +}; + +export const OperationEntityListResult: msRest.CompositeMapper = { + serializedName: "OperationEntityListResult", + type: { + name: "Composite", + className: "OperationEntityListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationEntity" + } + } + } + } + } + } +}; + +export const SuppressionContractListResult: msRest.CompositeMapper = { + serializedName: "SuppressionContractListResult", + type: { + name: "Composite", + className: "SuppressionContractListResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SuppressionContract" + } + } + } + } + } + } +}; diff --git a/sdk/advisor/arm-advisor/lib/models/operationsMappers.ts b/sdk/advisor/arm-advisor/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..aba5d8bf047b --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/models/operationsMappers.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + OperationEntityListResult, + OperationEntity, + OperationDisplayInfo, + CloudError +} from "../models/mappers"; + diff --git a/sdk/advisor/arm-advisor/lib/models/parameters.ts b/sdk/advisor/arm-advisor/lib/models/parameters.ts new file mode 100644 index 000000000000..4c86c5e6de44 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/models/parameters.ts @@ -0,0 +1,139 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const name: msRest.OperationURLParameter = { + parameterPath: "name", + mapper: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "Uuid" + } + } +}; +export const recommendationId: msRest.OperationURLParameter = { + parameterPath: "recommendationId", + mapper: { + required: true, + serializedName: "recommendationId", + type: { + name: "String" + } + } +}; +export const resourceGroup: msRest.OperationURLParameter = { + parameterPath: "resourceGroup", + mapper: { + required: true, + serializedName: "resourceGroup", + type: { + name: "String" + } + } +}; +export const resourceUri: msRest.OperationURLParameter = { + parameterPath: "resourceUri", + mapper: { + required: true, + serializedName: "resourceUri", + type: { + name: "String" + } + } +}; +export const skipToken: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "skipToken" + ], + mapper: { + serializedName: "$skipToken", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; +export const top: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "top" + ], + mapper: { + serializedName: "$top", + type: { + name: "Number" + } + } +}; diff --git a/sdk/advisor/arm-advisor/lib/models/recommendationsMappers.ts b/sdk/advisor/arm-advisor/lib/models/recommendationsMappers.ts new file mode 100644 index 000000000000..f7c5c9df26b7 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/models/recommendationsMappers.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + RecommendationsGenerateHeaders, + CloudError, + ResourceRecommendationBaseListResult, + ResourceRecommendationBase, + Resource, + BaseResource, + ShortDescription, + SuppressionContract +} from "../models/mappers"; + diff --git a/sdk/advisor/arm-advisor/lib/models/suppressionsMappers.ts b/sdk/advisor/arm-advisor/lib/models/suppressionsMappers.ts new file mode 100644 index 000000000000..dd0d5a4133d7 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/models/suppressionsMappers.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + SuppressionContract, + Resource, + BaseResource, + CloudError, + SuppressionContractListResult, + ResourceRecommendationBase, + ShortDescription +} from "../models/mappers"; + diff --git a/sdk/advisor/arm-advisor/lib/operations/configurations.ts b/sdk/advisor/arm-advisor/lib/operations/configurations.ts new file mode 100644 index 000000000000..91d1ae84a445 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/operations/configurations.ts @@ -0,0 +1,307 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/configurationsMappers"; +import * as Parameters from "../models/parameters"; +import { AdvisorManagementClientContext } from "../advisorManagementClientContext"; + +/** Class representing a Configurations. */ +export class Configurations { + private readonly client: AdvisorManagementClientContext; + + /** + * Create a Configurations. + * @param {AdvisorManagementClientContext} client Reference to the service client. + */ + constructor(client: AdvisorManagementClientContext) { + this.client = client; + } + + /** + * Retrieve Azure Advisor configurations and also retrieve configurations of contained resource + * groups. + * @summary Retrieve Azure Advisor configurations. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Create/Overwrite Azure Advisor configuration and also delete all configurations of contained + * resource groups. + * @summary Create/Overwrite Azure Advisor configuration. + * @param configContract The Azure Advisor configuration data structure. + * @param [options] The optional parameters + * @returns Promise + */ + createInSubscription(configContract: Models.ConfigData, options?: msRest.RequestOptionsBase): Promise; + /** + * @param configContract The Azure Advisor configuration data structure. + * @param callback The callback + */ + createInSubscription(configContract: Models.ConfigData, callback: msRest.ServiceCallback): void; + /** + * @param configContract The Azure Advisor configuration data structure. + * @param options The optional parameters + * @param callback The callback + */ + createInSubscription(configContract: Models.ConfigData, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createInSubscription(configContract: Models.ConfigData, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + configContract, + options + }, + createInSubscriptionOperationSpec, + callback) as Promise; + } + + /** + * @summary Retrieve Azure Advisor configurations. + * @param resourceGroup The name of the Azure resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroup: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroup The name of the Azure resource group. + * @param callback The callback + */ + listByResourceGroup(resourceGroup: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroup The name of the Azure resource group. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroup: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroup: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroup, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * @summary Create/Overwrite Azure Advisor configuration. + * @param configContract The Azure Advisor configuration data structure. + * @param resourceGroup The name of the Azure resource group. + * @param [options] The optional parameters + * @returns Promise + */ + createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param configContract The Azure Advisor configuration data structure. + * @param resourceGroup The name of the Azure resource group. + * @param callback The callback + */ + createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, callback: msRest.ServiceCallback): void; + /** + * @param configContract The Azure Advisor configuration data structure. + * @param resourceGroup The name of the Azure resource group. + * @param options The optional parameters + * @param callback The callback + */ + createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createInResourceGroup(configContract: Models.ConfigData, resourceGroup: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + configContract, + resourceGroup, + options + }, + createInResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Retrieve Azure Advisor configurations and also retrieve configurations of contained resource + * groups. + * @summary Retrieve Azure Advisor configurations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConfigurationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createInSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "configContract", + mapper: { + ...Mappers.ConfigData, + required: true + } + }, + responses: { + 204: {}, + 400: { + bodyMapper: Mappers.ARMErrorResponseBody + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConfigurationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createInResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroup + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "configContract", + mapper: { + ...Mappers.ConfigData, + required: true + } + }, + responses: { + 204: {}, + 400: { + bodyMapper: Mappers.ARMErrorResponseBody + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConfigurationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/advisor/arm-advisor/lib/operations/index.ts b/sdk/advisor/arm-advisor/lib/operations/index.ts new file mode 100644 index 000000000000..0b5134141fb7 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/operations/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./configurations"; +export * from "./recommendations"; +export * from "./operations"; +export * from "./suppressions"; diff --git a/sdk/advisor/arm-advisor/lib/operations/operations.ts b/sdk/advisor/arm-advisor/lib/operations/operations.ts new file mode 100644 index 000000000000..8dccfa50fbeb --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { AdvisorManagementClientContext } from "../advisorManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: AdvisorManagementClientContext; + + /** + * Create a Operations. + * @param {AdvisorManagementClientContext} client Reference to the service client. + */ + constructor(client: AdvisorManagementClientContext) { + this.client = client; + } + + /** + * Lists all the available Advisor REST API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all the available Advisor REST API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Advisor/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationEntityListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationEntityListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/advisor/arm-advisor/lib/operations/recommendations.ts b/sdk/advisor/arm-advisor/lib/operations/recommendations.ts new file mode 100644 index 000000000000..8ab48e349ad8 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/operations/recommendations.ts @@ -0,0 +1,295 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/recommendationsMappers"; +import * as Parameters from "../models/parameters"; +import { AdvisorManagementClientContext } from "../advisorManagementClientContext"; + +/** Class representing a Recommendations. */ +export class Recommendations { + private readonly client: AdvisorManagementClientContext; + + /** + * Create a Recommendations. + * @param {AdvisorManagementClientContext} client Reference to the service client. + */ + constructor(client: AdvisorManagementClientContext) { + this.client = client; + } + + /** + * Initiates the recommendation generation or computation process for a subscription. This + * operation is asynchronous. The generated recommendations are stored in a cache in the Advisor + * service. + * @param [options] The optional parameters + * @returns Promise + */ + generate(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + generate(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + generate(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + generate(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + generateOperationSpec, + callback) as Promise; + } + + /** + * Retrieves the status of the recommendation computation or generation process. Invoke this API + * after calling the generation recommendation. The URI of this API is returned in the Location + * field of the response header. + * @param operationId The operation ID, which can be found from the Location field in the generate + * recommendation response header. + * @param [options] The optional parameters + * @returns Promise + */ + getGenerateStatus(operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param operationId The operation ID, which can be found from the Location field in the generate + * recommendation response header. + * @param callback The callback + */ + getGenerateStatus(operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param operationId The operation ID, which can be found from the Location field in the generate + * recommendation response header. + * @param options The optional parameters + * @param callback The callback + */ + getGenerateStatus(operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getGenerateStatus(operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + operationId, + options + }, + getGenerateStatusOperationSpec, + callback); + } + + /** + * Obtains cached recommendations for a subscription. The recommendations are generated or computed + * by invoking generateRecommendations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.RecommendationsListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.RecommendationsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.RecommendationsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Obtains details of a cached recommendation. + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceUri: string, recommendationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param callback The callback + */ + get(resourceUri: string, recommendationId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceUri: string, recommendationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceUri: string, recommendationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceUri, + recommendationId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Obtains cached recommendations for a subscription. The recommendations are generated or computed + * by invoking generateRecommendations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const generateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: { + headersMapper: Mappers.RecommendationsGenerateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getGenerateStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.operationId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.top, + Parameters.skipToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceRecommendationBaseListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}", + urlParameters: [ + Parameters.resourceUri, + Parameters.recommendationId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceRecommendationBase + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceRecommendationBaseListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/advisor/arm-advisor/lib/operations/suppressions.ts b/sdk/advisor/arm-advisor/lib/operations/suppressions.ts new file mode 100644 index 000000000000..e0ac5c30e4b7 --- /dev/null +++ b/sdk/advisor/arm-advisor/lib/operations/suppressions.ts @@ -0,0 +1,334 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/suppressionsMappers"; +import * as Parameters from "../models/parameters"; +import { AdvisorManagementClientContext } from "../advisorManagementClientContext"; + +/** Class representing a Suppressions. */ +export class Suppressions { + private readonly client: AdvisorManagementClientContext; + + /** + * Create a Suppressions. + * @param {AdvisorManagementClientContext} client Reference to the service client. + */ + constructor(client: AdvisorManagementClientContext) { + this.client = client; + } + + /** + * Obtains the details of a suppression. + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceUri: string, recommendationId: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param callback The callback + */ + 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. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @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 { + return this.client.sendOperationRequest( + { + resourceUri, + recommendationId, + name, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Enables the snoozed or dismissed attribute of a recommendation. The snoozed or dismissed + * attribute is referred to as a suppression. Use this API to create or update the snoozed or + * dismissed status of a recommendation. + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param suppressionContract The snoozed or dismissed attribute; for example, the snooze duration. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceUri: string, recommendationId: string, name: string, suppressionContract: Models.SuppressionContract, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param suppressionContract The snoozed or dismissed attribute; for example, the snooze duration. + * @param callback The callback + */ + create(resourceUri: string, recommendationId: string, name: string, suppressionContract: Models.SuppressionContract, callback: msRest.ServiceCallback): void; + /** + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param suppressionContract The snoozed or dismissed attribute; for example, the snooze duration. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceUri: string, recommendationId: string, name: string, suppressionContract: Models.SuppressionContract, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(resourceUri: string, recommendationId: string, name: string, suppressionContract: Models.SuppressionContract, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceUri, + recommendationId, + name, + suppressionContract, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Enables the activation of a snoozed or dismissed recommendation. The snoozed or dismissed + * attribute of a recommendation is referred to as a suppression. + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceUri: string, recommendationId: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceUri The fully qualified Azure Resource Manager identifier of the resource to + * which the recommendation applies. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param callback The callback + */ + deleteMethod(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. + * @param recommendationId The recommendation ID. + * @param name The name of the suppression. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceUri: string, recommendationId: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceUri: string, recommendationId: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceUri, + recommendationId, + name, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Retrieves the list of snoozed or dismissed suppressions for a subscription. The snoozed or + * dismissed attribute of a recommendation is referred to as a suppression. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: Models.SuppressionsListOptionalParams): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: Models.SuppressionsListOptionalParams, callback: msRest.ServiceCallback): void; + list(options?: Models.SuppressionsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Retrieves the list of snoozed or dismissed suppressions for a subscription. The snoozed or + * dismissed attribute of a recommendation is referred to as a suppression. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}", + urlParameters: [ + Parameters.resourceUri, + Parameters.recommendationId, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SuppressionContract + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}", + urlParameters: [ + Parameters.resourceUri, + Parameters.recommendationId, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "suppressionContract", + mapper: { + ...Mappers.SuppressionContract, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SuppressionContract + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}", + urlParameters: [ + Parameters.resourceUri, + Parameters.recommendationId, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.top, + Parameters.skipToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SuppressionContractListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SuppressionContractListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/advisor/arm-advisor/package.json b/sdk/advisor/arm-advisor/package.json new file mode 100644 index 000000000000..7abd93538567 --- /dev/null +++ b/sdk/advisor/arm-advisor/package.json @@ -0,0 +1,56 @@ +{ + "name": "@azure/arm-advisor", + "author": "Microsoft Corporation", + "description": "AdvisorManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.2.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-advisor.js", + "module": "./esm/advisorManagementClient.js", + "types": "./esm/advisorManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "lib/**/*.ts", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-advisor.js.map'\" -o ./dist/arm-advisor.min.js ./dist/arm-advisor.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false +} diff --git a/sdk/advisor/arm-advisor/rollup.config.js b/sdk/advisor/arm-advisor/rollup.config.js new file mode 100644 index 000000000000..fcf77258b920 --- /dev/null +++ b/sdk/advisor/arm-advisor/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/advisorManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-advisor.js", + format: "umd", + name: "Azure.ArmAdvisor", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@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. + * + * 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 }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/advisor/arm-advisor/tsconfig.json b/sdk/advisor/arm-advisor/tsconfig.json new file mode 100644 index 000000000000..51ea90961ce5 --- /dev/null +++ b/sdk/advisor/arm-advisor/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*.ts"], + "exclude": ["node_modules"] +}