From 203f2836b53d6437e97043e82cc5b356b5a0f2c4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 20 Jan 2021 07:04:12 +0000 Subject: [PATCH] CodeGen from PR 12337 in Azure/azure-rest-api-specs Merge 05fd44fcf01536dc35e8ce832ed415abe7bfb5f7 into a501906eeb0bb2d17cde6acc49d6a9c64dc9d03c --- sdk/mixedreality/arm-mixedreality/LICENSE.txt | 2 +- sdk/mixedreality/arm-mixedreality/README.md | 9 +- .../arm-mixedreality/rollup.config.js | 4 +- .../src/mixedRealityClient.ts | 7 +- .../src/mixedRealityClientContext.ts | 13 +- .../arm-mixedreality/src/models/index.ts | 388 ++++++++---- .../arm-mixedreality/src/models/mappers.ts | 552 +++++++++++++----- .../src/models/operationsMappers.ts | 11 +- .../arm-mixedreality/src/models/parameters.ts | 21 +- .../models/remoteRenderingAccountsMappers.ts | 6 +- .../models/spatialAnchorsAccountsMappers.ts | 6 +- .../arm-mixedreality/src/operations/index.ts | 5 +- .../src/operations/operations.ts | 10 +- .../src/operations/remoteRenderingAccounts.ts | 27 +- .../src/operations/spatialAnchorsAccounts.ts | 27 +- 15 files changed, 773 insertions(+), 315 deletions(-) diff --git a/sdk/mixedreality/arm-mixedreality/LICENSE.txt b/sdk/mixedreality/arm-mixedreality/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/mixedreality/arm-mixedreality/LICENSE.txt +++ b/sdk/mixedreality/arm-mixedreality/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +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 diff --git a/sdk/mixedreality/arm-mixedreality/README.md b/sdk/mixedreality/arm-mixedreality/README.md index c84af2850f43..e5d65b4492a4 100644 --- a/sdk/mixedreality/arm-mixedreality/README.md +++ b/sdk/mixedreality/arm-mixedreality/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-mixedreality ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +#### nodejs - client creation and list operations as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ 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 -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 { MixedRealityClient, MixedRealityModels, MixedRealityMappers } from "@azure/arm-mixedreality"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { MixedRealityClient } = require("@azure/arm-mixedreality"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/mixedreality/arm-mixedreality/rollup.config.js b/sdk/mixedreality/arm-mixedreality/rollup.config.js index 8ee230806bb5..ebecbaa3d371 100644 --- a/sdk/mixedreality/arm-mixedreality/rollup.config.js +++ b/sdk/mixedreality/arm-mixedreality/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/mixedreality/arm-mixedreality/src/mixedRealityClient.ts b/sdk/mixedreality/arm-mixedreality/src/mixedRealityClient.ts index 08b9d7c4afee..2983d2d4fd0a 100644 --- a/sdk/mixedreality/arm-mixedreality/src/mixedRealityClient.ts +++ b/sdk/mixedreality/arm-mixedreality/src/mixedRealityClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -79,7 +78,7 @@ const checkNameAvailabilityLocalOperationSpec: msRest.OperationSpec = { Parameters.location ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/mixedreality/arm-mixedreality/src/mixedRealityClientContext.ts b/sdk/mixedreality/arm-mixedreality/src/mixedRealityClientContext.ts index 2691545c852c..068d7d614ea1 100644 --- a/sdk/mixedreality/arm-mixedreality/src/mixedRealityClientContext.ts +++ b/sdk/mixedreality/arm-mixedreality/src/mixedRealityClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -17,6 +16,7 @@ const packageVersion = "2.0.0"; export class MixedRealityClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; + apiVersion?: string; subscriptionId: string; /** @@ -37,13 +37,14 @@ export class MixedRealityClientContext extends msRestAzure.AzureServiceClient { 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.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -51,10 +52,10 @@ export class MixedRealityClientContext extends msRestAzure.AzureServiceClient { 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/mixedreality/arm-mixedreality/src/models/index.ts b/sdk/mixedreality/arm-mixedreality/src/models/index.ts index 03a32ebb6e5f..955c233b3e75 100644 --- a/sdk/mixedreality/arm-mixedreality/src/models/index.ts +++ b/sdk/mixedreality/arm-mixedreality/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -30,9 +30,9 @@ export interface CheckNameAvailabilityRequest { */ export interface CheckNameAvailabilityResponse { /** - * if name Available. Possible values include: 'true', 'false' + * if name Available */ - nameAvailable: NameAvailability; + nameAvailable: boolean; /** * Resource Name To Verify. Possible values include: 'Invalid', 'AlreadyExists' */ @@ -66,114 +66,123 @@ export interface OperationDisplay { } /** - * REST API operation + * Specifications of the Log for Azure Monitoring */ -export interface Operation { +export interface LogSpecification { /** - * Operation name: {provider}/{resource}/{operation} + * Name of the log */ name?: string; /** - * The object that represents the operation. + * Localized friendly display name of the log */ - display?: OperationDisplay; + displayName?: string; + /** + * Blob duration of the log + */ + blobDuration?: string; } /** - * An interface representing Resource. + * Specifications of the Dimension of metrics */ -export interface Resource extends BaseResource { +export interface MetricDimension { /** - * 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.** + * Name of the dimension */ - readonly id?: string; + name?: string; /** - * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Localized friendly display name of the dimension */ - readonly name?: string; + displayName?: string; /** - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Internal name of the dimension. */ - readonly type?: string; + internalName?: string; } /** - * The resource model definition for a ARM tracked top level resource + * Specifications of the Metrics for Azure Monitoring */ -export interface TrackedResource extends Resource { +export interface MetricSpecification { /** - * Resource tags. + * Name of the metric */ - tags?: { [propertyName: string]: string }; + name?: string; /** - * The geo-location where the resource lives + * Localized friendly display name of the metric */ - location: string; -} - -/** - * SpatialAnchorsAccount Response. - */ -export interface SpatialAnchorsAccount extends TrackedResource { + displayName?: string; /** - * unique id of certain account. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Localized friendly description of the metric */ - readonly accountId?: string; + displayDescription?: string; /** - * Correspond domain name of certain Spatial Anchors Account - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Unit that makes sense for the metric */ - readonly accountDomain?: string; + unit?: string; + /** + * Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + */ + aggregationType?: string; + /** + * Internal metric name. + */ + internalMetricName?: string; + /** + * Dimensions of the metric + */ + dimensions?: MetricDimension[]; } /** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags + * Service specification payload */ -export interface ProxyResource extends Resource { +export interface ServiceSpecification { + /** + * Specifications of the Log for Azure Monitoring + */ + logSpecifications?: LogSpecification[]; + /** + * Specifications of the Metrics for Azure Monitoring + */ + metricSpecifications?: MetricSpecification[]; } /** - * The resource model definition for a Azure Resource Manager resource with an etag. + * Operation properties. */ -export interface AzureEntityResource extends Resource { +export interface OperationProperties { /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Service specification. */ - readonly etag?: string; + serviceSpecification?: ServiceSpecification; } /** - * Developer Keys of account + * REST API operation */ -export interface AccountKeys { +export interface Operation { /** - * value of primary key. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Operation name: {provider}/{resource}/{operation} */ - readonly primaryKey?: string; + name?: string; /** - * value of secondary key. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The object that represents the operation. */ - readonly secondaryKey?: string; -} - -/** - * Request for account key regeneration - */ -export interface AccountKeyRegenerateRequest { + display?: OperationDisplay; /** - * serial of key to be regenerated. Default value: 1. + * Whether or not this is a data plane operation */ - serial?: number; + isDataAction?: boolean; + /** + * The origin + */ + origin?: string; + /** + * Properties of the operation + */ + properties?: OperationProperties; } /** @@ -197,63 +206,148 @@ export interface Identity { } /** - * An interface representing RemoteRenderingAccountIdentity. + * The resource model definition representing SKU */ -export interface RemoteRenderingAccountIdentity extends Identity { +export interface Sku { + /** + * The name of the SKU. Ex - P3. It is typically a letter+number code + */ + name: string; + /** + * This field is required to be implemented by the Resource Provider if the service has more than + * one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', + * 'Premium' + */ + tier?: SkuTier; + /** + * The SKU size. When the name field is the combination of tier and some other value, this would + * be the standalone code. + */ + size?: string; + /** + * If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + */ + family?: string; + /** + * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + * is not possible for the resource this may be omitted. + */ + capacity?: number; } /** - * RemoteRenderingAccount Response. + * Metadata pertaining to creation and last modification of the resource. */ -export interface RemoteRenderingAccount extends TrackedResource { - identity?: RemoteRenderingAccountIdentity; +export interface SystemData { /** - * unique id of certain account. + * 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 type of identity that last modified the resource. + */ + 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 accountId?: string; + readonly id?: string; /** - * Correspond domain name of certain Spatial Anchors Account + * The name of the resource * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly accountDomain?: string; + 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; } /** - * An interface representing ResourceModelWithAllowedPropertySetIdentity. + * The resource model definition for an Azure Resource Manager tracked top level resource which has + * 'tags' and a 'location' + * @summary Tracked Resource */ -export interface ResourceModelWithAllowedPropertySetIdentity extends Identity { +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; } /** - * The resource model definition representing SKU + * SpatialAnchorsAccount Response. */ -export interface Sku { +export interface SpatialAnchorsAccount extends TrackedResource { /** - * The name of the SKU. Ex - P3. It is typically a letter+number code + * unique id of certain account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - name: string; + readonly accountId?: string; /** - * This field is required to be implemented by the Resource Provider if the service has more than - * one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', - * 'Premium' + * Correspond domain name of certain Spatial Anchors Account + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - tier?: SkuTier; + readonly accountDomain?: string; /** - * The SKU size. When the name field is the combination of tier and some other value, this would - * be the standalone code. + * The identity associated with this account */ - size?: string; + identity?: Identity; /** - * If the service has different generations of hardware, for the same SKU, then that can be - * captured here. + * The plan associated with this account */ - family?: string; + plan?: Identity; /** - * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in - * is not possible for the resource this may be omitted. + * The sku associated with this account */ - capacity?: number; + sku?: Sku; + /** + * The kind of account, if supported + */ + kind?: Sku; + /** + * System metadata for this account + */ + systemData?: SystemData; +} + +/** + * An interface representing ResourceModelWithAllowedPropertySetIdentity. + */ +export interface ResourceModelWithAllowedPropertySetIdentity extends Identity { } /** @@ -302,7 +396,7 @@ export interface ResourceModelWithAllowedPropertySetPlan extends Plan { */ export interface ResourceModelWithAllowedPropertySet extends BaseResource { /** - * Fully qualified resource Id for the resource. Ex - + * 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.** */ @@ -313,8 +407,8 @@ export interface ResourceModelWithAllowedPropertySet extends BaseResource { */ readonly name?: string; /** - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts.. + * 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; @@ -323,8 +417,8 @@ export interface ResourceModelWithAllowedPropertySet extends BaseResource { */ location?: string; /** - * The fully qualified resource ID of the resource that manages this resource. Indicates if this - * resource is managed by another azure resource. If this is present, complete mode deployment + * The fully qualified resource ID of the resource that manages this resource. Indicates if this + * resource is managed by another Azure resource. If this is present, complete mode deployment * will not delete the resource if it is removed from the template since it is managed by another * resource. */ @@ -353,6 +447,88 @@ export interface ResourceModelWithAllowedPropertySet extends BaseResource { plan?: ResourceModelWithAllowedPropertySetPlan; } +/** + * 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 { +} + +/** + * 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; +} + +/** + * Developer Keys of account + */ +export interface AccountKeys { + /** + * value of primary key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly primaryKey?: string; + /** + * value of secondary key. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly secondaryKey?: string; +} + +/** + * Request for account key regeneration + */ +export interface AccountKeyRegenerateRequest { + /** + * serial of key to be regenerated. Default value: 1. + */ + serial?: number; +} + +/** + * RemoteRenderingAccount Response. + */ +export interface RemoteRenderingAccount extends TrackedResource { + /** + * unique id of certain account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly accountId?: string; + /** + * Correspond domain name of certain Spatial Anchors Account + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly accountDomain?: string; + /** + * The identity associated with this account + */ + identity?: Identity; + /** + * The plan associated with this account + */ + plan?: Identity; + /** + * The sku associated with this account + */ + sku?: Sku; + /** + * The kind of account, if supported + */ + kind?: Sku; + /** + * System metadata for this account + */ + systemData?: SystemData; +} + /** * An interface representing MixedRealityClientOptions. */ @@ -400,20 +576,20 @@ export interface RemoteRenderingAccountPage extends Array