From 18928c77ef278aeaf9cb23a659482921e3568203 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 23 Jul 2021 07:52:33 +0000 Subject: [PATCH] CodeGen from PR 14545 in Azure/azure-rest-api-specs Merge 0625e805651826884d17127001ac6e2d53a2d5bc into 45080747a094f6a64968b6f93aa1f9a7233a63ae --- sdk/storagecache/arm-storagecache/README.md | 9 +- .../arm-storagecache/package.json | 2 +- .../src/models/cachesMappers.ts | 1 + .../arm-storagecache/src/models/index.ts | 74 +++++- .../arm-storagecache/src/models/mappers.ts | 51 ++++- .../arm-storagecache/src/models/parameters.ts | 12 + .../models/storageTargetOperationsMappers.ts | 11 + .../src/models/storageTargetsMappers.ts | 1 + .../arm-storagecache/src/operations/index.ts | 1 + .../src/operations/storageTargetOperations.ts | 214 ++++++++++++++++++ .../src/operations/storageTargets.ts | 7 +- .../src/storageCacheManagementClient.ts | 2 + .../storageCacheManagementClientContext.ts | 10 +- 13 files changed, 369 insertions(+), 26 deletions(-) create mode 100644 sdk/storagecache/arm-storagecache/src/models/storageTargetOperationsMappers.ts create mode 100644 sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts diff --git a/sdk/storagecache/arm-storagecache/README.md b/sdk/storagecache/arm-storagecache/README.md index 1982b3cbc515..562cca4b4f13 100644 --- a/sdk/storagecache/arm-storagecache/README.md +++ b/sdk/storagecache/arm-storagecache/README.md @@ -1,11 +1,11 @@ ## Azure StorageCacheManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for StorageCacheManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for StorageCacheManagementClient. ### 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-storagecache @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 list operations as an example written in JavaScript. ##### Sample code @@ -51,7 +49,6 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. const creds = new DefaultAzureCredential(); const client = new StorageCacheManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { console.log("The result is:"); console.log(result); @@ -86,7 +83,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmStoragecache.StorageCacheManagementClient(creds, subscriptionId); client.operations.list().then((result) => { diff --git a/sdk/storagecache/arm-storagecache/package.json b/sdk/storagecache/arm-storagecache/package.json index ed330acbca45..0bffcb29246a 100644 --- a/sdk/storagecache/arm-storagecache/package.json +++ b/sdk/storagecache/arm-storagecache/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/main/sdk/storagecache/arm-storagecache", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/storagecache/arm-storagecache", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts b/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts index 9aed7646cd96..b030fd8f29b4 100644 --- a/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/cachesMappers.ts @@ -16,6 +16,7 @@ export { CacheEncryptionSettings, CacheHealth, CacheIdentity, + CacheIdentityUserAssignedIdentitiesValue, CacheNetworkSettings, CacheSecuritySettings, CacheSku, diff --git a/sdk/storagecache/arm-storagecache/src/models/index.ts b/sdk/storagecache/arm-storagecache/src/models/index.ts index 969068b2dc0e..826d0be5cc5f 100644 --- a/sdk/storagecache/arm-storagecache/src/models/index.ts +++ b/sdk/storagecache/arm-storagecache/src/models/index.ts @@ -201,24 +201,46 @@ export interface AscOperation { output?: { [propertyName: string]: any }; } +/** + * An interface representing CacheIdentityUserAssignedIdentitiesValue. + */ +export interface CacheIdentityUserAssignedIdentitiesValue { + /** + * The principal ID of the user-assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The client ID of the user-assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + /** * Cache identity properties. */ export interface CacheIdentity { /** - * The principal id of the cache. + * The principal ID for the system-assigned identity of the cache. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly principalId?: string; /** - * The tenant id associated with the cache. + * The tenant ID associated with the cache. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly tenantId?: string; /** - * The type of identity used for the cache. Possible values include: 'SystemAssigned', 'None' + * The type of identity used for the cache. Possible values include: 'SystemAssigned', + * 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' */ type?: CacheIdentityType; + /** + * A dictionary where each key is a user assigned identity resource ID, and each key's value is + * an empty dictionary. + */ + userAssignedIdentities?: { [propertyName: string]: CacheIdentityUserAssignedIdentitiesValue }; } /** @@ -346,7 +368,8 @@ export interface CacheNetworkSettings { */ dnsSearchDomain?: string; /** - * NTP server IP Address or FQDN for the cache to use. The default is time.windows.com. + * NTP server IP Address or FQDN for the cache to use. The default is time.windows.com. Default + * value: 'time.windows.com'. */ ntpServer?: string; } @@ -383,6 +406,11 @@ export interface CacheEncryptionSettings { * Specifies the location of the key encryption key in Key Vault. */ keyEncryptionKey?: KeyVaultKeyReference; + /** + * Specifies whether the service will automatically rotate to the newest version of the key in + * the Key Vault. + */ + rotationToLatestKeyVersionEnabled?: boolean; } /** @@ -669,16 +697,18 @@ export interface Cache extends BaseResource { * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. * Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', * 'Updating' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - provisioningState?: ProvisioningStateType; + readonly provisioningState?: ProvisioningStateType; /** * Subnet used for the Cache. */ subnet?: string; /** * Upgrade status of the Cache. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - upgradeStatus?: CacheUpgradeStatus; + readonly upgradeStatus?: CacheUpgradeStatus; /** * Specifies network settings of the cache. */ @@ -718,7 +748,7 @@ export interface NamespaceJunction { */ nfsExport?: string; /** - * Name of the access policy applied to this junction. + * Name of the access policy applied to this junction. Default value: 'default'. */ nfsAccessPolicy?: string; } @@ -819,8 +849,9 @@ export interface StorageTarget extends StorageTargetResource { * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. * Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', * 'Updating' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - provisioningState?: ProvisioningStateType; + readonly provisioningState?: ProvisioningStateType; /** * Properties when targetType is nfs3. */ @@ -986,6 +1017,17 @@ export interface CachesBeginCreateOrUpdateOptionalParams extends msRest.RequestO cache?: Cache; } +/** + * Optional Parameters. + */ +export interface StorageTargetsDeleteMethodOptionalParams extends msRest.RequestOptionsBase { + /** + * Boolean value requesting the force delete operation for a storage target. Force delete + * discards unwritten-data in the cache instead of flushing it to back-end storage. + */ + force?: string; +} + /** * Optional Parameters. */ @@ -996,6 +1038,17 @@ export interface StorageTargetsCreateOrUpdateOptionalParams extends msRest.Reque storagetarget?: StorageTarget; } +/** + * Optional Parameters. + */ +export interface StorageTargetsBeginDeleteMethodOptionalParams extends msRest.RequestOptionsBase { + /** + * Boolean value requesting the force delete operation for a storage target. Force delete + * discards unwritten-data in the cache instead of flushing it to back-end storage. + */ + force?: string; +} + /** * Optional Parameters. */ @@ -1086,11 +1139,12 @@ export type MetricAggregationType = 'NotSpecified' | 'None' | 'Average' | 'Minim /** * Defines values for CacheIdentityType. - * Possible values include: 'SystemAssigned', 'None' + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' * @readonly * @enum {string} */ -export type CacheIdentityType = 'SystemAssigned' | 'None'; +export type CacheIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None'; /** * Defines values for CreatedByType. diff --git a/sdk/storagecache/arm-storagecache/src/models/mappers.ts b/sdk/storagecache/arm-storagecache/src/models/mappers.ts index ca2d43cbe9a1..af565dfda169 100644 --- a/sdk/storagecache/arm-storagecache/src/models/mappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/mappers.ts @@ -333,6 +333,30 @@ export const AscOperation: msRest.CompositeMapper = { } }; +export const CacheIdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = { + serializedName: "CacheIdentity_userAssignedIdentitiesValue", + type: { + name: "Composite", + className: "CacheIdentityUserAssignedIdentitiesValue", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + export const CacheIdentity: msRest.CompositeMapper = { serializedName: "CacheIdentity", type: { @@ -359,9 +383,23 @@ export const CacheIdentity: msRest.CompositeMapper = { name: "Enum", allowedValues: [ "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", "None" ] } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "CacheIdentityUserAssignedIdentitiesValue" + } + } + } } } } @@ -565,6 +603,7 @@ export const CacheNetworkSettings: msRest.CompositeMapper = { }, ntpServer: { serializedName: "ntpServer", + defaultValue: 'time.windows.com', type: { name: "String" } @@ -626,6 +665,12 @@ export const CacheEncryptionSettings: msRest.CompositeMapper = { name: "Composite", className: "KeyVaultKeyReference" } + }, + rotationToLatestKeyVersionEnabled: { + serializedName: "rotationToLatestKeyVersionEnabled", + type: { + name: "Boolean" + } } } } @@ -1061,6 +1106,7 @@ export const Cache: msRest.CompositeMapper = { } }, provisioningState: { + readOnly: true, serializedName: "properties.provisioningState", type: { name: "String" @@ -1073,6 +1119,7 @@ export const Cache: msRest.CompositeMapper = { } }, upgradeStatus: { + readOnly: true, serializedName: "properties.upgradeStatus", type: { name: "Composite", @@ -1144,6 +1191,7 @@ export const NamespaceJunction: msRest.CompositeMapper = { }, nfsAccessPolicy: { serializedName: "nfsAccessPolicy", + defaultValue: 'default', type: { name: "String" } @@ -1161,7 +1209,7 @@ export const Nfs3Target: msRest.CompositeMapper = { target: { serializedName: "target", constraints: { - Pattern: /^[-.0-9a-zA-Z]+$/ + Pattern: /^[-.,0-9a-zA-Z]+$/ }, type: { name: "String" @@ -1309,6 +1357,7 @@ export const StorageTarget: msRest.CompositeMapper = { } }, provisioningState: { + readOnly: true, serializedName: "properties.provisioningState", type: { name: "String" diff --git a/sdk/storagecache/arm-storagecache/src/models/parameters.ts b/sdk/storagecache/arm-storagecache/src/models/parameters.ts index f59cdb795e2c..704e32af5410 100644 --- a/sdk/storagecache/arm-storagecache/src/models/parameters.ts +++ b/sdk/storagecache/arm-storagecache/src/models/parameters.ts @@ -42,6 +42,18 @@ export const cacheName: msRest.OperationURLParameter = { } } }; +export const force: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "force" + ], + mapper: { + serializedName: "force", + type: { + name: "String" + } + } +}; export const location: msRest.OperationURLParameter = { parameterPath: "location", mapper: { diff --git a/sdk/storagecache/arm-storagecache/src/models/storageTargetOperationsMappers.ts b/sdk/storagecache/arm-storagecache/src/models/storageTargetOperationsMappers.ts new file mode 100644 index 000000000000..bfdc5cc83365 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/models/storageTargetOperationsMappers.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export { + CloudError +} from "../models/mappers"; diff --git a/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts b/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts index ef6ef98db327..85b6d55b994b 100644 --- a/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts +++ b/sdk/storagecache/arm-storagecache/src/models/storageTargetsMappers.ts @@ -16,6 +16,7 @@ export { CacheEncryptionSettings, CacheHealth, CacheIdentity, + CacheIdentityUserAssignedIdentitiesValue, CacheNetworkSettings, CacheSecuritySettings, CacheSku, diff --git a/sdk/storagecache/arm-storagecache/src/operations/index.ts b/sdk/storagecache/arm-storagecache/src/operations/index.ts index e855b3e0869e..7a45918451f6 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/index.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/index.ts @@ -13,3 +13,4 @@ export * from "./usageModels"; export * from "./ascOperations"; export * from "./caches"; export * from "./storageTargets"; +export * from "./storageTargetOperations"; diff --git a/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts b/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts new file mode 100644 index 000000000000..7e3a34866549 --- /dev/null +++ b/sdk/storagecache/arm-storagecache/src/operations/storageTargetOperations.ts @@ -0,0 +1,214 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Mappers from "../models/storageTargetOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { StorageCacheManagementClientContext } from "../storageCacheManagementClientContext"; + +/** Class representing a StorageTargetOperations. */ +export class StorageTargetOperations { + private readonly client: StorageCacheManagementClientContext; + + /** + * Create a StorageTargetOperations. + * @param {StorageCacheManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageCacheManagementClientContext) { + this.client = client; + } + + /** + * Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests + * to this storage target's namespace will return errors until the flush operation completes. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be + * from the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param [options] The optional parameters + * @returns Promise + */ + flush(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginFlush(resourceGroupName,cacheName,storageTargetName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Suspends client access to a storage target. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be + * from the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param [options] The optional parameters + * @returns Promise + */ + suspend(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginSuspend(resourceGroupName,cacheName,storageTargetName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Resumes client access to a previously suspended storage target. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be + * from the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param [options] The optional parameters + * @returns Promise + */ + resume(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginResume(resourceGroupName,cacheName,storageTargetName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Tells the cache to write all dirty data to the Storage Target's backend storage. Client requests + * to this storage target's namespace will return errors until the flush operation completes. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be + * from the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param [options] The optional parameters + * @returns Promise + */ + beginFlush(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + cacheName, + storageTargetName, + options + }, + beginFlushOperationSpec, + options); + } + + /** + * Suspends client access to a storage target. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be + * from the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param [options] The optional parameters + * @returns Promise + */ + beginSuspend(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + cacheName, + storageTargetName, + options + }, + beginSuspendOperationSpec, + options); + } + + /** + * Resumes client access to a previously suspended storage target. + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be + * from the [-0-9a-zA-Z_] char class. + * @param storageTargetName Name of Storage Target. + * @param [options] The optional parameters + * @returns Promise + */ + beginResume(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + cacheName, + storageTargetName, + options + }, + beginResumeOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const beginFlushOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}/flush", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.cacheName, + Parameters.storageTargetName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginSuspendOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}/suspend", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.cacheName, + Parameters.storageTargetName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginResumeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/storageTargets/{storageTargetName}/resume", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.cacheName, + Parameters.storageTargetName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts b/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts index 28e5eb568ea3..fd8c0eecb4bd 100644 --- a/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts +++ b/sdk/storagecache/arm-storagecache/src/operations/storageTargets.ts @@ -87,7 +87,7 @@ export class StorageTargets { * @param [options] The optional parameters * @returns Promise */ - deleteMethod(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + deleteMethod(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: Models.StorageTargetsDeleteMethodOptionalParams): Promise { return this.beginDeleteMethod(resourceGroupName,cacheName,storageTargetName,options) .then(lroPoller => lroPoller.pollUntilFinished()); } @@ -180,7 +180,7 @@ export class StorageTargets { * @param [options] The optional parameters * @returns Promise */ - beginDeleteMethod(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: msRest.RequestOptionsBase): Promise { + beginDeleteMethod(resourceGroupName: string, cacheName: string, storageTargetName: string, options?: Models.StorageTargetsBeginDeleteMethodOptionalParams): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -332,7 +332,8 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { Parameters.storageTargetName ], queryParameters: [ - Parameters.apiVersion + Parameters.apiVersion, + Parameters.force ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts index c57bfac9ce88..0435e41aac99 100644 --- a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts +++ b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClient.ts @@ -23,6 +23,7 @@ class StorageCacheManagementClient extends StorageCacheManagementClientContext { ascOperations: operations.AscOperations; caches: operations.Caches; storageTargets: operations.StorageTargets; + storageTarget: operations.StorageTargetOperations; /** * Initializes a new instance of the StorageCacheManagementClient class. @@ -44,6 +45,7 @@ class StorageCacheManagementClient extends StorageCacheManagementClientContext { this.ascOperations = new operations.AscOperations(this); this.caches = new operations.Caches(this); this.storageTargets = new operations.StorageTargets(this); + this.storageTarget = new operations.StorageTargetOperations(this); } } diff --git a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.ts b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.ts index 9c2eac11305d..d86087bfea74 100644 --- a/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.ts +++ b/sdk/storagecache/arm-storagecache/src/storageCacheManagementClientContext.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-storagecache"; const packageVersion = "4.1.0"; @@ -43,14 +43,14 @@ export class StorageCacheManagementClientContext extends msRestAzure.AzureServic if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = '2021-03-01'; + this.apiVersion = '2021-05-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -58,10 +58,10 @@ export class StorageCacheManagementClientContext extends msRestAzure.AzureServic 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; } }