From 2660ded2c7350b78cc39fe414d35ab47eb1cd79c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Sep 2021 02:53:45 +0000 Subject: [PATCH] CodeGen from PR 14311 in Azure/azure-rest-api-specs [Microsoft.IoTCentral/iotApps] Removal of legacy S1 SKU, S360 Fixes, newer RP API version 2021-06-01 (#14311) * Adds base for updating Microsoft.IoTCentral from version stable/2018-09-01 to version 2021-06-01 * Updates readme * Updates API version in new specs and examples * remove legacy sku S1 * update template in example to use M3 template name * add suppress for R4009 and R3018 * add state * update * should be read only * update example * Update iotcentral.json temporary changing this for further testing in canary. * removal of f1 and deleted state --- sdk/iotcentral/arm-iotcentral/README.md | 8 +++---- sdk/iotcentral/arm-iotcentral/package.json | 2 +- .../src/iotCentralClientContext.ts | 4 ++-- .../arm-iotcentral/src/models/index.ts | 22 ++++++++++++++++--- .../arm-iotcentral/src/models/mappers.ts | 12 ++++++++++ .../src/operations/operations.ts | 4 ++-- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/sdk/iotcentral/arm-iotcentral/README.md b/sdk/iotcentral/arm-iotcentral/README.md index da7bc02cc8bc..26c72da398cf 100644 --- a/sdk/iotcentral/arm-iotcentral/README.md +++ b/sdk/iotcentral/arm-iotcentral/README.md @@ -1,11 +1,11 @@ ## Azure IotCentralClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for IotCentralClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for IotCentralClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-iotcentral @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. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and get apps as an example written in JavaScript. ##### Sample code @@ -87,7 +85,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmIotcentral.IotCentralClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; diff --git a/sdk/iotcentral/arm-iotcentral/package.json b/sdk/iotcentral/arm-iotcentral/package.json index 11801dda553d..3704dd693b96 100644 --- a/sdk/iotcentral/arm-iotcentral/package.json +++ b/sdk/iotcentral/arm-iotcentral/package.json @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/iotcentral/arm-iotcentral", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/iotcentral/arm-iotcentral", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/iotcentral/arm-iotcentral/src/iotCentralClientContext.ts b/sdk/iotcentral/arm-iotcentral/src/iotCentralClientContext.ts index d58d97daede0..5810c38cb434 100644 --- a/sdk/iotcentral/arm-iotcentral/src/iotCentralClientContext.ts +++ b/sdk/iotcentral/arm-iotcentral/src/iotCentralClientContext.ts @@ -9,8 +9,8 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-iotcentral"; const packageVersion = "4.2.1"; @@ -49,7 +49,7 @@ export class IotCentralClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2018-09-01'; + this.apiVersion = '2021-06-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/iotcentral/arm-iotcentral/src/models/index.ts b/sdk/iotcentral/arm-iotcentral/src/models/index.ts index 444beeb733b4..058725a1e87d 100644 --- a/sdk/iotcentral/arm-iotcentral/src/models/index.ts +++ b/sdk/iotcentral/arm-iotcentral/src/models/index.ts @@ -16,7 +16,7 @@ export { BaseResource, CloudError }; */ export interface AppSkuInfo { /** - * The name of the SKU. Possible values include: 'F1', 'S1', 'ST0', 'ST1', 'ST2' + * The name of the SKU. Possible values include: 'ST0', 'ST1', 'ST2' */ name: AppSku; } @@ -73,6 +73,10 @@ export interface App extends Resource { * allows the application to be defined from scratch. */ template?: string; + /** + * The current state of the application. Possible values include: 'created', 'suspended' + */ + state?: AppState; /** * A valid instance SKU. */ @@ -110,6 +114,10 @@ export interface AppPatch { * allows the application to be defined from scratch. */ template?: string; + /** + * The current state of the application. Possible values include: 'created', 'suspended' + */ + state?: AppState; } /** @@ -330,13 +338,21 @@ export interface OperationListResult extends Array { nextLink?: string; } +/** + * Defines values for AppState. + * Possible values include: 'created', 'suspended' + * @readonly + * @enum {string} + */ +export type AppState = 'created' | 'suspended'; + /** * Defines values for AppSku. - * Possible values include: 'F1', 'S1', 'ST0', 'ST1', 'ST2' + * Possible values include: 'ST0', 'ST1', 'ST2' * @readonly * @enum {string} */ -export type AppSku = 'F1' | 'S1' | 'ST0' | 'ST1' | 'ST2'; +export type AppSku = 'ST0' | 'ST1' | 'ST2'; /** * Contains response data for the get operation. diff --git a/sdk/iotcentral/arm-iotcentral/src/models/mappers.ts b/sdk/iotcentral/arm-iotcentral/src/models/mappers.ts index 1471146067ac..9175d1132593 100644 --- a/sdk/iotcentral/arm-iotcentral/src/models/mappers.ts +++ b/sdk/iotcentral/arm-iotcentral/src/models/mappers.ts @@ -113,6 +113,12 @@ export const App: msRest.CompositeMapper = { name: "String" } }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, sku: { required: true, serializedName: "sku", @@ -173,6 +179,12 @@ export const AppPatch: msRest.CompositeMapper = { type: { name: "String" } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } } } } diff --git a/sdk/iotcentral/arm-iotcentral/src/operations/operations.ts b/sdk/iotcentral/arm-iotcentral/src/operations/operations.ts index d2b10b4f21c9..61993f831ea3 100644 --- a/sdk/iotcentral/arm-iotcentral/src/operations/operations.ts +++ b/sdk/iotcentral/arm-iotcentral/src/operations/operations.ts @@ -26,7 +26,7 @@ export class Operations { } /** - * Lists all of the available IoT Central application REST API operations. + * Lists all of the available IoT Central Resource Provider operations. * @param [options] The optional parameters * @returns Promise */ @@ -50,7 +50,7 @@ export class Operations { } /** - * Lists all of the available IoT Central application REST API operations. + * Lists all of the available IoT Central Resource Provider operations. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters * @returns Promise