From 7ce08ea073aeb9453e112a7690106a86b3b85cb6 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 29 Mar 2019 18:08:23 +0000 Subject: [PATCH 1/2] Generated from 752211789b15f63fbdb1c0826be94bfd7448fcde Add IOT central app templates api in swagger --- packages/@azure/arm-iotcentral/LICENSE.txt | 42 ++-- packages/@azure/arm-iotcentral/README.md | 203 +++++++++--------- .../arm-iotcentral/lib/iotCentralClient.ts | 6 +- .../lib/iotCentralClientContext.ts | 11 +- .../arm-iotcentral/lib/models/appsMappers.ts | 4 +- .../@azure/arm-iotcentral/lib/models/index.ts | 117 ++++++++++ .../arm-iotcentral/lib/models/mappers.ts | 81 +++++++ .../arm-iotcentral/lib/models/parameters.ts | 10 + .../arm-iotcentral/lib/operations/apps.ts | 144 +++++++++++++ packages/@azure/arm-iotcentral/package.json | 8 +- .../@azure/arm-iotcentral/rollup.config.js | 22 +- 11 files changed, 507 insertions(+), 141 deletions(-) diff --git a/packages/@azure/arm-iotcentral/LICENSE.txt b/packages/@azure/arm-iotcentral/LICENSE.txt index a70e8cf66038..8f3d856145c5 100644 --- a/packages/@azure/arm-iotcentral/LICENSE.txt +++ b/packages/@azure/arm-iotcentral/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 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. +The MIT License (MIT) + +Copyright (c) 2019 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/arm-iotcentral/README.md b/packages/@azure/arm-iotcentral/README.md index 0c0bf65eb45f..853497781966 100644 --- a/packages/@azure/arm-iotcentral/README.md +++ b/packages/@azure/arm-iotcentral/README.md @@ -1,103 +1,100 @@ -## Azure IotCentralClient SDK for JavaScript - -This package contains an isomorphic SDK for IotCentralClient. - -### Currently supported environments - -- Node.js version 6.x.x or higher -- Browser JavaScript - -### How to Install - -``` -npm install @azure/arm-iotcentral -``` - -### How to use - -#### nodejs - Authentication, client creation and get apps as an example written in TypeScript. - -##### Install @azure/ms-rest-nodeauth - -``` -npm install @azure/ms-rest-nodeauth -``` - -##### Sample code - -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { IotCentralClient, IotCentralModels, IotCentralMappers } from "@azure/arm-iotcentral"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new IotCentralClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const resourceName = "testresourceName"; - client.apps.get(resourceGroupName, resourceName).then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); -``` - -#### browser - Authentication, client creation and get apps as an example written in JavaScript. - -##### Install @azure/ms-rest-browserauth - -``` -npm install @azure/ms-rest-browserauth -``` - -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-iotcentral 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%2Fpackages%2F%40azure%2Farm-iotcentral%2FREADME.png) +## Azure IotCentralClient SDK for JavaScript + +This package contains an isomorphic SDK for IotCentralClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-iotcentral +``` + +### How to use + +#### nodejs - Authentication, client creation and get apps as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +```bash +npm install @azure/ms-rest-nodeauth +``` + +##### Sample code + +```typescript +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; +import { IotCentralClient, IotCentralModels, IotCentralMappers } from "@azure/arm-iotcentral"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new IotCentralClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const resourceName = "testresourceName"; + client.apps.get(resourceGroupName, resourceName).then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and get apps as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-iotcentral sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts b/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts index 6a0d6dda5658..295f486b1f08 100644 --- a/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts +++ b/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts @@ -24,10 +24,12 @@ class IotCentralClient extends IotCentralClientContext { * Initializes a new instance of the IotCentralClient class. * @param credentials Credentials needed for the client to connect to Azure. * @param subscriptionId The subscription identifier. + * @param applicationTemplateId The combination id of manifestId and manifestVersion of the IoT + * Central application template. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotCentralClientOptions) { - super(credentials, subscriptionId, options); + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, applicationTemplateId: string, options?: Models.IotCentralClientOptions) { + super(credentials, subscriptionId, applicationTemplateId, options); this.apps = new operations.Apps(this); this.operations = new operations.Operations(this); } diff --git a/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts b/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts index 5f37b9da45dd..d2258649da63 100644 --- a/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts +++ b/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts @@ -13,26 +13,32 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-iotcentral"; -const packageVersion = "0.1.0"; +const packageVersion = "2.1.0"; export class IotCentralClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; subscriptionId: string; apiVersion?: string; + applicationTemplateId: string; /** * Initializes a new instance of the IotCentralClient class. * @param credentials Credentials needed for the client to connect to Azure. * @param subscriptionId The subscription identifier. + * @param applicationTemplateId The combination id of manifestId and manifestVersion of the IoT + * Central application template. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotCentralClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, applicationTemplateId: string, options?: Models.IotCentralClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } if (subscriptionId == undefined) { throw new Error('\'subscriptionId\' cannot be null.'); } + if (applicationTemplateId == undefined) { + throw new Error('\'applicationTemplateId\' cannot be null.'); + } if (!options) { options = {}; @@ -51,6 +57,7 @@ export class IotCentralClientContext extends msRestAzure.AzureServiceClient { this.requestContentType = "application/json; charset=utf-8"; this.credentials = credentials; this.subscriptionId = subscriptionId; + this.applicationTemplateId = applicationTemplateId; if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; diff --git a/packages/@azure/arm-iotcentral/lib/models/appsMappers.ts b/packages/@azure/arm-iotcentral/lib/models/appsMappers.ts index 5f2f87479734..9f769830df86 100644 --- a/packages/@azure/arm-iotcentral/lib/models/appsMappers.ts +++ b/packages/@azure/arm-iotcentral/lib/models/appsMappers.ts @@ -18,6 +18,8 @@ export { AppPatch, AppListResult, OperationInputs, - AppAvailabilityInfo + AppAvailabilityInfo, + AppTemplate, + AppTemplatesResult } from "../models/mappers"; diff --git a/packages/@azure/arm-iotcentral/lib/models/index.ts b/packages/@azure/arm-iotcentral/lib/models/index.ts index 4430cc8c4dc4..a820222d97f5 100644 --- a/packages/@azure/arm-iotcentral/lib/models/index.ts +++ b/packages/@azure/arm-iotcentral/lib/models/index.ts @@ -299,6 +299,51 @@ export interface AppAvailabilityInfo { readonly message?: string; } +/** + * @interface + * An interface representing AppTemplate. + * IoT Central Application Template. + * + */ +export interface AppTemplate { + /** + * @member {string} [manifestId] The ID of the template. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly manifestId?: string; + /** + * @member {string} [manifestVersion] The version of the template. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly manifestVersion?: string; + /** + * @member {string} [name] The name of the template. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [title] The title of the template. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly title?: string; + /** + * @member {number} [order] The order of the template in the templates list. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly order?: number; + /** + * @member {string} [description] The description of the template. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; +} + /** * @interface * An interface representing IotCentralClientOptions. @@ -327,6 +372,21 @@ export interface AppListResult extends Array { nextLink?: string; } +/** + * @interface + * An interface representing the AppTemplatesResult. + * A list of IoT Central Application Templates with a next link. + * + * @extends Array + */ +export interface AppTemplatesResult extends Array { + /** + * @member {string} [nextLink] The link used to get the next page of IoT + * Central application templates. + */ + nextLink?: string; +} + /** * @interface * An interface representing the OperationListResult. @@ -484,6 +544,44 @@ export type AppsCheckSubdomainAvailabilityResponse = AppAvailabilityInfo & { }; }; +/** + * Contains response data for the template operation. + */ +export type AppsTemplateResponse = AppTemplate & { + /** + * 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: AppTemplate; + }; +}; + +/** + * Contains response data for the listTemplates operation. + */ +export type AppsListTemplatesResponse = AppTemplatesResult & { + /** + * 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: AppTemplatesResult; + }; +}; + /** * Contains response data for the beginCreateOrUpdate operation. */ @@ -560,6 +658,25 @@ export type AppsListByResourceGroupNextResponse = AppListResult & { }; }; +/** + * Contains response data for the listTemplatesNext operation. + */ +export type AppsListTemplatesNextResponse = AppTemplatesResult & { + /** + * 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: AppTemplatesResult; + }; +}; + /** * Contains response data for the list operation. */ diff --git a/packages/@azure/arm-iotcentral/lib/models/mappers.ts b/packages/@azure/arm-iotcentral/lib/models/mappers.ts index 18603c7057d8..69f6f25f2f71 100644 --- a/packages/@azure/arm-iotcentral/lib/models/mappers.ts +++ b/packages/@azure/arm-iotcentral/lib/models/mappers.ts @@ -391,6 +391,58 @@ export const AppAvailabilityInfo: msRest.CompositeMapper = { } }; +export const AppTemplate: msRest.CompositeMapper = { + serializedName: "AppTemplate", + type: { + name: "Composite", + className: "AppTemplate", + modelProperties: { + manifestId: { + readOnly: true, + serializedName: "manifestId", + type: { + name: "String" + } + }, + manifestVersion: { + readOnly: true, + serializedName: "manifestVersion", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + title: { + readOnly: true, + serializedName: "title", + type: { + name: "String" + } + }, + order: { + readOnly: true, + serializedName: "order", + type: { + name: "Number" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + export const AppListResult: msRest.CompositeMapper = { serializedName: "AppListResult", type: { @@ -419,6 +471,35 @@ export const AppListResult: msRest.CompositeMapper = { } }; +export const AppTemplatesResult: msRest.CompositeMapper = { + serializedName: "AppTemplatesResult", + type: { + name: "Composite", + className: "AppTemplatesResult", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AppTemplate" + } + } + } + } + } + } +}; + export const OperationListResult: msRest.CompositeMapper = { serializedName: "OperationListResult", type: { diff --git a/packages/@azure/arm-iotcentral/lib/models/parameters.ts b/packages/@azure/arm-iotcentral/lib/models/parameters.ts index 52c2fc91f383..043e6661bf22 100644 --- a/packages/@azure/arm-iotcentral/lib/models/parameters.ts +++ b/packages/@azure/arm-iotcentral/lib/models/parameters.ts @@ -30,6 +30,16 @@ export const apiVersion: msRest.OperationQueryParameter = { } } }; +export const applicationTemplateId: msRest.OperationURLParameter = { + parameterPath: "applicationTemplateId", + mapper: { + required: true, + serializedName: "applicationTemplateId", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { diff --git a/packages/@azure/arm-iotcentral/lib/operations/apps.ts b/packages/@azure/arm-iotcentral/lib/operations/apps.ts index c5d2ed7934eb..3b575324f828 100644 --- a/packages/@azure/arm-iotcentral/lib/operations/apps.ts +++ b/packages/@azure/arm-iotcentral/lib/operations/apps.ts @@ -222,6 +222,54 @@ export class Apps { callback) as Promise; } + /** + * Get a single application template. + * @param [options] The optional parameters + * @returns Promise + */ + template(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + template(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + template(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + template(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + templateOperationSpec, + callback) as Promise; + } + + /** + * Get all available application templates. + * @param [options] The optional parameters + * @returns Promise + */ + listTemplates(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listTemplates(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listTemplates(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTemplates(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listTemplatesOperationSpec, + callback) as Promise; + } + /** * Create or update the metadata of an IoT Central application. The usual pattern to modify a * property is to retrieve the IoT Central application metadata and security metadata, and then @@ -340,6 +388,34 @@ export class Apps { listByResourceGroupNextOperationSpec, callback) as Promise; } + + /** + * Get all available application templates. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listTemplatesNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listTemplatesNext(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 + */ + listTemplatesNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listTemplatesNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listTemplatesNextOperationSpec, + callback) as Promise; + } } // Operation Specifications @@ -476,6 +552,53 @@ const checkSubdomainAvailabilityOperationSpec: msRest.OperationSpec = { serializer }; +const templateOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/applicationTemplates/{applicationTemplateId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.applicationTemplateId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppTemplate + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const listTemplatesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/applicationTemplates", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppTemplatesResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/IoTApps/{resourceName}", @@ -611,3 +734,24 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { }, serializer }; + +const listTemplatesNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AppTemplatesResult + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; diff --git a/packages/@azure/arm-iotcentral/package.json b/packages/@azure/arm-iotcentral/package.json index 3cae75fe764b..907f4e676c50 100644 --- a/packages/@azure/arm-iotcentral/package.json +++ b/packages/@azure/arm-iotcentral/package.json @@ -4,8 +4,8 @@ "description": "IotCentralClient Library with typescript type definitions for node.js and browser.", "version": "2.1.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -23,6 +23,7 @@ "typescript": "^3.1.1", "rollup": "^0.66.2", "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-iotcentral", @@ -51,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-iotcentral.js.map'\" -o ./dist/arm-iotcentral.min.js ./dist/arm-iotcentral.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/packages/@azure/arm-iotcentral/rollup.config.js b/packages/@azure/arm-iotcentral/rollup.config.js index c2695e9d6fa1..5867cd5ab746 100644 --- a/packages/@azure/arm-iotcentral/rollup.config.js +++ b/packages/@azure/arm-iotcentral/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/iotCentralClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/iotCentralClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-iotcentral.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ module: true }), + sourcemaps() ] }; + export default config; From bd23903576b18b87f380dcddfa28bf5d4c0d608e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 29 Mar 2019 18:16:05 +0000 Subject: [PATCH 2/2] Generated from 082507c238868ecda88f3939d399f3b29cd7357b Add IOT central app templates api in swagger --- .../@azure/arm-iotcentral/lib/iotCentralClient.ts | 6 ++---- .../arm-iotcentral/lib/iotCentralClientContext.ts | 9 +-------- .../@azure/arm-iotcentral/lib/operations/apps.ts | 15 +++++++++++---- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts b/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts index 295f486b1f08..6a0d6dda5658 100644 --- a/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts +++ b/packages/@azure/arm-iotcentral/lib/iotCentralClient.ts @@ -24,12 +24,10 @@ class IotCentralClient extends IotCentralClientContext { * Initializes a new instance of the IotCentralClient class. * @param credentials Credentials needed for the client to connect to Azure. * @param subscriptionId The subscription identifier. - * @param applicationTemplateId The combination id of manifestId and manifestVersion of the IoT - * Central application template. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, applicationTemplateId: string, options?: Models.IotCentralClientOptions) { - super(credentials, subscriptionId, applicationTemplateId, options); + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotCentralClientOptions) { + super(credentials, subscriptionId, options); this.apps = new operations.Apps(this); this.operations = new operations.Operations(this); } diff --git a/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts b/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts index d2258649da63..2fd9d4e530e7 100644 --- a/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts +++ b/packages/@azure/arm-iotcentral/lib/iotCentralClientContext.ts @@ -19,26 +19,20 @@ export class IotCentralClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; subscriptionId: string; apiVersion?: string; - applicationTemplateId: string; /** * Initializes a new instance of the IotCentralClient class. * @param credentials Credentials needed for the client to connect to Azure. * @param subscriptionId The subscription identifier. - * @param applicationTemplateId The combination id of manifestId and manifestVersion of the IoT - * Central application template. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, applicationTemplateId: string, options?: Models.IotCentralClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotCentralClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } if (subscriptionId == undefined) { throw new Error('\'subscriptionId\' cannot be null.'); } - if (applicationTemplateId == undefined) { - throw new Error('\'applicationTemplateId\' cannot be null.'); - } if (!options) { options = {}; @@ -57,7 +51,6 @@ export class IotCentralClientContext extends msRestAzure.AzureServiceClient { this.requestContentType = "application/json; charset=utf-8"; this.credentials = credentials; this.subscriptionId = subscriptionId; - this.applicationTemplateId = applicationTemplateId; if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; diff --git a/packages/@azure/arm-iotcentral/lib/operations/apps.ts b/packages/@azure/arm-iotcentral/lib/operations/apps.ts index 3b575324f828..2e507cebeffc 100644 --- a/packages/@azure/arm-iotcentral/lib/operations/apps.ts +++ b/packages/@azure/arm-iotcentral/lib/operations/apps.ts @@ -224,22 +224,29 @@ export class Apps { /** * Get a single application template. + * @param applicationTemplateId The combination id of manifestId and manifestVersion of the IoT + * Central application template. * @param [options] The optional parameters * @returns Promise */ - template(options?: msRest.RequestOptionsBase): Promise; + template(applicationTemplateId: string, options?: msRest.RequestOptionsBase): Promise; /** + * @param applicationTemplateId The combination id of manifestId and manifestVersion of the IoT + * Central application template. * @param callback The callback */ - template(callback: msRest.ServiceCallback): void; + template(applicationTemplateId: string, callback: msRest.ServiceCallback): void; /** + * @param applicationTemplateId The combination id of manifestId and manifestVersion of the IoT + * Central application template. * @param options The optional parameters * @param callback The callback */ - template(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - template(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + template(applicationTemplateId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + template(applicationTemplateId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { + applicationTemplateId, options }, templateOperationSpec,