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/appsMappers.ts b/sdk/iotcentral/arm-iotcentral/src/models/appsMappers.ts index f0a1b9f18c7e..b23e5fcf2b13 100644 --- a/sdk/iotcentral/arm-iotcentral/src/models/appsMappers.ts +++ b/sdk/iotcentral/arm-iotcentral/src/models/appsMappers.ts @@ -18,5 +18,6 @@ export { BaseResource, CloudError, OperationInputs, - Resource + Resource, + SystemAssignedServiceIdentity } from "../models/mappers"; diff --git a/sdk/iotcentral/arm-iotcentral/src/models/index.ts b/sdk/iotcentral/arm-iotcentral/src/models/index.ts index 444beeb733b4..d88e4e663264 100644 --- a/sdk/iotcentral/arm-iotcentral/src/models/index.ts +++ b/sdk/iotcentral/arm-iotcentral/src/models/index.ts @@ -16,11 +16,33 @@ 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; } +/** + * Managed service identity (either system assigned, or none) + */ +export interface SystemAssignedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided + * for a system assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a + * system assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * Possible values include: 'None', 'SystemAssigned' + */ + type: SystemAssignedServiceIdentityType; +} + /** * The common properties of an ARM resource. */ @@ -73,10 +95,18 @@ 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. */ sku: AppSkuInfo; + /** + * The managed identities for the IoT Central application. + */ + identity?: SystemAssignedServiceIdentity; } /** @@ -110,6 +140,14 @@ 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; + /** + * The managed identities for the IoT Central application. + */ + identity?: SystemAssignedServiceIdentity; } /** @@ -330,13 +368,29 @@ 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 = 'ST0' | 'ST1' | 'ST2'; + +/** + * Defines values for SystemAssignedServiceIdentityType. + * Possible values include: 'None', 'SystemAssigned' * @readonly * @enum {string} */ -export type AppSku = 'F1' | 'S1' | 'ST0' | 'ST1' | 'ST2'; +export type SystemAssignedServiceIdentityType = 'None' | 'SystemAssigned'; /** * 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..fd29966617c1 100644 --- a/sdk/iotcentral/arm-iotcentral/src/models/mappers.ts +++ b/sdk/iotcentral/arm-iotcentral/src/models/mappers.ts @@ -29,6 +29,37 @@ export const AppSkuInfo: msRest.CompositeMapper = { } }; +export const SystemAssignedServiceIdentity: msRest.CompositeMapper = { + serializedName: "SystemAssignedServiceIdentity", + type: { + name: "Composite", + className: "SystemAssignedServiceIdentity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "Uuid" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "Uuid" + } + }, + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + export const Resource: msRest.CompositeMapper = { serializedName: "Resource", type: { @@ -113,6 +144,12 @@ export const App: msRest.CompositeMapper = { name: "String" } }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, sku: { required: true, serializedName: "sku", @@ -120,6 +157,13 @@ export const App: msRest.CompositeMapper = { name: "Composite", className: "AppSkuInfo" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "SystemAssignedServiceIdentity" + } } } } @@ -173,6 +217,19 @@ export const AppPatch: msRest.CompositeMapper = { type: { name: "String" } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "SystemAssignedServiceIdentity" + } } } } 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