From 2562d627ffb06e5c836878ea5e341b53c864951d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 22 Apr 2021 01:36:14 +0000 Subject: [PATCH] CodeGen from PR 14061 in Azure/azure-rest-api-specs update (#14061) --- sdk/kusto/arm-kusto/README.md | 43 +- sdk/kusto/arm-kusto/rollup.config.js | 10 +- .../arm-kusto/src/kustoManagementClient.ts | 7 +- .../src/kustoManagementClientContext.ts | 23 +- sdk/kusto/arm-kusto/src/models/index.ts | 1334 ++++++++--------- sdk/kusto/arm-kusto/src/models/mappers.ts | 31 +- .../src/models/operationsResultsMappers.ts | 6 +- sdk/kusto/arm-kusto/src/models/parameters.ts | 12 +- .../attachedDatabaseConfigurations.ts | 171 +-- .../operations/clusterPrincipalAssignments.ts | 219 +-- .../arm-kusto/src/operations/clusters.ts | 684 ++++----- .../src/operations/dataConnections.ts | 308 ++-- .../databasePrincipalAssignments.ts | 227 +-- .../arm-kusto/src/operations/databases.ts | 402 ++--- .../arm-kusto/src/operations/operations.ts | 58 +- .../src/operations/operationsResults.ts | 46 +- sdk/kusto/arm-kusto/src/operations/scripts.ts | 265 +--- 17 files changed, 1462 insertions(+), 2384 deletions(-) diff --git a/sdk/kusto/arm-kusto/README.md b/sdk/kusto/arm-kusto/README.md index ecc394710389..e79b537a658f 100644 --- a/sdk/kusto/arm-kusto/README.md +++ b/sdk/kusto/arm-kusto/README.md @@ -20,7 +20,6 @@ npm install @azure/arm-kusto ##### Install @azure/ms-rest-nodeauth - Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. - ```bash npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` @@ -28,26 +27,22 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package - ```typescript const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); const { KustoManagementClient } = require("@azure/arm-kusto"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; -msRestNodeAuth - .interactiveLogin() - .then((creds) => { - const client = new KustoManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const clusterName = "testclusterName"; - client.clusters.get(resourceGroupName, clusterName).then((result) => { - console.log("The result is:"); - console.log(result); - }); - }) - .catch((err) => { - console.error(err); +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new KustoManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const clusterName = "testclusterName"; + client.clusters.get(resourceGroupName, clusterName).then((result) => { + console.log("The result is:"); + console.log(result); }); +}).catch((err) => { + console.error(err); +}); ``` #### browser - Authentication, client creation and get clusters as an example written in JavaScript. @@ -63,7 +58,6 @@ npm install @azure/ms-rest-browserauth See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - index.html - ```html @@ -87,16 +81,13 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to const client = new Azure.ArmKusto.KustoManagementClient(res.creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; const clusterName = "testclusterName"; - client.clusters - .get(resourceGroupName, clusterName) - .then((result) => { - console.log("The result is:"); - console.log(result); - }) - .catch((err) => { - console.log("An error occurred:"); - console.error(err); - }); + client.clusters.get(resourceGroupName, clusterName).then((result) => { + console.log("The result is:"); + console.log(result); + }).catch((err) => { + console.log("An error occurred:"); + console.error(err); + }); }); diff --git a/sdk/kusto/arm-kusto/rollup.config.js b/sdk/kusto/arm-kusto/rollup.config.js index 23dfac7c4530..7cdacd3bd768 100644 --- a/sdk/kusto/arm-kusto/rollup.config.js +++ b/sdk/kusto/arm-kusto/rollup.config.js @@ -7,7 +7,10 @@ import sourcemaps from "rollup-plugin-sourcemaps"; */ const config = { input: "./esm/kustoManagementClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-kusto.js", format: "umd", @@ -25,7 +28,10 @@ const config = { * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] }; export default config; diff --git a/sdk/kusto/arm-kusto/src/kustoManagementClient.ts b/sdk/kusto/arm-kusto/src/kustoManagementClient.ts index 9131be10fd4c..8fed05158d5b 100644 --- a/sdk/kusto/arm-kusto/src/kustoManagementClient.ts +++ b/sdk/kusto/arm-kusto/src/kustoManagementClient.ts @@ -13,6 +13,7 @@ import * as Mappers from "./models/mappers"; import * as operations from "./operations"; import { KustoManagementClientContext } from "./kustoManagementClientContext"; + class KustoManagementClient extends KustoManagementClientContext { // Operation groups clusters: operations.Clusters; @@ -32,11 +33,7 @@ class KustoManagementClient extends KustoManagementClientContext { * subscription. The subscription ID forms part of the URI for every service call. * @param [options] The parameter options */ - constructor( - credentials: msRest.ServiceClientCredentials, - subscriptionId: string, - options?: Models.KustoManagementClientOptions - ) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.KustoManagementClientOptions) { super(credentials, subscriptionId, options); this.clusters = new operations.Clusters(this); this.clusterPrincipalAssignments = new operations.ClusterPrincipalAssignments(this); diff --git a/sdk/kusto/arm-kusto/src/kustoManagementClientContext.ts b/sdk/kusto/arm-kusto/src/kustoManagementClientContext.ts index c7cc3b8f0a69..7033ede5eef6 100644 --- a/sdk/kusto/arm-kusto/src/kustoManagementClientContext.ts +++ b/sdk/kusto/arm-kusto/src/kustoManagementClientContext.ts @@ -26,43 +26,36 @@ export class KustoManagementClientContext extends msRestAzure.AzureServiceClient * subscription. The subscription ID forms part of the URI for every service call. * @param [options] The parameter options */ - constructor( - credentials: msRest.ServiceClientCredentials, - subscriptionId: string, - options?: Models.KustoManagementClientOptions - ) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.KustoManagementClientOptions) { if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); + throw new Error('\'credentials\' cannot be null.'); } if (subscriptionId == undefined) { - throw new Error("'subscriptionId' cannot be null."); + throw new Error('\'subscriptionId\' cannot be null.'); } if (!options) { options = {}; } - if (!options.userAgent) { + if(!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = "2021-01-01"; - this.acceptLanguage = "en-US"; + this.apiVersion = '2021-01-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) { + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if ( - options.longRunningOperationRetryTimeout !== null && - options.longRunningOperationRetryTimeout !== undefined - ) { + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/kusto/arm-kusto/src/models/index.ts b/sdk/kusto/arm-kusto/src/models/index.ts index b46cd739e509..8092fe6ef4de 100644 --- a/sdk/kusto/arm-kusto/src/models/index.ts +++ b/sdk/kusto/arm-kusto/src/models/index.ts @@ -516,7 +516,8 @@ export interface ClusterUpdate extends Resource { * and a location * @summary Proxy Resource */ -export interface ProxyResource extends Resource {} +export interface ProxyResource extends Resource { +} /** * Class representing an attached database configuration. @@ -907,11 +908,7 @@ export interface FollowerDatabaseDefinition { /** * Contains the possible cases for DataConnection. */ -export type DataConnectionUnion = - | DataConnection - | EventHubDataConnection - | IotHubDataConnection - | EventGridDataConnection; +export type DataConnectionUnion = DataConnection | EventHubDataConnection | IotHubDataConnection | EventGridDataConnection; /** * Class representing an data connection. @@ -1477,85 +1474,96 @@ export interface KustoManagementClientOptions extends AzureServiceClientOptions * The list Kusto database principals operation response. * @extends Array */ -export interface FollowerDatabaseListResult extends Array {} +export interface FollowerDatabaseListResult extends Array { +} /** * @interface * The list Kusto clusters operation response. * @extends Array */ -export interface ClusterListResult extends Array {} +export interface ClusterListResult extends Array { +} /** * @interface * The list of the EngagementFabric SKU descriptions * @extends Array */ -export interface SkuDescriptionList extends Array {} +export interface SkuDescriptionList extends Array { +} /** * @interface * List of available SKUs for a Kusto Cluster. * @extends Array */ -export interface ListResourceSkusResult extends Array {} +export interface ListResourceSkusResult extends Array { +} /** * @interface * The list of language extension objects. * @extends Array */ -export interface LanguageExtensionsList extends Array {} +export interface LanguageExtensionsList extends Array { +} /** * @interface * The list Kusto cluster principal assignments operation response. * @extends Array */ -export interface ClusterPrincipalAssignmentListResult extends Array {} +export interface ClusterPrincipalAssignmentListResult extends Array { +} /** * @interface * The list Kusto databases operation response. * @extends Array */ -export interface DatabaseListResult extends Array {} +export interface DatabaseListResult extends Array { +} /** * @interface * The list Kusto database principals operation response. * @extends Array */ -export interface DatabasePrincipalListResult extends Array {} +export interface DatabasePrincipalListResult extends Array { +} /** * @interface * The list Kusto database principal assignments operation response. * @extends Array */ -export interface DatabasePrincipalAssignmentListResult extends Array {} +export interface DatabasePrincipalAssignmentListResult extends Array { +} /** * @interface * The list Kusto database script operation response. * @extends Array