From da00d0526f70ce4f188c8a7435228e4859e54e24 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 30 Apr 2019 16:54:32 +0000 Subject: [PATCH] Generated from b8020f415b349449c80d146b0ac6ca69a75fd0b4 Add TypeScript readme for Serial Console --- .../arm-serialconsole/LICENSE.txt | 21 ++ sdk/serialconsole/arm-serialconsole/README.md | 96 ++++++++++ .../lib/microsoftSerialConsoleClient.ts | 46 +++++ .../microsoftSerialConsoleClientContext.ts | 62 ++++++ .../lib/models/consoleMappers.ts | 15 ++ .../arm-serialconsole/lib/models/index.ts | 181 ++++++++++++++++++ .../lib/models/listConsoleMappers.ts | 15 ++ .../lib/models/listMappers.ts | 15 ++ .../arm-serialconsole/lib/models/mappers.ts | 95 +++++++++ .../lib/models/parameters.ts | 54 ++++++ .../lib/operations/console.ts | 126 ++++++++++++ .../arm-serialconsole/lib/operations/index.ts | 13 ++ .../arm-serialconsole/lib/operations/list.ts | 77 ++++++++ .../lib/operations/listConsole.ts | 78 ++++++++ .../arm-serialconsole/package.json | 56 ++++++ .../arm-serialconsole/rollup.config.js | 37 ++++ .../arm-serialconsole/tsconfig.json | 19 ++ 17 files changed, 1006 insertions(+) create mode 100644 sdk/serialconsole/arm-serialconsole/LICENSE.txt create mode 100644 sdk/serialconsole/arm-serialconsole/README.md create mode 100644 sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClient.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClientContext.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/models/consoleMappers.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/models/index.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/models/listConsoleMappers.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/models/listMappers.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/models/mappers.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/models/parameters.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/operations/console.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/operations/index.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/operations/list.ts create mode 100644 sdk/serialconsole/arm-serialconsole/lib/operations/listConsole.ts create mode 100644 sdk/serialconsole/arm-serialconsole/package.json create mode 100644 sdk/serialconsole/arm-serialconsole/rollup.config.js create mode 100644 sdk/serialconsole/arm-serialconsole/tsconfig.json diff --git a/sdk/serialconsole/arm-serialconsole/LICENSE.txt b/sdk/serialconsole/arm-serialconsole/LICENSE.txt new file mode 100644 index 000000000000..b73b4a1293c3 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/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/serialconsole/arm-serialconsole/README.md b/sdk/serialconsole/arm-serialconsole/README.md new file mode 100644 index 000000000000..f309e3ea9141 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/README.md @@ -0,0 +1,96 @@ +## Azure MicrosoftSerialConsoleClient SDK for JavaScript + +This package contains an isomorphic SDK for MicrosoftSerialConsoleClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-serialconsole +``` + +### How to use + +#### nodejs - Authentication, client creation and operations list 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 { MicrosoftSerialConsoleClient, MicrosoftSerialConsoleModels, MicrosoftSerialConsoleMappers } from "@azure/arm-serialconsole"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new MicrosoftSerialConsoleClient(creds, subscriptionId); + client.list.operations().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and operations list 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-serialconsole sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClient.ts b/sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClient.ts new file mode 100644 index 000000000000..ba521794b237 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClient.ts @@ -0,0 +1,46 @@ +/* + * 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 { MicrosoftSerialConsoleClientContext } from "./microsoftSerialConsoleClientContext"; + + +class MicrosoftSerialConsoleClient extends MicrosoftSerialConsoleClientContext { + // Operation groups + list: operations.List; + listConsole: operations.ListConsole; + console: operations.Console; + + /** + * Initializes a new instance of the MicrosoftSerialConsoleClient 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.MicrosoftSerialConsoleClientOptions) { + super(credentials, subscriptionId, options); + this.list = new operations.List(this); + this.listConsole = new operations.ListConsole(this); + this.console = new operations.Console(this); + } +} + +// Operation Specifications + +export { + MicrosoftSerialConsoleClient, + MicrosoftSerialConsoleClientContext, + Models as MicrosoftSerialConsoleModels, + Mappers as MicrosoftSerialConsoleMappers +}; +export * from "./operations"; diff --git a/sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClientContext.ts b/sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClientContext.ts new file mode 100644 index 000000000000..1478ee9b10b3 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/microsoftSerialConsoleClientContext.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-serialconsole"; +const packageVersion = "1.0.0"; + +export class MicrosoftSerialConsoleClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the MicrosoftSerialConsoleClient 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.MicrosoftSerialConsoleClientOptions) { + 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 = '2018-05-01'; + 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/serialconsole/arm-serialconsole/lib/models/consoleMappers.ts b/sdk/serialconsole/arm-serialconsole/lib/models/consoleMappers.ts new file mode 100644 index 000000000000..19976feefc33 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/models/consoleMappers.ts @@ -0,0 +1,15 @@ +/* + * 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 { + SetDisabledResult, + DeploymentValidateResult +} from "../models/mappers"; + diff --git a/sdk/serialconsole/arm-serialconsole/lib/models/index.ts b/sdk/serialconsole/arm-serialconsole/lib/models/index.ts new file mode 100644 index 000000000000..02144bf3f441 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/models/index.ts @@ -0,0 +1,181 @@ +/* + * 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 SerialConsoleGetResult. + * @summary Serial Console GET Result + * + * Returns whether or not Serial Console is disabled. + * + */ +export interface SerialConsoleGetResult { + /** + * @member {boolean} [value] Whether or not Serial Console is disabled. + */ + value?: boolean; +} + +/** + * @interface + * An interface representing GetDisabledResult. + * @summary Get Disabled result + * + * Returns whether or not Serial Console is disabled for this given + * subscription + * + */ +export interface GetDisabledResult { + /** + * @member {boolean} [disabled] Disabled result + */ + disabled?: boolean; +} + +/** + * @interface + * An interface representing SetDisabledResult. + * @summary Set Disabled result + * + * Sets disable status and returns whether or not Serial Console is now + * disabled for this given subscription + * + */ +export interface SetDisabledResult { + /** + * @member {boolean} [disabled] Disabled result + */ + disabled?: boolean; +} + +/** + * @interface + * An interface representing DeploymentValidateResult. + * @summary Details on Failure + * + * Details on Failure + * + */ +export interface DeploymentValidateResult { + /** + * @member {string} [errorMessage] Error message + */ + errorMessage?: string; +} + +/** + * @interface + * An interface representing SerialConsoleOperations. + * @summary Serial Console operations + * + * Serial Console operations + * + */ +export interface SerialConsoleOperations { + /** + * @member {string} [value] Serial Console operations + */ + value?: string; +} + +/** + * @interface + * An interface representing MicrosoftSerialConsoleClientOptions. + * @extends AzureServiceClientOptions + */ +export interface MicrosoftSerialConsoleClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * Contains response data for the operations operation. + */ +export type ListOperationsResponse = SerialConsoleOperations & { + /** + * 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: SerialConsoleOperations; + }; +}; + +/** + * Contains response data for the disabled operation. + */ +export type ListConsoleDisabledResponse = GetDisabledResult & { + /** + * 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: GetDisabledResult; + }; +}; + +/** + * Contains response data for the enableConsole operation. + */ +export type ConsoleEnableConsoleResponse = SetDisabledResult & { + /** + * 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: SetDisabledResult; + }; +}; + +/** + * Contains response data for the disableConsole operation. + */ +export type ConsoleDisableConsoleResponse = SetDisabledResult & { + /** + * 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: SetDisabledResult; + }; +}; diff --git a/sdk/serialconsole/arm-serialconsole/lib/models/listConsoleMappers.ts b/sdk/serialconsole/arm-serialconsole/lib/models/listConsoleMappers.ts new file mode 100644 index 000000000000..0805e1393d95 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/models/listConsoleMappers.ts @@ -0,0 +1,15 @@ +/* + * 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 { + GetDisabledResult, + DeploymentValidateResult +} from "../models/mappers"; + diff --git a/sdk/serialconsole/arm-serialconsole/lib/models/listMappers.ts b/sdk/serialconsole/arm-serialconsole/lib/models/listMappers.ts new file mode 100644 index 000000000000..9e1a58eafb0f --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/models/listMappers.ts @@ -0,0 +1,15 @@ +/* + * 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 { + SerialConsoleOperations, + CloudError +} from "../models/mappers"; + diff --git a/sdk/serialconsole/arm-serialconsole/lib/models/mappers.ts b/sdk/serialconsole/arm-serialconsole/lib/models/mappers.ts new file mode 100644 index 000000000000..8edaf8ec16fc --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/models/mappers.ts @@ -0,0 +1,95 @@ +/* + * 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 SerialConsoleGetResult: msRest.CompositeMapper = { + serializedName: "SerialConsoleGetResult", + type: { + name: "Composite", + className: "SerialConsoleGetResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Boolean" + } + } + } + } +}; + +export const GetDisabledResult: msRest.CompositeMapper = { + serializedName: "GetDisabledResult", + type: { + name: "Composite", + className: "GetDisabledResult", + modelProperties: { + disabled: { + serializedName: "disabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const SetDisabledResult: msRest.CompositeMapper = { + serializedName: "SetDisabledResult", + type: { + name: "Composite", + className: "SetDisabledResult", + modelProperties: { + disabled: { + serializedName: "disabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const DeploymentValidateResult: msRest.CompositeMapper = { + serializedName: "DeploymentValidateResult", + type: { + name: "Composite", + className: "DeploymentValidateResult", + modelProperties: { + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + } + } + } +}; + +export const SerialConsoleOperations: msRest.CompositeMapper = { + serializedName: "SerialConsoleOperations", + type: { + name: "Composite", + className: "SerialConsoleOperations", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/serialconsole/arm-serialconsole/lib/models/parameters.ts b/sdk/serialconsole/arm-serialconsole/lib/models/parameters.ts new file mode 100644 index 000000000000..cfa66a79cc41 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/models/parameters.ts @@ -0,0 +1,54 @@ +/* + * 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 defaultParameter: msRest.OperationURLParameter = { + parameterPath: "defaultParameter", + mapper: { + required: true, + isConstant: true, + serializedName: "default", + defaultValue: 'default', + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/serialconsole/arm-serialconsole/lib/operations/console.ts b/sdk/serialconsole/arm-serialconsole/lib/operations/console.ts new file mode 100644 index 000000000000..5fc39b8dbe5c --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/operations/console.ts @@ -0,0 +1,126 @@ +/* + * 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/consoleMappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftSerialConsoleClientContext } from "../microsoftSerialConsoleClientContext"; + +/** Class representing a Console. */ +export class Console { + private readonly client: MicrosoftSerialConsoleClientContext; + + /** + * Create a Console. + * @param {MicrosoftSerialConsoleClientContext} client Reference to the service client. + */ + constructor(client: MicrosoftSerialConsoleClientContext) { + this.client = client; + } + + /** + * Enables Serial Console for a subscription + * @param [options] The optional parameters + * @returns Promise + */ + enableConsole(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + enableConsole(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + enableConsole(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + enableConsole(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + enableConsoleOperationSpec, + callback) as Promise; + } + + /** + * Disables Serial Console for a subscription + * @param [options] The optional parameters + * @returns Promise + */ + disableConsole(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + disableConsole(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + disableConsole(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableConsole(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + disableConsoleOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const enableConsoleOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole", + urlParameters: [ + Parameters.subscriptionId, + Parameters.defaultParameter + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SetDisabledResult + }, + default: { + bodyMapper: Mappers.DeploymentValidateResult + } + }, + serializer +}; + +const disableConsoleOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole", + urlParameters: [ + Parameters.subscriptionId, + Parameters.defaultParameter + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SetDisabledResult + }, + default: { + bodyMapper: Mappers.DeploymentValidateResult + } + }, + serializer +}; diff --git a/sdk/serialconsole/arm-serialconsole/lib/operations/index.ts b/sdk/serialconsole/arm-serialconsole/lib/operations/index.ts new file mode 100644 index 000000000000..e3293772d3ea --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/operations/index.ts @@ -0,0 +1,13 @@ +/* + * 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 "./list"; +export * from "./listConsole"; +export * from "./console"; diff --git a/sdk/serialconsole/arm-serialconsole/lib/operations/list.ts b/sdk/serialconsole/arm-serialconsole/lib/operations/list.ts new file mode 100644 index 000000000000..29bbdc3a732e --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/operations/list.ts @@ -0,0 +1,77 @@ +/* + * 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/listMappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftSerialConsoleClientContext } from "../microsoftSerialConsoleClientContext"; + +/** Class representing a List. */ +export class List { + private readonly client: MicrosoftSerialConsoleClientContext; + + /** + * Create a List. + * @param {MicrosoftSerialConsoleClientContext} client Reference to the service client. + */ + constructor(client: MicrosoftSerialConsoleClientContext) { + this.client = client; + } + + /** + * Gets a list of Serial Console API operations. + * @param [options] The optional parameters + * @returns Promise + */ + operations(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + operations(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + operations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + operations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + operationsOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const operationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/operations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SerialConsoleOperations + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/serialconsole/arm-serialconsole/lib/operations/listConsole.ts b/sdk/serialconsole/arm-serialconsole/lib/operations/listConsole.ts new file mode 100644 index 000000000000..2e69bc92a0a3 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/lib/operations/listConsole.ts @@ -0,0 +1,78 @@ +/* + * 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/listConsoleMappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftSerialConsoleClientContext } from "../microsoftSerialConsoleClientContext"; + +/** Class representing a ListConsole. */ +export class ListConsole { + private readonly client: MicrosoftSerialConsoleClientContext; + + /** + * Create a ListConsole. + * @param {MicrosoftSerialConsoleClientContext} client Reference to the service client. + */ + constructor(client: MicrosoftSerialConsoleClientContext) { + this.client = client; + } + + /** + * Gets if Serial Console is disabled for a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + disabled(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + disabled(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + disabled(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disabled(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + disabledOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const disabledOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.defaultParameter + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GetDisabledResult + }, + default: { + bodyMapper: Mappers.DeploymentValidateResult + } + }, + serializer +}; diff --git a/sdk/serialconsole/arm-serialconsole/package.json b/sdk/serialconsole/arm-serialconsole/package.json new file mode 100644 index 000000000000..f8afc98e389a --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/package.json @@ -0,0 +1,56 @@ +{ + "name": "@azure/arm-serialconsole", + "author": "Microsoft Corporation", + "description": "MicrosoftSerialConsoleClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.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-serialconsole.js", + "module": "./esm/microsoftSerialConsoleClient.js", + "types": "./esm/microsoftSerialConsoleClient.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-serialconsole.js.map'\" -o ./dist/arm-serialconsole.min.js ./dist/arm-serialconsole.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false +} diff --git a/sdk/serialconsole/arm-serialconsole/rollup.config.js b/sdk/serialconsole/arm-serialconsole/rollup.config.js new file mode 100644 index 000000000000..b09f9ebf49d0 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/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/microsoftSerialConsoleClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-serialconsole.js", + format: "umd", + name: "Azure.ArmSerialconsole", + 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/serialconsole/arm-serialconsole/tsconfig.json b/sdk/serialconsole/arm-serialconsole/tsconfig.json new file mode 100644 index 000000000000..51ea90961ce5 --- /dev/null +++ b/sdk/serialconsole/arm-serialconsole/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"] +}