From 847fdd770834d5cae0d389cd084db3e4eda6849f Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 12 Dec 2019 22:26:15 +0000 Subject: [PATCH] Generated from 470fcf4a60cffee7a99bad7bbee218fdbf7c4056 Adding a stable 2019-12-01 API version for licenses. --- sdk/softwareplan/arm-softwareplan/LICENSE.txt | 21 + sdk/softwareplan/arm-softwareplan/README.md | 103 +++++ .../arm-softwareplan/package.json | 58 +++ .../arm-softwareplan/rollup.config.js | 37 ++ .../src/models/hybridUseBenefitMappers.ts | 19 + .../models/hybridUseBenefitRevisionMappers.ts | 19 + .../arm-softwareplan/src/models/index.ts | 398 ++++++++++++++++++ .../arm-softwareplan/src/models/mappers.ts | 306 ++++++++++++++ .../src/models/operationsMappers.ts | 14 + .../arm-softwareplan/src/models/parameters.ts | 88 ++++ .../src/models/softwarePlanMappers.ts | 11 + .../src/operations/hybridUseBenefit.ts | 391 +++++++++++++++++ .../operations/hybridUseBenefitRevision.ts | 138 ++++++ .../arm-softwareplan/src/operations/index.ts | 14 + .../src/operations/operations.ts | 135 ++++++ .../src/operations/softwarePlan.ts | 74 ++++ .../src/softwareplanClient.ts | 48 +++ .../src/softwareplanClientContext.ts | 62 +++ .../arm-softwareplan/tsconfig.json | 19 + 19 files changed, 1955 insertions(+) create mode 100644 sdk/softwareplan/arm-softwareplan/LICENSE.txt create mode 100644 sdk/softwareplan/arm-softwareplan/README.md create mode 100644 sdk/softwareplan/arm-softwareplan/package.json create mode 100644 sdk/softwareplan/arm-softwareplan/rollup.config.js create mode 100644 sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitMappers.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitRevisionMappers.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/models/index.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/models/mappers.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/models/operationsMappers.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/models/parameters.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/models/softwarePlanMappers.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefit.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefitRevision.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/operations/index.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/operations/operations.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/operations/softwarePlan.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/softwareplanClient.ts create mode 100644 sdk/softwareplan/arm-softwareplan/src/softwareplanClientContext.ts create mode 100644 sdk/softwareplan/arm-softwareplan/tsconfig.json diff --git a/sdk/softwareplan/arm-softwareplan/LICENSE.txt b/sdk/softwareplan/arm-softwareplan/LICENSE.txt new file mode 100644 index 000000000000..b73b4a1293c3 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/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/softwareplan/arm-softwareplan/README.md b/sdk/softwareplan/arm-softwareplan/README.md new file mode 100644 index 000000000000..58724e3519c2 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/README.md @@ -0,0 +1,103 @@ +## Azure SoftwareplanClient SDK for JavaScript + +This package contains an isomorphic SDK for SoftwareplanClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-softwareplan +``` + +### How to use + +#### nodejs - Authentication, client creation and list hybridUseBenefit as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" +``` + +##### 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 { SoftwareplanClient, SoftwareplanModels, SoftwareplanMappers } from "@azure/arm-softwareplan"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new SoftwareplanClient(creds, subscriptionId); + const scope = "testscope"; + const filter = "testfilter"; + client.hybridUseBenefit.list(scope, filter).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list hybridUseBenefit 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-softwareplan sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/softwareplan/arm-softwareplan/README.png) diff --git a/sdk/softwareplan/arm-softwareplan/package.json b/sdk/softwareplan/arm-softwareplan/package.json new file mode 100644 index 000000000000..d8137a0de29a --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-softwareplan", + "author": "Microsoft Corporation", + "description": "SoftwareplanClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-softwareplan.js", + "module": "./esm/softwareplanClient.js", + "types": "./esm/softwareplanClient.d.ts", + "devDependencies": { + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/softwareplan/arm-softwareplan", + "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", + "src/**/*.ts", + "README.md", + "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-softwareplan.js.map'\" -o ./dist/arm-softwareplan.min.js ./dist/arm-softwareplan.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/softwareplan/arm-softwareplan/rollup.config.js b/sdk/softwareplan/arm-softwareplan/rollup.config.js new file mode 100644 index 000000000000..88dbfa7f0d44 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/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/softwareplanClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-softwareplan.js", + format: "umd", + name: "Azure.ArmSoftwareplan", + 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({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitMappers.ts b/sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitMappers.ts new file mode 100644 index 000000000000..dd1df6a15721 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitMappers.ts @@ -0,0 +1,19 @@ +/* + * 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 { + AzureEntityResource, + BaseResource, + ErrorModel, + HybridUseBenefitListResult, + HybridUseBenefitModel, + ProxyResource, + Resource, + Sku, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitRevisionMappers.ts b/sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitRevisionMappers.ts new file mode 100644 index 000000000000..dd1df6a15721 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/models/hybridUseBenefitRevisionMappers.ts @@ -0,0 +1,19 @@ +/* + * 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 { + AzureEntityResource, + BaseResource, + ErrorModel, + HybridUseBenefitListResult, + HybridUseBenefitModel, + ProxyResource, + Resource, + Sku, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/softwareplan/arm-softwareplan/src/models/index.ts b/sdk/softwareplan/arm-softwareplan/src/models/index.ts new file mode 100644 index 000000000000..876ffdd10dc0 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/models/index.ts @@ -0,0 +1,398 @@ +/* + * 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 }; + +/** + * Error object returned by the RP + */ +export interface ErrorModel { + /** + * Error code. Possible values include: 'InvalidRequestParameter', 'MissingRequestParameter' + */ + code?: ErrorCode; + /** + * A user readable error message. Localized based on x-ms-effective-locale header in the request + */ + message?: string; +} + +/** + * The SKU to be applied for this resource + */ +export interface Sku { + /** + * Name of the SKU to be applied + */ + name?: string; +} + +/** + * An interface representing Resource. + */ +export interface Resource extends BaseResource { + /** + * Fully qualified resource Id for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource. Ex- Microsoft.Compute/virtualMachines or + * Microsoft.Storage/storageAccounts. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * Response on GET of a hybrid use benefit + */ +export interface HybridUseBenefitModel extends Resource { + /** + * Hybrid use benefit SKU + */ + sku: Sku; + /** + * Indicates the revision of the hybrid use benefit + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: number; + /** + * Provisioning state. Possible values include: 'Succeeded', 'Cancelled', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * Created date + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdDate?: Date; + /** + * Last updated date + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastUpdatedDate?: Date; +} + +/** + * Display fields for an operation. + */ +export interface OperationDisplay { + /** + * Resource Provider name + */ + provider?: string; + /** + * Resource that is acted upon + */ + resource?: string; + /** + * Operation to be performed + */ + operation?: string; + /** + * Description of the operation + */ + description?: string; +} + +/** + * Operation response. + */ +export interface OperationResponse { + /** + * Name of the operation + */ + name?: string; + /** + * Display properties for the operation + */ + display?: OperationDisplay; + /** + * Origin of the response + */ + origin?: string; +} + +/** + * The resource model definition for a ARM proxy resource. It will have everything other than + * required location and tags + */ +export interface ProxyResource extends Resource { +} + +/** + * The resource model definition for a ARM tracked top level resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * The resource model definition for a Azure Resource Manager resource with an etag. + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + +/** + * Optional Parameters. + */ +export interface HybridUseBenefitListOptionalParams extends msRest.RequestOptionsBase { + /** + * Supports applying filter on the type of SKU + */ + filter?: string; +} + +/** + * An interface representing SoftwareplanClientOptions. + */ +export interface SoftwareplanClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * List of hybrid use benefits + * @extends Array + */ +export interface HybridUseBenefitListResult extends Array { + /** + * Url to get the next page of items. + */ + nextLink?: string; +} + +/** + * @interface + * List all the operations. + * @extends Array + */ +export interface OperationList extends Array { + /** + * Url to get the next page of items. + */ + nextLink?: string; +} + +/** + * Defines values for ErrorCode. + * Possible values include: 'InvalidRequestParameter', 'MissingRequestParameter' + * @readonly + * @enum {string} + */ +export type ErrorCode = 'InvalidRequestParameter' | 'MissingRequestParameter'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Succeeded', 'Cancelled', 'Failed' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Cancelled' | 'Failed'; + +/** + * Contains response data for the list operation. + */ +export type HybridUseBenefitListResponse = HybridUseBenefitListResult & { + /** + * 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: HybridUseBenefitListResult; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type HybridUseBenefitCreateResponse = HybridUseBenefitModel & { + /** + * 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: HybridUseBenefitModel; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type HybridUseBenefitUpdateResponse = HybridUseBenefitModel & { + /** + * 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: HybridUseBenefitModel; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type HybridUseBenefitGetResponse = HybridUseBenefitModel & { + /** + * 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: HybridUseBenefitModel; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type HybridUseBenefitListNextResponse = HybridUseBenefitListResult & { + /** + * 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: HybridUseBenefitListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type HybridUseBenefitRevisionListResponse = HybridUseBenefitListResult & { + /** + * 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: HybridUseBenefitListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type HybridUseBenefitRevisionListNextResponse = HybridUseBenefitListResult & { + /** + * 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: HybridUseBenefitListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationList & { + /** + * 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: OperationList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationList & { + /** + * 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: OperationList; + }; +}; diff --git a/sdk/softwareplan/arm-softwareplan/src/models/mappers.ts b/sdk/softwareplan/arm-softwareplan/src/models/mappers.ts new file mode 100644 index 000000000000..e70f86e41ab6 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/models/mappers.ts @@ -0,0 +1,306 @@ +/* + * 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 ErrorModel: msRest.CompositeMapper = { + serializedName: "Error", + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + serializedName: "name", + 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 HybridUseBenefitModel: msRest.CompositeMapper = { + serializedName: "HybridUseBenefitModel", + type: { + name: "Composite", + className: "HybridUseBenefitModel", + modelProperties: { + ...Resource.type.modelProperties, + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "Number" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + createdDate: { + readOnly: true, + serializedName: "properties.createdDate", + type: { + name: "DateTime" + } + }, + lastUpdatedDate: { + readOnly: true, + serializedName: "properties.lastUpdatedDate", + type: { + name: "DateTime" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "OperationDisplay", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const OperationResponse: msRest.CompositeMapper = { + serializedName: "OperationResponse", + type: { + name: "Composite", + className: "OperationResponse", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const HybridUseBenefitListResult: msRest.CompositeMapper = { + serializedName: "HybridUseBenefitListResult", + type: { + name: "Composite", + className: "HybridUseBenefitListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HybridUseBenefitModel" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationList: msRest.CompositeMapper = { + serializedName: "OperationList", + type: { + name: "Composite", + className: "OperationList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResponse" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/softwareplan/arm-softwareplan/src/models/operationsMappers.ts b/sdk/softwareplan/arm-softwareplan/src/models/operationsMappers.ts new file mode 100644 index 000000000000..324a073df4e5 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/models/operationsMappers.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 { + ErrorModel, + OperationDisplay, + OperationList, + OperationResponse +} from "../models/mappers"; diff --git a/sdk/softwareplan/arm-softwareplan/src/models/parameters.ts b/sdk/softwareplan/arm-softwareplan/src/models/parameters.ts new file mode 100644 index 000000000000..a1f885aa2661 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/models/parameters.ts @@ -0,0 +1,88 @@ +/* + * 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 nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const planId: msRest.OperationURLParameter = { + parameterPath: "planId", + mapper: { + required: true, + serializedName: "planId", + type: { + name: "String" + } + } +}; +export const scope: msRest.OperationURLParameter = { + parameterPath: "scope", + mapper: { + required: true, + serializedName: "scope", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/softwareplan/arm-softwareplan/src/models/softwarePlanMappers.ts b/sdk/softwareplan/arm-softwareplan/src/models/softwarePlanMappers.ts new file mode 100644 index 000000000000..10f9755091f6 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/models/softwarePlanMappers.ts @@ -0,0 +1,11 @@ +/* + * 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 { + ErrorModel +} from "../models/mappers"; diff --git a/sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefit.ts b/sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefit.ts new file mode 100644 index 000000000000..e5b84da4eabf --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefit.ts @@ -0,0 +1,391 @@ +/* + * 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/hybridUseBenefitMappers"; +import * as Parameters from "../models/parameters"; +import { SoftwareplanClientContext } from "../softwareplanClientContext"; + +/** Class representing a HybridUseBenefit. */ +export class HybridUseBenefit { + private readonly client: SoftwareplanClientContext; + + /** + * Create a HybridUseBenefit. + * @param {SoftwareplanClientContext} client Reference to the service client. + */ + constructor(client: SoftwareplanClientContext) { + this.client = client; + } + + /** + * Get all hybrid use benefits associated with an ARM resource. + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param [options] The optional parameters + * @returns Promise + */ + list(scope: string, options?: Models.HybridUseBenefitListOptionalParams): Promise; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param callback The callback + */ + list(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param options The optional parameters + * @param callback The callback + */ + list(scope: string, options: Models.HybridUseBenefitListOptionalParams, callback: msRest.ServiceCallback): void; + list(scope: string, options?: Models.HybridUseBenefitListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Create a new hybrid use benefit under a given scope + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param body Request body for creating a hybrid use benefit + * @param [options] The optional parameters + * @returns Promise + */ + create(scope: string, planId: string, body: Models.HybridUseBenefitModel, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param body Request body for creating a hybrid use benefit + * @param callback The callback + */ + create(scope: string, planId: string, body: Models.HybridUseBenefitModel, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param body Request body for creating a hybrid use benefit + * @param options The optional parameters + * @param callback The callback + */ + create(scope: string, planId: string, body: Models.HybridUseBenefitModel, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(scope: string, planId: string, body: Models.HybridUseBenefitModel, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + planId, + body, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Updates an existing hybrid use benefit + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param body Request body for creating a hybrid use benefit + * @param [options] The optional parameters + * @returns Promise + */ + update(scope: string, planId: string, body: Models.HybridUseBenefitModel, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param body Request body for creating a hybrid use benefit + * @param callback The callback + */ + update(scope: string, planId: string, body: Models.HybridUseBenefitModel, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param body Request body for creating a hybrid use benefit + * @param options The optional parameters + * @param callback The callback + */ + update(scope: string, planId: string, body: Models.HybridUseBenefitModel, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(scope: string, planId: string, body: Models.HybridUseBenefitModel, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + planId, + body, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Gets a given plan ID + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param [options] The optional parameters + * @returns Promise + */ + get(scope: string, planId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param callback The callback + */ + get(scope: string, planId: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param options The optional parameters + * @param callback The callback + */ + get(scope: string, planId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(scope: string, planId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + planId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes a given plan ID + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(scope: string, planId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param callback The callback + */ + deleteMethod(scope: string, planId: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(scope: string, planId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(scope: string, planId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + planId, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Get all hybrid use benefits associated with an ARM resource. + * @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: "{scope}/providers/Microsoft.SoftwarePlan/hybridUseBenefits", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridUseBenefitListResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{scope}/providers/Microsoft.SoftwarePlan/hybridUseBenefits/{planId}", + urlParameters: [ + Parameters.scope, + Parameters.planId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.HybridUseBenefitModel, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HybridUseBenefitModel + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "{scope}/providers/Microsoft.SoftwarePlan/hybridUseBenefits/{planId}", + urlParameters: [ + Parameters.scope, + Parameters.planId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.HybridUseBenefitModel, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HybridUseBenefitModel + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{scope}/providers/Microsoft.SoftwarePlan/hybridUseBenefits/{planId}", + urlParameters: [ + Parameters.scope, + Parameters.planId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridUseBenefitModel + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{scope}/providers/Microsoft.SoftwarePlan/hybridUseBenefits/{planId}", + urlParameters: [ + Parameters.scope, + Parameters.planId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridUseBenefitListResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefitRevision.ts b/sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefitRevision.ts new file mode 100644 index 000000000000..270cc33a8732 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/operations/hybridUseBenefitRevision.ts @@ -0,0 +1,138 @@ +/* + * 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/hybridUseBenefitRevisionMappers"; +import * as Parameters from "../models/parameters"; +import { SoftwareplanClientContext } from "../softwareplanClientContext"; + +/** Class representing a HybridUseBenefitRevision. */ +export class HybridUseBenefitRevision { + private readonly client: SoftwareplanClientContext; + + /** + * Create a HybridUseBenefitRevision. + * @param {SoftwareplanClientContext} client Reference to the service client. + */ + constructor(client: SoftwareplanClientContext) { + this.client = client; + } + + /** + * Gets the version history of a hybrid use benefit + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param [options] The optional parameters + * @returns Promise + */ + list(scope: string, planId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param callback The callback + */ + list(scope: string, planId: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param planId This is a unique identifier for a plan. Should be a guid. + * @param options The optional parameters + * @param callback The callback + */ + list(scope: string, planId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(scope: string, planId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + planId, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the version history of a hybrid use benefit + * @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: "{scope}/providers/Microsoft.SoftwarePlan/hybridUseBenefits/{planId}/revisions", + urlParameters: [ + Parameters.scope, + Parameters.planId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridUseBenefitListResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HybridUseBenefitListResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/softwareplan/arm-softwareplan/src/operations/index.ts b/sdk/softwareplan/arm-softwareplan/src/operations/index.ts new file mode 100644 index 000000000000..6a18d92a067c --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/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 "./softwarePlan"; +export * from "./hybridUseBenefit"; +export * from "./hybridUseBenefitRevision"; +export * from "./operations"; diff --git a/sdk/softwareplan/arm-softwareplan/src/operations/operations.ts b/sdk/softwareplan/arm-softwareplan/src/operations/operations.ts new file mode 100644 index 000000000000..daa120b79753 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/operations/operations.ts @@ -0,0 +1,135 @@ +/* + * 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 { SoftwareplanClientContext } from "../softwareplanClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: SoftwareplanClientContext; + + /** + * Create a Operations. + * @param {SoftwareplanClientContext} client Reference to the service client. + */ + constructor(client: SoftwareplanClientContext) { + this.client = client; + } + + /** + * List all the operations. + * @summary Get operations. + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param [options] The optional parameters + * @returns Promise + */ + list(scope: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param callback The callback + */ + list(scope: string, callback: msRest.ServiceCallback): void; + /** + * @param scope The scope at which the operation is performed. This is limited to + * Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts for now + * @param options The optional parameters + * @param callback The callback + */ + list(scope: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(scope: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + scope, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * List all the operations. + * @summary Get 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: "{scope}/providers/Microsoft.SoftwarePlan/operations", + urlParameters: [ + Parameters.scope + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/softwareplan/arm-softwareplan/src/operations/softwarePlan.ts b/sdk/softwareplan/arm-softwareplan/src/operations/softwarePlan.ts new file mode 100644 index 000000000000..e894b8e266e9 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/operations/softwarePlan.ts @@ -0,0 +1,74 @@ +/* + * 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 Mappers from "../models/softwarePlanMappers"; +import * as Parameters from "../models/parameters"; +import { SoftwareplanClientContext } from "../softwareplanClientContext"; + +/** Class representing a SoftwarePlan. */ +export class SoftwarePlan { + private readonly client: SoftwareplanClientContext; + + /** + * Create a SoftwarePlan. + * @param {SoftwareplanClientContext} client Reference to the service client. + */ + constructor(client: SoftwareplanClientContext) { + this.client = client; + } + + /** + * Register to Microsoft.SoftwarePlan resource provider. + * @param [options] The optional parameters + * @returns Promise + */ + register(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + register(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + register(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + register(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + registerOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const registerOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SoftwarePlan/register", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/softwareplan/arm-softwareplan/src/softwareplanClient.ts b/sdk/softwareplan/arm-softwareplan/src/softwareplanClient.ts new file mode 100644 index 000000000000..b2a589877e97 --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/softwareplanClient.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 { SoftwareplanClientContext } from "./softwareplanClientContext"; + + +class SoftwareplanClient extends SoftwareplanClientContext { + // Operation groups + softwarePlan: operations.SoftwarePlan; + hybridUseBenefit: operations.HybridUseBenefit; + hybridUseBenefitRevision: operations.HybridUseBenefitRevision; + operations: operations.Operations; + + /** + * Initializes a new instance of the SoftwareplanClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SoftwareplanClientOptions) { + super(credentials, subscriptionId, options); + this.softwarePlan = new operations.SoftwarePlan(this); + this.hybridUseBenefit = new operations.HybridUseBenefit(this); + this.hybridUseBenefitRevision = new operations.HybridUseBenefitRevision(this); + this.operations = new operations.Operations(this); + } +} + +// Operation Specifications + +export { + SoftwareplanClient, + SoftwareplanClientContext, + Models as SoftwareplanModels, + Mappers as SoftwareplanMappers +}; +export * from "./operations"; diff --git a/sdk/softwareplan/arm-softwareplan/src/softwareplanClientContext.ts b/sdk/softwareplan/arm-softwareplan/src/softwareplanClientContext.ts new file mode 100644 index 000000000000..676afa6061ec --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/src/softwareplanClientContext.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-softwareplan"; +const packageVersion = "1.0.0"; + +export class SoftwareplanClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + apiVersion?: string; + subscriptionId: string; + + /** + * Initializes a new instance of the SoftwareplanClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.SoftwareplanClientOptions) { + 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 = '2019-06-01-preview'; + 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/softwareplan/arm-softwareplan/tsconfig.json b/sdk/softwareplan/arm-softwareplan/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/softwareplan/arm-softwareplan/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", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}