From 18d9d49ecbdfe56a615fbe60b3e69cde8a87c3cb Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 8 Oct 2021 09:43:23 +0000 Subject: [PATCH] CodeGen from PR 16320 in Azure/azure-rest-api-specs Amalladi/extendedlocation update listavailable operations example (#16320) * Updating list operations example * Revert "Updating list operations example" This reverts commit 65e9f1a0d251b413c4d0967a2bdaef3203831bf5. * Updating ListOperations Example Co-authored-by: Aditi --- .../arm-extendedlocation/LICENSE.txt | 21 + .../arm-extendedlocation/README.md | 106 +++ .../arm-extendedlocation/package.json | 59 ++ .../arm-extendedlocation/rollup.config.js | 37 + .../src/customLocations.ts | 750 ++++++++++++++++++ .../src/customLocationsContext.ts | 67 ++ .../arm-extendedlocation/src/models/index.ts | 725 +++++++++++++++++ .../src/models/mappers.ts | 667 ++++++++++++++++ .../src/models/parameters.ts | 87 ++ .../arm-extendedlocation/tsconfig.json | 19 + 10 files changed, 2538 insertions(+) create mode 100644 sdk/extendedlocation/arm-extendedlocation/LICENSE.txt create mode 100644 sdk/extendedlocation/arm-extendedlocation/README.md create mode 100644 sdk/extendedlocation/arm-extendedlocation/package.json create mode 100644 sdk/extendedlocation/arm-extendedlocation/rollup.config.js create mode 100644 sdk/extendedlocation/arm-extendedlocation/src/customLocations.ts create mode 100644 sdk/extendedlocation/arm-extendedlocation/src/customLocationsContext.ts create mode 100644 sdk/extendedlocation/arm-extendedlocation/src/models/index.ts create mode 100644 sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts create mode 100644 sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts create mode 100644 sdk/extendedlocation/arm-extendedlocation/tsconfig.json diff --git a/sdk/extendedlocation/arm-extendedlocation/LICENSE.txt b/sdk/extendedlocation/arm-extendedlocation/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/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/extendedlocation/arm-extendedlocation/README.md b/sdk/extendedlocation/arm-extendedlocation/README.md new file mode 100644 index 000000000000..d941c1ec9cea --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/README.md @@ -0,0 +1,106 @@ +## Azure CustomLocations SDK for JavaScript + +This package contains an isomorphic SDK (runs both in node.js and in browsers) for CustomLocations. + +### 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-extendedlocation` 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-extendedlocation @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 listOperations customLocations as an example written in JavaScript. + +##### Sample code + +```javascript +const { DefaultAzureCredential } = require("@azure/identity"); +const { CustomLocations } = require("@azure/arm-extendedlocation"); +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 CustomLocations(creds, subscriptionId); +client.customLocations.listOperations().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 listOperations customLocations 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-extendedlocation 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/extendedlocation/arm-extendedlocation/README.png) diff --git a/sdk/extendedlocation/arm-extendedlocation/package.json b/sdk/extendedlocation/arm-extendedlocation/package.json new file mode 100644 index 000000000000..33943f5c9fa9 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/package.json @@ -0,0 +1,59 @@ +{ + "name": "@azure/arm-extendedlocation", + "author": "Microsoft Corporation", + "description": "CustomLocations 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-extendedlocation.js", + "module": "./esm/customLocations.js", + "types": "./esm/customLocations.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/extendedlocation/arm-extendedlocation", + "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-extendedlocation.js.map'\" -o ./dist/arm-extendedlocation.min.js ./dist/arm-extendedlocation.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/extendedlocation/arm-extendedlocation/rollup.config.js b/sdk/extendedlocation/arm-extendedlocation/rollup.config.js new file mode 100644 index 000000000000..e8a6d5fb443c --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/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/customLocations.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-extendedlocation.js", + format: "umd", + name: "Azure.ArmExtendedlocation", + 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/extendedlocation/arm-extendedlocation/src/customLocations.ts b/sdk/extendedlocation/arm-extendedlocation/src/customLocations.ts new file mode 100644 index 000000000000..8c6490ad8e9c --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/customLocations.ts @@ -0,0 +1,750 @@ +/* + * 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 msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as Parameters from "./models/parameters"; +import { CustomLocationsContext } from "./customLocationsContext"; + + +class CustomLocations extends CustomLocationsContext { + /** + * Initializes a new instance of the CustomLocations 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 The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.CustomLocationsOptions) { + super(credentials, subscriptionId, options); + } + + /** + * Lists all available Custom Locations operations. + * @param [options] The optional parameters + * @returns Promise + */ + listOperations(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listOperations(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listOperations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listOperationsOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of Custom Locations in the specified subscription. The operation returns properties + * of each Custom Location + * @summary Gets a list of Custom Locations in a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of Custom Locations in the specified subscription and resource group. The operation + * returns properties of each Custom Location. + * @summary Gets a list of Custom Locations in the specified subscription and 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?: msRest.RequestOptionsBase): 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: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets the details of the customLocation with a specified resource group and name. + * @summary Gets a Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates a Custom Location in the specified Subscription and Resource Group + * @summary Creates or updates a Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param parameters Parameters supplied to create or update a Custom Location. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, resourceName: string, parameters: Models.CustomLocation, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,resourceName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription + * Id. + * @summary Deletes a Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,resourceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Updates a Custom Location with the specified Resource Name in the specified Resource Group and + * Subscription. + * @summary Updates a Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, resourceName: string, options?: Models.CustomLocationsUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param callback The callback + */ + update(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, resourceName: string, options: Models.CustomLocationsUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, resourceName: string, options?: Models.CustomLocationsUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Gets the list of the Enabled Resource Types. + * @summary Gets the list of Enabled Resource Types. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param [options] The optional parameters + * @returns Promise + */ + listEnabledResourceTypes(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param callback The callback + */ + listEnabledResourceTypes(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param options The optional parameters + * @param callback The callback + */ + listEnabledResourceTypes(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listEnabledResourceTypes(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listEnabledResourceTypesOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates a Custom Location in the specified Subscription and Resource Group + * @summary Creates or updates a Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param parameters Parameters supplied to create or update a Custom Location. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: Models.CustomLocation, options?: msRest.RequestOptionsBase): Promise { + return this.sendLRORequest( + { + resourceGroupName, + resourceName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription + * Id. + * @summary Deletes a Custom Location. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Custom Locations name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.sendLRORequest( + { + resourceGroupName, + resourceName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists all available Custom Locations operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listOperationsNext(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 + */ + listOperationsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listOperationsNextOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of Custom Locations in the specified subscription. The operation returns properties + * of each Custom Location + * @summary Gets a list of Custom Locations in a subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of Custom Locations in the specified subscription and resource group. The operation + * returns properties of each Custom Location. + * @summary Gets a list of Custom Locations in the specified subscription and 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?: msRest.RequestOptionsBase): 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: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Gets the list of the Enabled Resource Types. + * @summary Gets the list of Enabled Resource Types. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listEnabledResourceTypesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listEnabledResourceTypesNext(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 + */ + listEnabledResourceTypesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listEnabledResourceTypesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + nextPageLink, + options + }, + listEnabledResourceTypesNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.ExtendedLocation/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomLocationOperationsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.ExtendedLocation/customLocations", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomLocation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + identity: [ + "options", + "identity" + ], + authentication: [ + "options", + "authentication" + ], + clusterExtensionIds: [ + "options", + "clusterExtensionIds" + ], + displayName: [ + "options", + "displayName" + ], + hostResourceId: [ + "options", + "hostResourceId" + ], + hostType: [ + "options", + "hostType" + ], + namespace: [ + "options", + "namespace" + ], + provisioningState: [ + "options", + "provisioningState" + ], + tags: [ + "options", + "tags" + ] + }, + mapper: { + ...Mappers.PatchableCustomLocations, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CustomLocation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listEnabledResourceTypesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/enabledResourceTypes", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EnabledResourceTypesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.CustomLocation, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CustomLocation + }, + 201: { + bodyMapper: Mappers.CustomLocation + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationsNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomLocationOperationsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CustomLocationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listEnabledResourceTypesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EnabledResourceTypesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +export { + CustomLocations, + CustomLocationsContext, + Models as CustomLocationsModels, + Mappers as CustomLocationsMappers +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/customLocationsContext.ts b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsContext.ts new file mode 100644 index 000000000000..bcea0c190dcc --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/customLocationsContext.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-extendedlocation"; +const packageVersion = "1.0.0"; + +export class CustomLocationsContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials | TokenCredential; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the CustomLocations 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 The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.CustomLocationsOptions) { + 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-08-15'; + 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/extendedlocation/arm-extendedlocation/src/models/index.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts new file mode 100644 index 000000000000..94e8b7af0ee9 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/index.ts @@ -0,0 +1,725 @@ +/* + * 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 }; + +/** + * Metadata of the Resource Type. + */ +export interface EnabledResourceTypePropertiesTypesMetadataItem { + /** + * Api Version of Resource Type + */ + apiVersion?: string; + /** + * Resource Provider Namespace of Resource Type + */ + resourceProviderNamespace?: string; + /** + * Resource Type + */ + resourceType?: 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; +} + +/** + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource + */ +export interface Resource extends BaseResource { + /** + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts" + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags + * and a location + * @summary Proxy Resource + */ +export interface ProxyResource extends Resource { +} + +/** + * EnabledResourceType definition. + */ +export interface EnabledResourceType extends ProxyResource { + /** + * Cluster Extension ID + */ + clusterExtensionId?: string; + /** + * Cluster Extension Type + */ + extensionType?: string; + /** + * Metadata of the Resource Type + */ + typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[]; + /** + * Metadata pertaining to creation and last modification of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + +/** + * Identity for the resource. + */ +export interface Identity { + /** + * The principal ID of resource identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * The identity type. Possible values include: 'SystemAssigned', 'None' + */ + type?: ResourceIdentityType; +} + +/** + * This is optional input that contains the authentication that should be used to generate the + * namespace. + */ +export interface CustomLocationPropertiesAuthentication { + /** + * The type of the Custom Locations authentication + */ + type?: string; + /** + * The kubeconfig value. + */ + value?: string; +} + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has + * 'tags' and a 'location' + * @summary Tracked Resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * Custom Locations definition. + */ +export interface CustomLocation extends TrackedResource { + /** + * Identity for the resource. + */ + identity?: Identity; + /** + * This is optional input that contains the authentication that should be used to generate the + * namespace. + */ + authentication?: CustomLocationPropertiesAuthentication; + /** + * Contains the reference to the add-on that contains charts to deploy CRDs and operators. + */ + clusterExtensionIds?: string[]; + /** + * Display name for the Custom Locations location. + */ + displayName?: string; + /** + * Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for + * listAdminCredentials permissions. + */ + hostResourceId?: string; + /** + * Type of host the Custom Locations is referencing (Kubernetes, etc...). Possible values + * include: 'Kubernetes' + */ + hostType?: HostType; + /** + * Kubernetes namespace that will be created on the specified cluster. + */ + namespace?: string; + /** + * Provisioning State for the Custom Location. + */ + provisioningState?: string; + /** + * Metadata pertaining to creation and last modification of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + +/** + * Custom Locations operation. + */ +export interface CustomLocationOperation { + /** + * The description of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * The display name of the compute operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operation?: string; + /** + * The resource provider for the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provider?: string; + /** + * The display name of the resource the operation applies to. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resource?: string; + /** + * Is this Operation a data plane operation + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isDataAction?: boolean; + /** + * The name of the compute operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The origin of the compute operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly origin?: string; +} + +/** + * The Custom Locations patchable resource definition. + */ +export interface PatchableCustomLocations extends BaseResource { + /** + * Identity for the resource. + */ + identity?: Identity; + /** + * This is optional input that contains the authentication that should be used to generate the + * namespace. + */ + authentication?: CustomLocationPropertiesAuthentication; + /** + * Contains the reference to the add-on that contains charts to deploy CRDs and operators. + */ + clusterExtensionIds?: string[]; + /** + * Display name for the Custom Locations location. + */ + displayName?: string; + /** + * Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for + * listAdminCredentials permissions. + */ + hostResourceId?: string; + /** + * Type of host the Custom Locations is referencing (Kubernetes, etc...). Possible values + * include: 'Kubernetes' + */ + hostType?: HostType; + /** + * Kubernetes namespace that will be created on the specified cluster. + */ + namespace?: string; + /** + * Provisioning State for the Custom Location. + */ + provisioningState?: string; + /** + * Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * The resource model definition for an Azure Resource Manager resource with an etag. + * @summary Entity Resource + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + +/** + * 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; +} + +/** + * The error detail. + */ +export interface ErrorDetail { + /** + * 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?: ErrorDetail[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** + * 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 object. + */ + error?: ErrorDetail; +} + +/** + * Optional Parameters. + */ +export interface CustomLocationsUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Identity for the resource. + */ + identity?: Identity; + /** + * This is optional input that contains the authentication that should be used to generate the + * namespace. + */ + authentication?: CustomLocationPropertiesAuthentication; + /** + * Contains the reference to the add-on that contains charts to deploy CRDs and operators. + */ + clusterExtensionIds?: string[]; + /** + * Display name for the Custom Locations location. + */ + displayName?: string; + /** + * Connected Cluster or AKS Cluster. The Custom Locations RP will perform a checkAccess API for + * listAdminCredentials permissions. + */ + hostResourceId?: string; + /** + * Type of host the Custom Locations is referencing (Kubernetes, etc...). Possible values + * include: 'Kubernetes' + */ + hostType?: HostType; + /** + * Kubernetes namespace that will be created on the specified cluster. + */ + namespace?: string; + /** + * Provisioning State for the Custom Location. + */ + provisioningState?: string; + /** + * Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * An interface representing CustomLocationsOptions. + */ +export interface CustomLocationsOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * Lists of Custom Locations operations. + * @extends Array + */ +export interface CustomLocationOperationsList extends Array { + /** + * Next page of operations. + */ + nextLink?: string; +} + +/** + * @interface + * The List Custom Locations operation response. + * @extends Array + */ +export interface CustomLocationListResult 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 EnabledResourceTypes definition. + * @extends Array + */ +export interface EnabledResourceTypesListResult 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 ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'None' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = 'SystemAssigned' | 'None'; + +/** + * Defines values for HostType. + * Possible values include: 'Kubernetes' + * @readonly + * @enum {string} + */ +export type HostType = 'Kubernetes'; + +/** + * Contains response data for the listOperations operation. + */ +export type CustomLocationsListOperationsResponse = CustomLocationOperationsList & { + /** + * 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: CustomLocationOperationsList; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type CustomLocationsListBySubscriptionResponse = CustomLocationListResult & { + /** + * 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: CustomLocationListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type CustomLocationsListByResourceGroupResponse = CustomLocationListResult & { + /** + * 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: CustomLocationListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CustomLocationsGetResponse = CustomLocation & { + /** + * 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: CustomLocation; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type CustomLocationsCreateOrUpdateResponse = CustomLocation & { + /** + * 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: CustomLocation; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type CustomLocationsUpdateResponse = CustomLocation & { + /** + * 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: CustomLocation; + }; +}; + +/** + * Contains response data for the listEnabledResourceTypes operation. + */ +export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypesListResult & { + /** + * 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: EnabledResourceTypesListResult; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type CustomLocationsBeginCreateOrUpdateResponse = CustomLocation & { + /** + * 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: CustomLocation; + }; +}; + +/** + * Contains response data for the listOperationsNext operation. + */ +export type CustomLocationsListOperationsNextResponse = CustomLocationOperationsList & { + /** + * 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: CustomLocationOperationsList; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type CustomLocationsListBySubscriptionNextResponse = CustomLocationListResult & { + /** + * 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: CustomLocationListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type CustomLocationsListByResourceGroupNextResponse = CustomLocationListResult & { + /** + * 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: CustomLocationListResult; + }; +}; + +/** + * Contains response data for the listEnabledResourceTypesNext operation. + */ +export type CustomLocationsListEnabledResourceTypesNextResponse = EnabledResourceTypesListResult & { + /** + * 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: EnabledResourceTypesListResult; + }; +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts new file mode 100644 index 000000000000..40c3adcb2d61 --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/mappers.ts @@ -0,0 +1,667 @@ +/* + * 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 EnabledResourceTypePropertiesTypesMetadataItem: msRest.CompositeMapper = { + serializedName: "EnabledResourceTypeProperties_typesMetadataItem", + type: { + name: "Composite", + className: "EnabledResourceTypePropertiesTypesMetadataItem", + modelProperties: { + apiVersion: { + serializedName: "apiVersion", + type: { + name: "String" + } + }, + resourceProviderNamespace: { + serializedName: "resourceProviderNamespace", + type: { + name: "String" + } + }, + resourceType: { + serializedName: "resourceType", + 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 Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const EnabledResourceType: msRest.CompositeMapper = { + serializedName: "EnabledResourceType", + type: { + name: "Composite", + className: "EnabledResourceType", + modelProperties: { + ...ProxyResource.type.modelProperties, + clusterExtensionId: { + serializedName: "properties.clusterExtensionId", + type: { + name: "String" + } + }, + extensionType: { + serializedName: "properties.extensionType", + type: { + name: "String" + } + }, + typesMetadata: { + serializedName: "properties.typesMetadata", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnabledResourceTypePropertiesTypesMetadataItem" + } + } + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const Identity: msRest.CompositeMapper = { + serializedName: "Identity", + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CustomLocationPropertiesAuthentication: msRest.CompositeMapper = { + serializedName: "customLocationProperties_authentication", + type: { + name: "Composite", + className: "CustomLocationPropertiesAuthentication", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const CustomLocation: msRest.CompositeMapper = { + serializedName: "customLocation", + type: { + name: "Composite", + className: "CustomLocation", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + authentication: { + serializedName: "properties.authentication", + type: { + name: "Composite", + className: "CustomLocationPropertiesAuthentication" + } + }, + clusterExtensionIds: { + serializedName: "properties.clusterExtensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + hostResourceId: { + serializedName: "properties.hostResourceId", + type: { + name: "String" + } + }, + hostType: { + serializedName: "properties.hostType", + type: { + name: "String" + } + }, + namespace: { + serializedName: "properties.namespace", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const CustomLocationOperation: msRest.CompositeMapper = { + serializedName: "customLocationOperation", + type: { + name: "Composite", + className: "CustomLocationOperation", + modelProperties: { + description: { + readOnly: true, + serializedName: "display.description", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "display.operation", + type: { + name: "String" + } + }, + provider: { + readOnly: true, + serializedName: "display.provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "display.resource", + type: { + name: "String" + } + }, + isDataAction: { + readOnly: true, + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + origin: { + readOnly: true, + serializedName: "origin", + type: { + name: "String" + } + } + } + } +}; + +export const PatchableCustomLocations: msRest.CompositeMapper = { + serializedName: "patchableCustomLocations", + type: { + name: "Composite", + className: "PatchableCustomLocations", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + authentication: { + serializedName: "properties.authentication", + type: { + name: "Composite", + className: "CustomLocationPropertiesAuthentication" + } + }, + clusterExtensionIds: { + serializedName: "properties.clusterExtensionIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + hostResourceId: { + serializedName: "properties.hostResourceId", + type: { + name: "String" + } + }, + hostType: { + serializedName: "properties.hostType", + type: { + name: "String" + } + }, + namespace: { + serializedName: "properties.namespace", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const 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 ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", + type: { + name: "Composite", + className: "ErrorDetail", + 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: "ErrorDetail" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const CustomLocationOperationsList: msRest.CompositeMapper = { + serializedName: "customLocationOperationsList", + type: { + name: "Composite", + className: "CustomLocationOperationsList", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomLocationOperation" + } + } + } + } + } + } +}; + +export const CustomLocationListResult: msRest.CompositeMapper = { + serializedName: "customLocationListResult", + type: { + name: "Composite", + className: "CustomLocationListResult", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CustomLocation" + } + } + } + } + } + } +}; + +export const EnabledResourceTypesListResult: msRest.CompositeMapper = { + serializedName: "EnabledResourceTypesListResult", + type: { + name: "Composite", + className: "EnabledResourceTypesListResult", + modelProperties: { + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnabledResourceType" + } + } + } + } + } + } +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts b/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts new file mode 100644 index 000000000000..85032a2cb5cf --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/src/models/parameters.ts @@ -0,0 +1,87 @@ +/* + * 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", + constraints: { + MinLength: 1 + }, + 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 + }, + type: { + name: "String" + } + } +}; +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + required: true, + serializedName: "resourceName", + constraints: { + MaxLength: 63, + MinLength: 1, + Pattern: /^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/extendedlocation/arm-extendedlocation/tsconfig.json b/sdk/extendedlocation/arm-extendedlocation/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/extendedlocation/arm-extendedlocation/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"] +}