From cc7ae0622f2dcc7703768d1ebb16258adcc3ac33 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 17 Aug 2021 20:09:53 +0000 Subject: [PATCH] CodeGen from PR 15253 in Azure/azure-rest-api-specs Merge 88a53097b583720b4a2ebf1281353f476f095210 into 60d6c393c7e71b45ebe0976a35fd7a5841993159 --- .../arm-templatespecs/LICENSE.txt | 21 + sdk/templatespecs/arm-templatespecs/README.md | 112 ++++ .../arm-templatespecs/package.json | 59 ++ .../arm-templatespecs/rollup.config.js | 37 ++ .../arm-templatespecs/src/models/index.ts | 616 ++++++++++++++++++ .../arm-templatespecs/src/models/mappers.ts | 487 ++++++++++++++ .../src/models/parameters.ts | 109 ++++ .../src/models/templateSpecVersionsMappers.ts | 23 + .../src/models/templateSpecsMappers.ts | 23 + .../arm-templatespecs/src/operations/index.ts | 11 + .../src/operations/templateSpecVersions.ts | 407 ++++++++++++ .../src/operations/templateSpecs.ts | 486 ++++++++++++++ .../src/templateSpecsClient.ts | 49 ++ .../src/templateSpecsClientContext.ts | 67 ++ .../arm-templatespecs/tsconfig.json | 19 + 15 files changed, 2526 insertions(+) create mode 100644 sdk/templatespecs/arm-templatespecs/LICENSE.txt create mode 100644 sdk/templatespecs/arm-templatespecs/README.md create mode 100644 sdk/templatespecs/arm-templatespecs/package.json create mode 100644 sdk/templatespecs/arm-templatespecs/rollup.config.js create mode 100644 sdk/templatespecs/arm-templatespecs/src/models/index.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/models/mappers.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/models/parameters.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/models/templateSpecVersionsMappers.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/models/templateSpecsMappers.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/operations/index.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts create mode 100644 sdk/templatespecs/arm-templatespecs/src/templateSpecsClientContext.ts create mode 100644 sdk/templatespecs/arm-templatespecs/tsconfig.json diff --git a/sdk/templatespecs/arm-templatespecs/LICENSE.txt b/sdk/templatespecs/arm-templatespecs/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 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/templatespecs/arm-templatespecs/README.md b/sdk/templatespecs/arm-templatespecs/README.md new file mode 100644 index 000000000000..73c482f6348c --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/README.md @@ -0,0 +1,112 @@ +## Azure TemplateSpecsClient SDK for JavaScript + +This package contains an isomorphic SDK (runs both in node.js and in browsers) for TemplateSpecsClient. + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +You must have an [Azure subscription](https://azure.microsoft.com/free/). + +### How to install + +To use this SDK in your project, you will need to install two packages. +- `@azure/arm-templatespecs` that contains the client. +- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. + +Install both packages using the below command: +```bash +npm install --save @azure/arm-templatespecs @azure/identity +``` +> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. +If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. + +### How to use + +- If you are writing a client side browser application, + - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. + - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. +- If you are writing a server side application, + - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) + - Complete the set up steps required by the credential if any. + - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. + +In the below samples, we pass the credential and the Azure subscription id to instantiate the client. +Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +#### nodejs - Authentication, client creation, and get templateSpecs as an example written in JavaScript. + +##### Sample code + +```javascript +const { DefaultAzureCredential } = require("@azure/identity"); +const { TemplateSpecsClient } = require("@azure/arm-templatespecs"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples +// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. +const creds = new DefaultAzureCredential(); +const client = new TemplateSpecsClient(creds, subscriptionId); +const resourceGroupName = "testresourceGroupName"; +const templateSpecName = "testtemplateSpecName"; +const expand = "versions"; +client.templateSpecs.get(resourceGroupName, templateSpecName, expand).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.log("An error occurred:"); + console.error(err); +}); +``` + +#### browser - Authentication, client creation, and get templateSpecs as an example written in JavaScript. + +In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. + - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. + - Note down the client Id from the previous step and use it in the browser sample below. + +##### Sample code + +- index.html + +```html + + + + @azure/arm-templatespecs 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/templatespecs/arm-templatespecs/README.png) diff --git a/sdk/templatespecs/arm-templatespecs/package.json b/sdk/templatespecs/arm-templatespecs/package.json new file mode 100644 index 000000000000..2dcbc472c03d --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/package.json @@ -0,0 +1,59 @@ +{ + "name": "@azure/arm-templatespecs", + "author": "Microsoft Corporation", + "description": "TemplateSpecsClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-js": "^2.2.0", + "@azure/core-auth": "^1.1.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-templatespecs.js", + "module": "./esm/templateSpecsClient.js", + "types": "./esm/templateSpecsClient.d.ts", + "devDependencies": { + "typescript": "^3.6.0", + "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/templatespecs/arm-templatespecs", + "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-templatespecs.js.map'\" -o ./dist/arm-templatespecs.min.js ./dist/arm-templatespecs.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/templatespecs/arm-templatespecs/rollup.config.js b/sdk/templatespecs/arm-templatespecs/rollup.config.js new file mode 100644 index 000000000000..229b04eefa29 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/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/templateSpecsClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-templatespecs.js", + format: "umd", + name: "Azure.ArmTemplatespecs", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/templatespecs/arm-templatespecs/src/models/index.ts b/sdk/templatespecs/arm-templatespecs/src/models/index.ts new file mode 100644 index 000000000000..7782895dc6ab --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/models/index.ts @@ -0,0 +1,616 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * High-level information about a Template Spec version. + */ +export interface TemplateSpecVersionInfo { + /** + * Template Spec version description. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * The timestamp of when the version was created. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timeCreated?: Date; + /** + * The timestamp of when the version was last modified. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly timeModified?: Date; +} + +/** + * Common properties for all Azure resources. + */ +export interface AzureResourceBase extends BaseResource { + /** + * String Id used to locate any resource on Azure. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Name of this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Type of this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + +/** + * Template Spec object. + */ +export interface TemplateSpec extends AzureResourceBase { + /** + * The location of the Template Spec. It cannot be changed after Template Spec creation. It must + * be one of the supported Azure locations. + */ + location: string; + /** + * Template Spec description. + */ + description?: string; + /** + * Template Spec display name. + */ + displayName?: string; + /** + * The Template Spec metadata. Metadata is an open-ended object and is typically a collection of + * key-value pairs. + */ + metadata?: any; + /** + * High-level information about the versions within this Template Spec. The keys are the version + * names. Only populated if the $expand query parameter is set to 'versions'. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly versions?: { [propertyName: string]: TemplateSpecVersionInfo }; + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Template Spec properties to be updated (only tags are currently supported). + */ +export interface TemplateSpecUpdateModel extends AzureResourceBase { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Template Spec Version properties to be updated (only tags are currently supported). + */ +export interface TemplateSpecVersionUpdateModel extends AzureResourceBase { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; +} + +/** + * Represents a Template Spec artifact containing an embedded Azure Resource Manager template for + * use as a linked template. + */ +export interface LinkedTemplateArtifact { + /** + * A filesystem safe relative path of the artifact. + */ + path: string; + /** + * The Azure Resource Manager template. + */ + template: any; +} + +/** + * Template Spec Version object. + */ +export interface TemplateSpecVersion extends AzureResourceBase { + /** + * The location of the Template Spec Version. It must match the location of the parent Template + * Spec. + */ + location: string; + /** + * Template Spec version description. + */ + description?: string; + /** + * An array of linked template artifacts. + */ + linkedTemplates?: LinkedTemplateArtifact[]; + /** + * The version metadata. Metadata is an open-ended object and is typically a collection of + * key-value pairs. + */ + metadata?: any; + /** + * The main Azure Resource Manager template content. + */ + mainTemplate?: any; + /** + * The Azure Resource Manager template UI definition content. + */ + uiFormDefinition?: any; + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; +} + +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.) + * @summary Error Response + */ +export interface ErrorResponse { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorResponse[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** + * Template Specs error response. + */ +export interface TemplateSpecsError { + error?: ErrorResponse; +} + +/** + * Optional Parameters. + */ +export interface TemplateSpecsUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Template Spec resource with the tags to be updated. + */ + templateSpec?: TemplateSpecUpdateModel; +} + +/** + * Optional Parameters. + */ +export interface TemplateSpecsGetOptionalParams extends msRest.RequestOptionsBase { + /** + * Allows for expansion of additional Template Spec details in the response. Optional. Possible + * values include: 'versions' + */ + expand?: TemplateSpecExpandKind; +} + +/** + * Optional Parameters. + */ +export interface TemplateSpecsListBySubscriptionOptionalParams extends msRest.RequestOptionsBase { + /** + * Allows for expansion of additional Template Spec details in the response. Optional. Possible + * values include: 'versions' + */ + expand?: TemplateSpecExpandKind; +} + +/** + * Optional Parameters. + */ +export interface TemplateSpecsListByResourceGroupOptionalParams extends msRest.RequestOptionsBase { + /** + * Allows for expansion of additional Template Spec details in the response. Optional. Possible + * values include: 'versions' + */ + expand?: TemplateSpecExpandKind; +} + +/** + * Optional Parameters. + */ +export interface TemplateSpecsListBySubscriptionNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Allows for expansion of additional Template Spec details in the response. Optional. Possible + * values include: 'versions' + */ + expand?: TemplateSpecExpandKind; +} + +/** + * Optional Parameters. + */ +export interface TemplateSpecsListByResourceGroupNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Allows for expansion of additional Template Spec details in the response. Optional. Possible + * values include: 'versions' + */ + expand?: TemplateSpecExpandKind; +} + +/** + * Optional Parameters. + */ +export interface TemplateSpecVersionsUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Template Spec Version resource with the tags to be updated. + */ + templateSpecVersionUpdateModel?: TemplateSpecVersionUpdateModel; +} + +/** + * An interface representing TemplateSpecsClientOptions. + */ +export interface TemplateSpecsClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * List of Template Specs. + * @extends Array + */ +export interface TemplateSpecsListResult extends Array { + /** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * List of Template Specs versions + * @extends Array + */ +export interface TemplateSpecVersionsListResult extends Array { + /** + * The URL to use for getting the next set of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + +/** + * Defines values for TemplateSpecExpandKind. + * Possible values include: 'versions' + * @readonly + * @enum {string} + */ +export type TemplateSpecExpandKind = 'versions'; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type TemplateSpecsCreateOrUpdateResponse = TemplateSpec & { + /** + * 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: TemplateSpec; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type TemplateSpecsUpdateResponse = TemplateSpec & { + /** + * 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: TemplateSpec; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type TemplateSpecsGetResponse = TemplateSpec & { + /** + * 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: TemplateSpec; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type TemplateSpecsListBySubscriptionResponse = TemplateSpecsListResult & { + /** + * 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: TemplateSpecsListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type TemplateSpecsListByResourceGroupResponse = TemplateSpecsListResult & { + /** + * 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: TemplateSpecsListResult; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type TemplateSpecsListBySubscriptionNextResponse = TemplateSpecsListResult & { + /** + * 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: TemplateSpecsListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type TemplateSpecsListByResourceGroupNextResponse = TemplateSpecsListResult & { + /** + * 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: TemplateSpecsListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type TemplateSpecVersionsCreateOrUpdateResponse = TemplateSpecVersion & { + /** + * 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: TemplateSpecVersion; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type TemplateSpecVersionsUpdateResponse = TemplateSpecVersion & { + /** + * 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: TemplateSpecVersion; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type TemplateSpecVersionsGetResponse = TemplateSpecVersion & { + /** + * 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: TemplateSpecVersion; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type TemplateSpecVersionsListResponse = TemplateSpecVersionsListResult & { + /** + * 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: TemplateSpecVersionsListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type TemplateSpecVersionsListNextResponse = TemplateSpecVersionsListResult & { + /** + * 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: TemplateSpecVersionsListResult; + }; +}; diff --git a/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts b/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts new file mode 100644 index 000000000000..9caf69e75a85 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/models/mappers.ts @@ -0,0 +1,487 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +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 TemplateSpecVersionInfo: msRest.CompositeMapper = { + serializedName: "TemplateSpecVersionInfo", + type: { + name: "Composite", + className: "TemplateSpecVersionInfo", + modelProperties: { + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + }, + timeCreated: { + readOnly: true, + serializedName: "timeCreated", + type: { + name: "DateTime" + } + }, + timeModified: { + readOnly: true, + serializedName: "timeModified", + type: { + name: "DateTime" + } + } + } + } +}; + +export const AzureResourceBase: msRest.CompositeMapper = { + serializedName: "AzureResourceBase", + type: { + name: "Composite", + className: "AzureResourceBase", + 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" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const TemplateSpec: msRest.CompositeMapper = { + serializedName: "TemplateSpec", + type: { + name: "Composite", + className: "TemplateSpec", + modelProperties: { + ...AzureResourceBase.type.modelProperties, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + constraints: { + MaxLength: 4096 + }, + type: { + name: "String" + } + }, + displayName: { + serializedName: "properties.displayName", + constraints: { + MaxLength: 64 + }, + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + versions: { + readOnly: true, + serializedName: "properties.versions", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "TemplateSpecVersionInfo" + } + } + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TemplateSpecUpdateModel: msRest.CompositeMapper = { + serializedName: "TemplateSpecUpdateModel", + type: { + name: "Composite", + className: "TemplateSpecUpdateModel", + modelProperties: { + ...AzureResourceBase.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TemplateSpecVersionUpdateModel: msRest.CompositeMapper = { + serializedName: "TemplateSpecVersionUpdateModel", + type: { + name: "Composite", + className: "TemplateSpecVersionUpdateModel", + modelProperties: { + ...AzureResourceBase.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const LinkedTemplateArtifact: msRest.CompositeMapper = { + serializedName: "LinkedTemplateArtifact", + type: { + name: "Composite", + className: "LinkedTemplateArtifact", + modelProperties: { + path: { + required: true, + serializedName: "path", + type: { + name: "String" + } + }, + template: { + required: true, + serializedName: "template", + type: { + name: "Object" + } + } + } + } +}; + +export const TemplateSpecVersion: msRest.CompositeMapper = { + serializedName: "TemplateSpecVersion", + type: { + name: "Composite", + className: "TemplateSpecVersion", + modelProperties: { + ...AzureResourceBase.type.modelProperties, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + constraints: { + MaxLength: 4096 + }, + type: { + name: "String" + } + }, + linkedTemplates: { + serializedName: "properties.linkedTemplates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkedTemplateArtifact" + } + } + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Object" + } + }, + mainTemplate: { + serializedName: "properties.mainTemplate", + type: { + name: "Object" + } + }, + uiFormDefinition: { + serializedName: "properties.uiFormDefinition", + type: { + name: "Object" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const TemplateSpecsError: msRest.CompositeMapper = { + serializedName: "TemplateSpecsError", + type: { + name: "Composite", + className: "TemplateSpecsError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + +export const TemplateSpecsListResult: msRest.CompositeMapper = { + serializedName: "TemplateSpecsListResult", + type: { + name: "Composite", + className: "TemplateSpecsListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TemplateSpec" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TemplateSpecVersionsListResult: msRest.CompositeMapper = { + serializedName: "TemplateSpecVersionsListResult", + type: { + name: "Composite", + className: "TemplateSpecVersionsListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TemplateSpecVersion" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts b/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts new file mode 100644 index 000000000000..339c6df979f9 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/models/parameters.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +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 expand: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "expand" + ], + mapper: { + serializedName: "$expand", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; +export const templateSpecName: msRest.OperationURLParameter = { + parameterPath: "templateSpecName", + mapper: { + required: true, + serializedName: "templateSpecName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const templateSpecVersion: msRest.OperationURLParameter = { + parameterPath: "templateSpecVersion", + mapper: { + required: true, + serializedName: "templateSpecVersion", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/templatespecs/arm-templatespecs/src/models/templateSpecVersionsMappers.ts b/sdk/templatespecs/arm-templatespecs/src/models/templateSpecVersionsMappers.ts new file mode 100644 index 000000000000..1232a08b8e2c --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/models/templateSpecVersionsMappers.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AzureResourceBase, + BaseResource, + ErrorAdditionalInfo, + ErrorResponse, + LinkedTemplateArtifact, + SystemData, + TemplateSpec, + TemplateSpecsError, + TemplateSpecUpdateModel, + TemplateSpecVersion, + TemplateSpecVersionInfo, + TemplateSpecVersionsListResult, + TemplateSpecVersionUpdateModel +} from "../models/mappers"; diff --git a/sdk/templatespecs/arm-templatespecs/src/models/templateSpecsMappers.ts b/sdk/templatespecs/arm-templatespecs/src/models/templateSpecsMappers.ts new file mode 100644 index 000000000000..88862368146e --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/models/templateSpecsMappers.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AzureResourceBase, + BaseResource, + ErrorAdditionalInfo, + ErrorResponse, + LinkedTemplateArtifact, + SystemData, + TemplateSpec, + TemplateSpecsError, + TemplateSpecsListResult, + TemplateSpecUpdateModel, + TemplateSpecVersion, + TemplateSpecVersionInfo, + TemplateSpecVersionUpdateModel +} from "../models/mappers"; diff --git a/sdk/templatespecs/arm-templatespecs/src/operations/index.ts b/sdk/templatespecs/arm-templatespecs/src/operations/index.ts new file mode 100644 index 000000000000..275929137843 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/operations/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export * from "./templateSpecs"; +export * from "./templateSpecVersions"; diff --git a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts new file mode 100644 index 000000000000..6f4a9b4f6ca0 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecVersions.ts @@ -0,0 +1,407 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/templateSpecVersionsMappers"; +import * as Parameters from "../models/parameters"; +import { TemplateSpecsClientContext } from "../templateSpecsClientContext"; + +/** Class representing a TemplateSpecVersions. */ +export class TemplateSpecVersions { + private readonly client: TemplateSpecsClientContext; + + /** + * Create a TemplateSpecVersions. + * @param {TemplateSpecsClientContext} client Reference to the service client. + */ + constructor(client: TemplateSpecsClientContext) { + this.client = client; + } + + /** + * Creates or updates a Template Spec version. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param templateSpecVersionModel Template Spec Version supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: Models.TemplateSpecVersion, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param templateSpecVersionModel Template Spec Version supplied to the operation. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: Models.TemplateSpecVersion, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param templateSpecVersionModel Template Spec Version supplied to the operation. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: Models.TemplateSpecVersion, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, templateSpecVersionModel: Models.TemplateSpecVersion, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + templateSpecVersion, + templateSpecVersionModel, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Updates Template Spec Version tags with specified values. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: Models.TemplateSpecVersionsUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param callback The callback + */ + update(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options: Models.TemplateSpecVersionsUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: Models.TemplateSpecVersionsUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + templateSpecVersion, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Gets a Template Spec version from a specific Template Spec. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param callback The callback + */ + get(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + templateSpecVersion, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes a specific version from a Template Spec. When operation completes, status code 200 + * returned without content. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpecVersion The version of the Template Spec. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, templateSpecName: string, templateSpecVersion: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + templateSpecVersion, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all the Template Spec versions in the specified Template Spec. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, templateSpecName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param callback The callback + */ + list(resourceGroupName: string, templateSpecName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, templateSpecName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, templateSpecName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all the Template Spec versions in the specified Template Spec. + * @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 createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName, + Parameters.templateSpecVersion + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "templateSpecVersionModel", + mapper: { + ...Mappers.TemplateSpecVersion, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersion + }, + 201: { + bodyMapper: Mappers.TemplateSpecVersion + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName, + Parameters.templateSpecVersion + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "templateSpecVersionUpdateModel" + ], + mapper: Mappers.TemplateSpecVersionUpdateModel + }, + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersion + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName, + Parameters.templateSpecVersion + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersion + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName, + Parameters.templateSpecVersion + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersionsListResult + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecVersionsListResult + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; diff --git a/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts new file mode 100644 index 000000000000..4f4b7e296ed7 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/operations/templateSpecs.ts @@ -0,0 +1,486 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/templateSpecsMappers"; +import * as Parameters from "../models/parameters"; +import { TemplateSpecsClientContext } from "../templateSpecsClientContext"; + +/** Class representing a TemplateSpecs. */ +export class TemplateSpecs { + private readonly client: TemplateSpecsClientContext; + + /** + * Create a TemplateSpecs. + * @param {TemplateSpecsClientContext} client Reference to the service client. + */ + constructor(client: TemplateSpecsClientContext) { + this.client = client; + } + + /** + * Creates or updates a Template Spec. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpec Template Spec supplied to the operation. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpec: Models.TemplateSpec, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpec Template Spec supplied to the operation. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpec: Models.TemplateSpec, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param templateSpec Template Spec supplied to the operation. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpec: Models.TemplateSpec, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, templateSpecName: string, templateSpec: Models.TemplateSpec, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + templateSpec, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Updates Template Spec tags with specified values. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, templateSpecName: string, options?: Models.TemplateSpecsUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param callback The callback + */ + update(resourceGroupName: string, templateSpecName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, templateSpecName: string, options: Models.TemplateSpecsUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, templateSpecName: string, options?: Models.TemplateSpecsUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Gets a Template Spec with a given name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, templateSpecName: string, options?: Models.TemplateSpecsGetOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param callback The callback + */ + get(resourceGroupName: string, templateSpecName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, templateSpecName: string, options: Models.TemplateSpecsGetOptionalParams, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, templateSpecName: string, options?: Models.TemplateSpecsGetOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes a Template Spec by name. When operation completes, status code 200 returned without + * content. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, templateSpecName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, templateSpecName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param templateSpecName Name of the Template Spec. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, templateSpecName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, templateSpecName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + templateSpecName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all the Template Specs within the specified subscriptions. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: Models.TemplateSpecsListBySubscriptionOptionalParams): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: Models.TemplateSpecsListBySubscriptionOptionalParams, callback: msRest.ServiceCallback): void; + listBySubscription(options?: Models.TemplateSpecsListBySubscriptionOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Lists all the Template Specs within the specified resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: Models.TemplateSpecsListByResourceGroupOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: Models.TemplateSpecsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: Models.TemplateSpecsListByResourceGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists all the Template Specs within the specified subscriptions. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: Models.TemplateSpecsListBySubscriptionNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: Models.TemplateSpecsListBySubscriptionNextOptionalParams, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: Models.TemplateSpecsListBySubscriptionNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Lists all the Template Specs within the specified resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: Models.TemplateSpecsListByResourceGroupNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(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 + */ + listByResourceGroupNext(nextPageLink: string, options: Models.TemplateSpecsListByResourceGroupNextOptionalParams, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: Models.TemplateSpecsListByResourceGroupNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "templateSpec", + mapper: { + ...Mappers.TemplateSpec, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TemplateSpec + }, + 201: { + bodyMapper: Mappers.TemplateSpec + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "templateSpec" + ], + mapper: Mappers.TemplateSpecUpdateModel + }, + responses: { + 200: { + bodyMapper: Mappers.TemplateSpec + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName + ], + queryParameters: [ + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpec + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.templateSpecName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Resources/templateSpecs/", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.expand, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TemplateSpecsListResult + }, + default: { + bodyMapper: Mappers.TemplateSpecsError + } + }, + serializer +}; diff --git a/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts new file mode 100644 index 000000000000..05473575de6a --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClient.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import { TokenCredential } from "@azure/core-auth"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { TemplateSpecsClientContext } from "./templateSpecsClientContext"; + + +class TemplateSpecsClient extends TemplateSpecsClientContext { + // Operation groups + templateSpecs: operations.TemplateSpecs; + templateSpecVersions: operations.TemplateSpecVersions; + + /** + * Initializes a new instance of the TemplateSpecsClient class. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId Subscription Id which forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.TemplateSpecsClientOptions) { + super(credentials, subscriptionId, options); + this.templateSpecs = new operations.TemplateSpecs(this); + this.templateSpecVersions = new operations.TemplateSpecVersions(this); + } +} + +// Operation Specifications + +export { + TemplateSpecsClient, + TemplateSpecsClientContext, + Models as TemplateSpecsModels, + Mappers as TemplateSpecsMappers +}; +export * from "./operations"; diff --git a/sdk/templatespecs/arm-templatespecs/src/templateSpecsClientContext.ts b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClientContext.ts new file mode 100644 index 000000000000..1665d84725c4 --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/src/templateSpecsClientContext.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; + +const packageName = "@azure/arm-templatespecs"; +const packageVersion = "1.0.0"; + +export class TemplateSpecsClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials | TokenCredential; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the TemplateSpecsClient class. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId Subscription Id which forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.TemplateSpecsClientOptions) { + 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 = '2021-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/templatespecs/arm-templatespecs/tsconfig.json b/sdk/templatespecs/arm-templatespecs/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/templatespecs/arm-templatespecs/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"] +}