diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 55e92a761145..41a6ac53e023 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14292,7 +14292,7 @@ packages: dev: false file:projects/arm-rediscache.tgz: - resolution: {integrity: sha512-cVPVS4kYq6n83VLO8Cl95K5TkE63nlvYvZeEoUMOp5wGVvwgR+UA8xSlSg1/eMqQ1jeaTuiyHoFa5n+slIYnTw==, tarball: file:projects/arm-rediscache.tgz} + resolution: {integrity: sha512-EO2zPTIB4RsmBQlVdJ22sHB7w2x2WqDGiCWSvoO9ded2UtbSm8sEzFDxGkG9RtX8ymVaww1dDhU9m3c0/AQF0w==, tarball: file:projects/arm-rediscache.tgz} name: '@rush-temp/arm-rediscache' version: 0.0.0 dependencies: @@ -14307,14 +14307,14 @@ packages: '@types/node': 14.18.42 chai: 4.3.7 cross-env: 7.0.3 - dotenv: 8.6.0 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_c43y4oaxxwie3ialrfuzfwwhqq tslib: 2.5.0 - typescript: 5.0.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color diff --git a/sdk/redis/arm-rediscache/CHANGELOG.md b/sdk/redis/arm-rediscache/CHANGELOG.md index fe797a1c5cd4..b58353086d63 100644 --- a/sdk/redis/arm-rediscache/CHANGELOG.md +++ b/sdk/redis/arm-rediscache/CHANGELOG.md @@ -1,15 +1,45 @@ # Release History + +## 7.2.0 (2023-04-21) + +**Features** -## 7.1.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group AccessPolicy + - Added operation group AccessPolicyAssignment + - Added Interface AccessPolicyAssignmentCreateUpdateOptionalParams + - Added Interface AccessPolicyAssignmentDeleteHeaders + - Added Interface AccessPolicyAssignmentDeleteOptionalParams + - Added Interface AccessPolicyAssignmentGetOptionalParams + - Added Interface AccessPolicyAssignmentListNextOptionalParams + - Added Interface AccessPolicyAssignmentListOptionalParams + - Added Interface AccessPolicyCreateUpdateOptionalParams + - Added Interface AccessPolicyDeleteHeaders + - Added Interface AccessPolicyDeleteOptionalParams + - Added Interface AccessPolicyGetOptionalParams + - Added Interface AccessPolicyListNextOptionalParams + - Added Interface AccessPolicyListOptionalParams + - Added Interface LinkedServerDeleteHeaders + - Added Interface RedisCacheAccessPolicy + - Added Interface RedisCacheAccessPolicyAssignment + - Added Interface RedisCacheAccessPolicyAssignmentList + - Added Interface RedisCacheAccessPolicyAssignmentSet + - Added Interface RedisCacheAccessPolicyList + - Added Type Alias AccessPolicyAssignmentCreateUpdateResponse + - Added Type Alias AccessPolicyAssignmentGetResponse + - Added Type Alias AccessPolicyAssignmentListNextResponse + - Added Type Alias AccessPolicyAssignmentListResponse + - Added Type Alias AccessPolicyAssignmentProvisioningState + - Added Type Alias AccessPolicyCreateUpdateResponse + - Added Type Alias AccessPolicyGetResponse + - Added Type Alias AccessPolicyListNextResponse + - Added Type Alias AccessPolicyListResponse + - Added Type Alias AccessPolicyProvisioningState + - Added Type Alias AccessPolicyType + - Interface RedisCommonPropertiesRedisConfiguration has a new optional parameter aadEnabled + - Added Enum KnownAccessPolicyAssignmentProvisioningState + - Added Enum KnownAccessPolicyProvisioningState + - Added Enum KnownAccessPolicyType + ## 7.1.1 (2023-01-31) **Features** diff --git a/sdk/redis/arm-rediscache/_meta.json b/sdk/redis/arm-rediscache/_meta.json index 1da906c15325..610c69af2dff 100644 --- a/sdk/redis/arm-rediscache/_meta.json +++ b/sdk/redis/arm-rediscache/_meta.json @@ -1,8 +1,8 @@ { - "commit": "794b03f1b40b6f7646528fbe06bcfce7b58223a9", + "commit": "1fdc3a2255dd1ebd234410a7d3671a9f4608ef95", "readme": "specification/redis/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\redis\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/redis/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.0", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/redis/arm-rediscache/package.json b/sdk/redis/arm-rediscache/package.json index 03c012737803..96065270769f 100644 --- a/sdk/redis/arm-rediscache/package.json +++ b/sdk/redis/arm-rediscache/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for RedisManagementClient.", - "version": "7.1.2", + "version": "7.2.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,13 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~5.0.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -48,8 +48,7 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-network": "^26.0.0" + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -112,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache" +} \ No newline at end of file diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache.api.md index a5c90985d6fa..aed7d5ea3575 100644 --- a/sdk/redis/arm-rediscache/review/arm-rediscache.api.md +++ b/sdk/redis/arm-rediscache/review/arm-rediscache.api.md @@ -6,9 +6,122 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export interface AccessPolicy { + beginCreateUpdate(resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicy, options?: AccessPolicyCreateUpdateOptionalParams): Promise, AccessPolicyCreateUpdateResponse>>; + beginCreateUpdateAndWait(resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicy, options?: AccessPolicyCreateUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyDeleteOptionalParams): Promise; + get(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyGetOptionalParams): Promise; + list(resourceGroupName: string, cacheName: string, options?: AccessPolicyListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccessPolicyAssignment { + beginCreateUpdate(resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicyAssignmentSet, options?: AccessPolicyAssignmentCreateUpdateOptionalParams): Promise, AccessPolicyAssignmentCreateUpdateResponse>>; + beginCreateUpdateAndWait(resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicyAssignmentSet, options?: AccessPolicyAssignmentCreateUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyAssignmentDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyAssignmentDeleteOptionalParams): Promise; + get(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyAssignmentGetOptionalParams): Promise; + list(resourceGroupName: string, cacheName: string, options?: AccessPolicyAssignmentListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccessPolicyAssignmentCreateUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccessPolicyAssignmentCreateUpdateResponse = RedisCacheAccessPolicyAssignmentSet; + +// @public +export interface AccessPolicyAssignmentDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface AccessPolicyAssignmentDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccessPolicyAssignmentGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPolicyAssignmentGetResponse = RedisCacheAccessPolicyAssignmentSet; + +// @public +export interface AccessPolicyAssignmentListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPolicyAssignmentListNextResponse = RedisCacheAccessPolicyAssignmentList; + +// @public +export interface AccessPolicyAssignmentListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPolicyAssignmentListResponse = RedisCacheAccessPolicyAssignmentList; + +// @public +export type AccessPolicyAssignmentProvisioningState = string; + +// @public +export interface AccessPolicyCreateUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccessPolicyCreateUpdateResponse = RedisCacheAccessPolicy; + +// @public +export interface AccessPolicyDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface AccessPolicyDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccessPolicyGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPolicyGetResponse = RedisCacheAccessPolicy; + +// @public +export interface AccessPolicyListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPolicyListNextResponse = RedisCacheAccessPolicyList; + +// @public +export interface AccessPolicyListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessPolicyListResponse = RedisCacheAccessPolicyList; + +// @public +export type AccessPolicyProvisioningState = string; + +// @public +export type AccessPolicyType = string; // @public export interface AsyncOperationStatus { @@ -121,6 +234,32 @@ export interface ImportRDBParameters { preferredDataArchiveAuthMethod?: string; } +// @public +export enum KnownAccessPolicyAssignmentProvisioningState { + Canceled = "Canceled", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownAccessPolicyProvisioningState { + Canceled = "Canceled", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownAccessPolicyType { + BuiltIn = "BuiltIn", + Custom = "Custom" +} + // @public export enum KnownDefaultName { Default = "default" @@ -202,9 +341,9 @@ export enum KnownTlsVersion { // @public export interface LinkedServer { - beginCreate(resourceGroupName: string, name: string, linkedServerName: string, parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams): Promise, LinkedServerCreateResponse>>; + beginCreate(resourceGroupName: string, name: string, linkedServerName: string, parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams): Promise, LinkedServerCreateResponse>>; beginCreateAndWait(resourceGroupName: string, name: string, linkedServerName: string, parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams): Promise; get(resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerGetOptionalParams): Promise; list(resourceGroupName: string, name: string, options?: LinkedServerListOptionalParams): PagedAsyncIterableIterator; @@ -219,6 +358,12 @@ export interface LinkedServerCreateOptionalParams extends coreClient.OperationOp // @public export type LinkedServerCreateResponse = RedisLinkedServerWithProperties; +// @public +export interface LinkedServerDeleteHeaders { + // (undocumented) + location?: string; +} + // @public export interface LinkedServerDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -385,7 +530,7 @@ export type PrivateEndpointConnectionProvisioningState = string; // @public export interface PrivateEndpointConnections { - beginPut(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise, PrivateEndpointConnectionsPutResponse>>; + beginPut(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise, PrivateEndpointConnectionsPutResponse>>; beginPutAndWait(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise; delete(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; get(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; @@ -468,15 +613,15 @@ export type RebootType = string; // @public export interface Redis { - beginCreate(resourceGroupName: string, name: string, parameters: RedisCreateParameters, options?: RedisCreateOptionalParams): Promise, RedisCreateResponse>>; + beginCreate(resourceGroupName: string, name: string, parameters: RedisCreateParameters, options?: RedisCreateOptionalParams): Promise, RedisCreateResponse>>; beginCreateAndWait(resourceGroupName: string, name: string, parameters: RedisCreateParameters, options?: RedisCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams): Promise; - beginExportData(resourceGroupName: string, name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams): Promise, void>>; + beginExportData(resourceGroupName: string, name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams): Promise, void>>; beginExportDataAndWait(resourceGroupName: string, name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams): Promise; - beginImportData(resourceGroupName: string, name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams): Promise, void>>; + beginImportData(resourceGroupName: string, name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams): Promise, void>>; beginImportDataAndWait(resourceGroupName: string, name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams): Promise; - beginUpdate(resourceGroupName: string, name: string, parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams): Promise, RedisUpdateResponse>>; + beginUpdate(resourceGroupName: string, name: string, parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams): Promise, RedisUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, name: string, parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams): Promise; checkNameAvailability(parameters: CheckNameAvailabilityParameters, options?: RedisCheckNameAvailabilityOptionalParams): Promise; forceReboot(resourceGroupName: string, name: string, parameters: RedisRebootParameters, options?: RedisForceRebootOptionalParams): Promise; @@ -494,6 +639,38 @@ export interface RedisAccessKeys { readonly secondaryKey?: string; } +// @public +export interface RedisCacheAccessPolicy extends ProxyResource { + permissions?: string; + readonly provisioningState?: AccessPolicyProvisioningState; + readonly typePropertiesType?: AccessPolicyType; +} + +// @public +export interface RedisCacheAccessPolicyAssignment { + objectId: string; + objectIdAlias: string; +} + +// @public +export interface RedisCacheAccessPolicyAssignmentList { + readonly nextLink?: string; + value?: RedisCacheAccessPolicyAssignmentSet[]; +} + +// @public +export interface RedisCacheAccessPolicyAssignmentSet extends ProxyResource { + // (undocumented) + assignments?: RedisCacheAccessPolicyAssignment[]; + readonly provisioningState?: AccessPolicyAssignmentProvisioningState; +} + +// @public +export interface RedisCacheAccessPolicyList { + readonly nextLink?: string; + value?: RedisCacheAccessPolicy[]; +} + // @public export interface RedisCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { } @@ -516,6 +693,7 @@ export interface RedisCommonProperties { // @public export interface RedisCommonPropertiesRedisConfiguration { [property: string]: any; + aadEnabled?: string; aofBackupEnabled?: string; aofStorageConnectionString0?: string; aofStorageConnectionString1?: string; @@ -745,6 +923,10 @@ export class RedisManagementClient extends coreClient.ServiceClient { $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: RedisManagementClientOptionalParams); // (undocumented) + accessPolicy: AccessPolicy; + // (undocumented) + accessPolicyAssignment: AccessPolicyAssignment; + // (undocumented) apiVersion: string; // (undocumented) asyncOperationStatus: AsyncOperationStatus; diff --git a/sdk/redis/arm-rediscache/src/lroImpl.ts b/sdk/redis/arm-rediscache/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/redis/arm-rediscache/src/lroImpl.ts +++ b/sdk/redis/arm-rediscache/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/redis/arm-rediscache/src/models/index.ts b/sdk/redis/arm-rediscache/src/models/index.ts index b807d03817ff..83d70b255ff4 100644 --- a/sdk/redis/arm-rediscache/src/models/index.ts +++ b/sdk/redis/arm-rediscache/src/models/index.ts @@ -239,6 +239,8 @@ export interface RedisCommonPropertiesRedisConfiguration { readonly zonalConfiguration?: string; /** Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view. */ authnotrequired?: string; + /** Specifies whether AAD based authentication has been enabled or disabled for the cache */ + aadEnabled?: string; } /** Managed service identity (system assigned and/or user assigned identities) */ @@ -598,6 +600,36 @@ export interface ErrorDetailAutoGenerated { readonly additionalInfo?: ErrorAdditionalInfo[]; } +/** List of access policies (with properties) of a Redis cache. */ +export interface RedisCacheAccessPolicyList { + /** List of access policies (with properties) of a Redis cache. */ + value?: RedisCacheAccessPolicy[]; + /** + * Link for next set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties for an access policy assignment */ +export interface RedisCacheAccessPolicyAssignment { + /** Object Id to assign access policy to */ + objectId: string; + /** User friendly name for object id. Also represents username for token based authentication */ + objectIdAlias: string; +} + +/** List of access policies assignments (with properties) of a Redis cache. */ +export interface RedisCacheAccessPolicyAssignmentList { + /** List of access policies assignments (with properties) of a Redis cache. */ + value?: RedisCacheAccessPolicyAssignmentSet[]; + /** + * Link for next set. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + /** Properties supplied to Create Redis operation. */ export interface RedisCreateProperties extends RedisCommonProperties { /** The SKU of the Redis cache to deploy. */ @@ -830,9 +862,50 @@ export interface RedisLinkedServerWithProperties extends ProxyResource { readonly provisioningState?: string; } +/** Response to get/put access policy. */ +export interface RedisCacheAccessPolicy extends ProxyResource { + /** + * Provisioning state of access policy + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: AccessPolicyProvisioningState; + /** + * Built-In or Custom access policy + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly typePropertiesType?: AccessPolicyType; + /** Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites */ + permissions?: string; +} + +/** Response to an operation on access policy assignment */ +export interface RedisCacheAccessPolicyAssignmentSet extends ProxyResource { + /** + * Provisioning state of an access policy assignment set + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: AccessPolicyAssignmentProvisioningState; + assignments?: RedisCacheAccessPolicyAssignment[]; +} + /** Parameters required for creating a firewall rule on redis cache. (Note, you can just use the FirewallRule type instead now.) */ export interface RedisFirewallRuleCreateParameters extends RedisFirewallRule {} +/** Defines headers for LinkedServer_delete operation. */ +export interface LinkedServerDeleteHeaders { + location?: string; +} + +/** Defines headers for AccessPolicy_delete operation. */ +export interface AccessPolicyDeleteHeaders { + location?: string; +} + +/** Defines headers for AccessPolicyAssignment_delete operation. */ +export interface AccessPolicyAssignmentDeleteHeaders { + location?: string; +} + /** Known values of {@link SkuName} that the service accepts. */ export enum KnownSkuName { /** Basic */ @@ -1063,6 +1136,84 @@ export enum KnownDefaultName { * **default** */ export type DefaultName = string; + +/** Known values of {@link AccessPolicyProvisioningState} that the service accepts. */ +export enum KnownAccessPolicyProvisioningState { + /** Updating */ + Updating = "Updating", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Deleted */ + Deleted = "Deleted", + /** Canceled */ + Canceled = "Canceled", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for AccessPolicyProvisioningState. \ + * {@link KnownAccessPolicyProvisioningState} can be used interchangeably with AccessPolicyProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Updating** \ + * **Succeeded** \ + * **Deleting** \ + * **Deleted** \ + * **Canceled** \ + * **Failed** + */ +export type AccessPolicyProvisioningState = string; + +/** Known values of {@link AccessPolicyType} that the service accepts. */ +export enum KnownAccessPolicyType { + /** Custom */ + Custom = "Custom", + /** BuiltIn */ + BuiltIn = "BuiltIn" +} + +/** + * Defines values for AccessPolicyType. \ + * {@link KnownAccessPolicyType} can be used interchangeably with AccessPolicyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Custom** \ + * **BuiltIn** + */ +export type AccessPolicyType = string; + +/** Known values of {@link AccessPolicyAssignmentProvisioningState} that the service accepts. */ +export enum KnownAccessPolicyAssignmentProvisioningState { + /** Updating */ + Updating = "Updating", + /** Succeeded */ + Succeeded = "Succeeded", + /** Deleting */ + Deleting = "Deleting", + /** Deleted */ + Deleted = "Deleted", + /** Canceled */ + Canceled = "Canceled", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for AccessPolicyAssignmentProvisioningState. \ + * {@link KnownAccessPolicyAssignmentProvisioningState} can be used interchangeably with AccessPolicyAssignmentProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Updating** \ + * **Succeeded** \ + * **Deleting** \ + * **Deleted** \ + * **Canceled** \ + * **Failed** + */ +export type AccessPolicyAssignmentProvisioningState = string; /** Defines values for RedisKeyType. */ export type RedisKeyType = "Primary" | "Secondary"; /** Defines values for DayOfWeek. */ @@ -1364,6 +1515,90 @@ export interface AsyncOperationStatusGetOptionalParams /** Contains response data for the get operation. */ export type AsyncOperationStatusGetResponse = OperationStatus; +/** Optional parameters. */ +export interface AccessPolicyCreateUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createUpdate operation. */ +export type AccessPolicyCreateUpdateResponse = RedisCacheAccessPolicy; + +/** Optional parameters. */ +export interface AccessPolicyDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface AccessPolicyGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccessPolicyGetResponse = RedisCacheAccessPolicy; + +/** Optional parameters. */ +export interface AccessPolicyListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type AccessPolicyListResponse = RedisCacheAccessPolicyList; + +/** Optional parameters. */ +export interface AccessPolicyListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type AccessPolicyListNextResponse = RedisCacheAccessPolicyList; + +/** Optional parameters. */ +export interface AccessPolicyAssignmentCreateUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createUpdate operation. */ +export type AccessPolicyAssignmentCreateUpdateResponse = RedisCacheAccessPolicyAssignmentSet; + +/** Optional parameters. */ +export interface AccessPolicyAssignmentDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface AccessPolicyAssignmentGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccessPolicyAssignmentGetResponse = RedisCacheAccessPolicyAssignmentSet; + +/** Optional parameters. */ +export interface AccessPolicyAssignmentListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type AccessPolicyAssignmentListResponse = RedisCacheAccessPolicyAssignmentList; + +/** Optional parameters. */ +export interface AccessPolicyAssignmentListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type AccessPolicyAssignmentListNextResponse = RedisCacheAccessPolicyAssignmentList; + /** Optional parameters. */ export interface RedisManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/redis/arm-rediscache/src/models/mappers.ts b/sdk/redis/arm-rediscache/src/models/mappers.ts index b04c78078cc7..086c4051f815 100644 --- a/sdk/redis/arm-rediscache/src/models/mappers.ts +++ b/sdk/redis/arm-rediscache/src/models/mappers.ts @@ -596,6 +596,12 @@ export const RedisCommonPropertiesRedisConfiguration: coreClient.CompositeMapper type: { name: "String" } + }, + aadEnabled: { + serializedName: "aad-enabled", + type: { + name: "String" + } } } } @@ -1456,6 +1462,85 @@ export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { } }; +export const RedisCacheAccessPolicyList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RedisCacheAccessPolicyList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RedisCacheAccessPolicy" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const RedisCacheAccessPolicyAssignment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RedisCacheAccessPolicyAssignment", + modelProperties: { + objectId: { + serializedName: "objectId", + required: true, + type: { + name: "String" + } + }, + objectIdAlias: { + serializedName: "objectIdAlias", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const RedisCacheAccessPolicyAssignmentList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RedisCacheAccessPolicyAssignmentList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RedisCacheAccessPolicyAssignmentSet" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const RedisCreateProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2024,6 +2109,65 @@ export const RedisLinkedServerWithProperties: coreClient.CompositeMapper = { } }; +export const RedisCacheAccessPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RedisCacheAccessPolicy", + modelProperties: { + ...ProxyResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + typePropertiesType: { + serializedName: "properties.type", + readOnly: true, + type: { + name: "String" + } + }, + permissions: { + serializedName: "properties.permissions", + type: { + name: "String" + } + } + } + } +}; + +export const RedisCacheAccessPolicyAssignmentSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RedisCacheAccessPolicyAssignmentSet", + modelProperties: { + ...ProxyResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + assignments: { + serializedName: "properties.assignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RedisCacheAccessPolicyAssignment" + } + } + } + } + } + } +}; + export const RedisFirewallRuleCreateParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2033,3 +2177,48 @@ export const RedisFirewallRuleCreateParameters: coreClient.CompositeMapper = { } } }; + +export const LinkedServerDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkedServerDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AccessPolicyDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessPolicyDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AccessPolicyAssignmentDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessPolicyAssignmentDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/redis/arm-rediscache/src/models/parameters.ts b/sdk/redis/arm-rediscache/src/models/parameters.ts index 752b54f2cd84..ebe97cd47966 100644 --- a/sdk/redis/arm-rediscache/src/models/parameters.ts +++ b/sdk/redis/arm-rediscache/src/models/parameters.ts @@ -22,7 +22,9 @@ import { RedisFirewallRule as RedisFirewallRuleMapper, RedisPatchSchedule as RedisPatchScheduleMapper, RedisLinkedServerCreateParameters as RedisLinkedServerCreateParametersMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + RedisCacheAccessPolicy as RedisCacheAccessPolicyMapper, + RedisCacheAccessPolicyAssignmentSet as RedisCacheAccessPolicyAssignmentSetMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -52,7 +54,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-06-01", + defaultValue: "2023-05-01", isConstant: true, serializedName: "api-version", type: { @@ -93,6 +95,9 @@ export const parameters: OperationParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, serializedName: "subscriptionId", required: true, type: { @@ -104,6 +109,10 @@ export const subscriptionId: OperationURLParameter = { export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, serializedName: "resourceGroupName", required: true, type: { @@ -167,6 +176,9 @@ export const parameters6: OperationParameter = { export const cacheName: OperationURLParameter = { parameterPath: "cacheName", mapper: { + constraints: { + Pattern: new RegExp("^([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]|[a-zA-Z0-9])$") + }, serializedName: "cacheName", required: true, type: { @@ -260,3 +272,27 @@ export const operationId: OperationURLParameter = { } } }; + +export const parameters10: OperationParameter = { + parameterPath: "parameters", + mapper: RedisCacheAccessPolicyMapper +}; + +export const accessPolicyName: OperationURLParameter = { + parameterPath: "accessPolicyName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+$") + }, + serializedName: "accessPolicyName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters11: OperationParameter = { + parameterPath: "parameters", + mapper: RedisCacheAccessPolicyAssignmentSetMapper +}; diff --git a/sdk/redis/arm-rediscache/src/operations/accessPolicy.ts b/sdk/redis/arm-rediscache/src/operations/accessPolicy.ts new file mode 100644 index 000000000000..cd4933ce6fa3 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/operations/accessPolicy.ts @@ -0,0 +1,499 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { AccessPolicy } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RedisManagementClient } from "../redisManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + RedisCacheAccessPolicy, + AccessPolicyListNextOptionalParams, + AccessPolicyListOptionalParams, + AccessPolicyListResponse, + AccessPolicyCreateUpdateOptionalParams, + AccessPolicyCreateUpdateResponse, + AccessPolicyDeleteOptionalParams, + AccessPolicyGetOptionalParams, + AccessPolicyGetResponse, + AccessPolicyListNextResponse +} from "../models"; + +/// +/** Class containing AccessPolicy operations. */ +export class AccessPolicyImpl implements AccessPolicy { + private readonly client: RedisManagementClient; + + /** + * Initialize a new instance of the class AccessPolicy class. + * @param client Reference to the service client + */ + constructor(client: RedisManagementClient) { + this.client = client; + } + + /** + * Gets the list of access policies associated with this redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, cacheName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + cacheName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: AccessPolicyListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, cacheName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + cacheName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + cacheName, + options + )) { + yield* page; + } + } + + /** + * Adds an access policy to the redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Update Access Policy operation. + * @param options The options parameters. + */ + async beginCreateUpdate( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options?: AccessPolicyCreateUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccessPolicyCreateUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + cacheName, + accessPolicyName, + parameters, + options + }, + spec: createUpdateOperationSpec + }); + const poller = await createHttpPoller< + AccessPolicyCreateUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Adds an access policy to the redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Update Access Policy operation. + * @param options The options parameters. + */ + async beginCreateUpdateAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options?: AccessPolicyCreateUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateUpdate( + resourceGroupName, + cacheName, + accessPolicyName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the access policy from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being deleted from the Redis cache. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, cacheName, accessPolicyName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the access policy from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being deleted from the Redis cache. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + cacheName, + accessPolicyName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the detailed information about an access policy of a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being deleted from the Redis cache. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cacheName, accessPolicyName, options }, + getOperationSpec + ); + } + + /** + * Gets the list of access policies associated with this redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cacheName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + cacheName: string, + nextLink: string, + options?: AccessPolicyListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cacheName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicy + }, + 201: { + bodyMapper: Mappers.RedisCacheAccessPolicy + }, + 202: { + bodyMapper: Mappers.RedisCacheAccessPolicy + }, + 204: { + bodyMapper: Mappers.RedisCacheAccessPolicy + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName, + Parameters.accessPolicyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName, + Parameters.accessPolicyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicy + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName, + Parameters.accessPolicyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicyList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicyList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/redis/arm-rediscache/src/operations/accessPolicyAssignment.ts b/sdk/redis/arm-rediscache/src/operations/accessPolicyAssignment.ts new file mode 100644 index 000000000000..0eb8bf98521b --- /dev/null +++ b/sdk/redis/arm-rediscache/src/operations/accessPolicyAssignment.ts @@ -0,0 +1,499 @@ +/* + * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { AccessPolicyAssignment } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RedisManagementClient } from "../redisManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + RedisCacheAccessPolicyAssignmentSet, + AccessPolicyAssignmentListNextOptionalParams, + AccessPolicyAssignmentListOptionalParams, + AccessPolicyAssignmentListResponse, + AccessPolicyAssignmentCreateUpdateOptionalParams, + AccessPolicyAssignmentCreateUpdateResponse, + AccessPolicyAssignmentDeleteOptionalParams, + AccessPolicyAssignmentGetOptionalParams, + AccessPolicyAssignmentGetResponse, + AccessPolicyAssignmentListNextResponse +} from "../models"; + +/// +/** Class containing AccessPolicyAssignment operations. */ +export class AccessPolicyAssignmentImpl implements AccessPolicyAssignment { + private readonly client: RedisManagementClient; + + /** + * Initialize a new instance of the class AccessPolicyAssignment class. + * @param client Reference to the service client + */ + constructor(client: RedisManagementClient) { + this.client = client; + } + + /** + * Gets the list of access policy assignments associated with this redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyAssignmentListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, cacheName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + cacheName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyAssignmentListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: AccessPolicyAssignmentListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, cacheName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + cacheName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyAssignmentListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + cacheName, + options + )) { + yield* page; + } + } + + /** + * Adds the access policy assignment to the specified users + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy to assign. + * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. + * @param options The options parameters. + */ + async beginCreateUpdate( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicyAssignmentSet, + options?: AccessPolicyAssignmentCreateUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccessPolicyAssignmentCreateUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + cacheName, + accessPolicyName, + parameters, + options + }, + spec: createUpdateOperationSpec + }); + const poller = await createHttpPoller< + AccessPolicyAssignmentCreateUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Adds the access policy assignment to the specified users + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy to assign. + * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. + * @param options The options parameters. + */ + async beginCreateUpdateAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicyAssignmentSet, + options?: AccessPolicyAssignmentCreateUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateUpdate( + resourceGroupName, + cacheName, + accessPolicyName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the access policy assignment from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy being unassigned. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyAssignmentDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, cacheName, accessPolicyName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the access policy assignment from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy being unassigned. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyAssignmentDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + cacheName, + accessPolicyName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the list of assignments for an access policy of a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the assigned access policy. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyAssignmentGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cacheName, accessPolicyName, options }, + getOperationSpec + ); + } + + /** + * Gets the list of access policy assignments associated with this redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyAssignmentListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cacheName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + cacheName: string, + nextLink: string, + options?: AccessPolicyAssignmentListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, cacheName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentSet + }, + 201: { + bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentSet + }, + 202: { + bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentSet + }, + 204: { + bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentSet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters11, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName, + Parameters.accessPolicyName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName, + Parameters.accessPolicyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentSet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName, + Parameters.accessPolicyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.cacheName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/redis/arm-rediscache/src/operations/firewallRules.ts b/sdk/redis/arm-rediscache/src/operations/firewallRules.ts index 819027dcde20..ae0184d04e31 100644 --- a/sdk/redis/arm-rediscache/src/operations/firewallRules.ts +++ b/sdk/redis/arm-rediscache/src/operations/firewallRules.ts @@ -41,7 +41,7 @@ export class FirewallRulesImpl implements FirewallRules { /** * Gets all firewall rules in the specified redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -117,7 +117,7 @@ export class FirewallRulesImpl implements FirewallRules { /** * Gets all firewall rules in the specified redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -134,7 +134,7 @@ export class FirewallRulesImpl implements FirewallRules { /** * Create or update a redis cache firewall rule - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param ruleName The name of the firewall rule. * @param parameters Parameters supplied to the create or update redis firewall rule operation. @@ -155,7 +155,7 @@ export class FirewallRulesImpl implements FirewallRules { /** * Gets a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param ruleName The name of the firewall rule. * @param options The options parameters. @@ -174,7 +174,7 @@ export class FirewallRulesImpl implements FirewallRules { /** * Deletes a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param ruleName The name of the firewall rule. * @param options The options parameters. @@ -193,7 +193,7 @@ export class FirewallRulesImpl implements FirewallRules { /** * ListNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. diff --git a/sdk/redis/arm-rediscache/src/operations/index.ts b/sdk/redis/arm-rediscache/src/operations/index.ts index e161472f0263..346927fc01e5 100644 --- a/sdk/redis/arm-rediscache/src/operations/index.ts +++ b/sdk/redis/arm-rediscache/src/operations/index.ts @@ -14,3 +14,5 @@ export * from "./linkedServer"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./asyncOperationStatus"; +export * from "./accessPolicy"; +export * from "./accessPolicyAssignment"; diff --git a/sdk/redis/arm-rediscache/src/operations/linkedServer.ts b/sdk/redis/arm-rediscache/src/operations/linkedServer.ts index 4f89bff64e63..4485caecca85 100644 --- a/sdk/redis/arm-rediscache/src/operations/linkedServer.ts +++ b/sdk/redis/arm-rediscache/src/operations/linkedServer.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { RedisManagementClient } from "../redisManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { RedisLinkedServerWithProperties, LinkedServerListNextOptionalParams, @@ -44,7 +48,7 @@ export class LinkedServerImpl implements LinkedServer { /** * Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param options The options parameters. */ @@ -115,7 +119,7 @@ export class LinkedServerImpl implements LinkedServer { /** * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param parameters Parameters supplied to the Create Linked server operation. @@ -128,8 +132,8 @@ export class LinkedServerImpl implements LinkedServer { parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkedServerCreateResponse > > { @@ -139,7 +143,7 @@ export class LinkedServerImpl implements LinkedServer { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -172,13 +176,16 @@ export class LinkedServerImpl implements LinkedServer { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, name, linkedServerName, parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, name, linkedServerName, parameters, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + LinkedServerCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -187,7 +194,7 @@ export class LinkedServerImpl implements LinkedServer { /** * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param parameters Parameters supplied to the Create Linked server operation. @@ -212,7 +219,7 @@ export class LinkedServerImpl implements LinkedServer { /** * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param options The options parameters. @@ -222,14 +229,14 @@ export class LinkedServerImpl implements LinkedServer { name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -262,13 +269,13 @@ export class LinkedServerImpl implements LinkedServer { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, name, linkedServerName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, name, linkedServerName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -277,7 +284,7 @@ export class LinkedServerImpl implements LinkedServer { /** * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param options The options parameters. @@ -299,7 +306,7 @@ export class LinkedServerImpl implements LinkedServer { /** * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param linkedServerName The name of the linked server. * @param options The options parameters. @@ -318,7 +325,7 @@ export class LinkedServerImpl implements LinkedServer { /** * Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param options The options parameters. */ @@ -335,7 +342,7 @@ export class LinkedServerImpl implements LinkedServer { /** * ListNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. diff --git a/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts b/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts index 4a369c080581..8d1aab89c2a9 100644 --- a/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts +++ b/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts @@ -42,7 +42,7 @@ export class PatchSchedulesImpl implements PatchSchedules { /** * Gets all patch schedules in the specified redis cache (there is only one). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -126,7 +126,7 @@ export class PatchSchedulesImpl implements PatchSchedules { /** * Gets all patch schedules in the specified redis cache (there is only one). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -143,7 +143,7 @@ export class PatchSchedulesImpl implements PatchSchedules { /** * Create or replace the patching schedule for Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param parameters Parameters to set the patching schedule for Redis cache. @@ -164,7 +164,7 @@ export class PatchSchedulesImpl implements PatchSchedules { /** * Deletes the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param options The options parameters. @@ -183,7 +183,7 @@ export class PatchSchedulesImpl implements PatchSchedules { /** * Gets the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param options The options parameters. @@ -202,7 +202,7 @@ export class PatchSchedulesImpl implements PatchSchedules { /** * ListByRedisResourceNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param nextLink The nextLink from the previous successful call to the ListByRedisResource method. * @param options The options parameters. diff --git a/sdk/redis/arm-rediscache/src/operations/privateEndpointConnections.ts b/sdk/redis/arm-rediscache/src/operations/privateEndpointConnections.ts index cf5cbb5827b2..9c1aea2c9620 100644 --- a/sdk/redis/arm-rediscache/src/operations/privateEndpointConnections.ts +++ b/sdk/redis/arm-rediscache/src/operations/privateEndpointConnections.ts @@ -12,8 +12,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { RedisManagementClient } from "../redisManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { PrivateEndpointConnection, PrivateEndpointConnectionsListOptionalParams, @@ -41,7 +45,7 @@ export class PrivateEndpointConnectionsImpl /** * List all the private endpoint connections associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -99,7 +103,7 @@ export class PrivateEndpointConnectionsImpl /** * List all the private endpoint connections associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -116,7 +120,7 @@ export class PrivateEndpointConnectionsImpl /** * Gets the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource @@ -136,7 +140,7 @@ export class PrivateEndpointConnectionsImpl /** * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource @@ -150,8 +154,8 @@ export class PrivateEndpointConnectionsImpl properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsPutResponse > > { @@ -161,7 +165,7 @@ export class PrivateEndpointConnectionsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -194,19 +198,22 @@ export class PrivateEndpointConnectionsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, cacheName, privateEndpointConnectionName, properties, options }, - putOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: putOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsPutResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -215,7 +222,7 @@ export class PrivateEndpointConnectionsImpl /** * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource @@ -241,7 +248,7 @@ export class PrivateEndpointConnectionsImpl /** * Deletes the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource diff --git a/sdk/redis/arm-rediscache/src/operations/privateLinkResources.ts b/sdk/redis/arm-rediscache/src/operations/privateLinkResources.ts index 05f33567a2a4..f484cac73f7d 100644 --- a/sdk/redis/arm-rediscache/src/operations/privateLinkResources.ts +++ b/sdk/redis/arm-rediscache/src/operations/privateLinkResources.ts @@ -33,7 +33,7 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { /** * Gets the private link resources that need to be created for a redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -99,7 +99,7 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { /** * Gets the private link resources that need to be created for a redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ diff --git a/sdk/redis/arm-rediscache/src/operations/redis.ts b/sdk/redis/arm-rediscache/src/operations/redis.ts index ed9e14beb842..9e26b1a79e49 100644 --- a/sdk/redis/arm-rediscache/src/operations/redis.ts +++ b/sdk/redis/arm-rediscache/src/operations/redis.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { RedisManagementClient } from "../redisManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { UpgradeNotification, RedisListUpgradeNotificationsNextOptionalParams, @@ -70,7 +74,7 @@ export class RedisImpl implements Redis { /** * Gets any upgrade notifications for a Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param history how many minutes in past to look for upgrade notifications * @param options The options parameters. @@ -162,7 +166,7 @@ export class RedisImpl implements Redis { /** * Lists all Redis caches in a resource group. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ public listByResourceGroup( @@ -301,7 +305,7 @@ export class RedisImpl implements Redis { /** * Gets any upgrade notifications for a Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param history how many minutes in past to look for upgrade notifications * @param options The options parameters. @@ -320,7 +324,7 @@ export class RedisImpl implements Redis { /** * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Create Redis operation. * @param options The options parameters. @@ -331,7 +335,7 @@ export class RedisImpl implements Redis { parameters: RedisCreateParameters, options?: RedisCreateOptionalParams ): Promise< - PollerLike, RedisCreateResponse> + SimplePollerLike, RedisCreateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -339,7 +343,7 @@ export class RedisImpl implements Redis { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -372,13 +376,16 @@ export class RedisImpl implements Redis { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, name, parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, name, parameters, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + RedisCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -387,7 +394,7 @@ export class RedisImpl implements Redis { /** * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Create Redis operation. * @param options The options parameters. @@ -409,7 +416,7 @@ export class RedisImpl implements Redis { /** * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Update Redis operation. * @param options The options parameters. @@ -420,7 +427,7 @@ export class RedisImpl implements Redis { parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams ): Promise< - PollerLike, RedisUpdateResponse> + SimplePollerLike, RedisUpdateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -428,7 +435,7 @@ export class RedisImpl implements Redis { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -461,13 +468,16 @@ export class RedisImpl implements Redis { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, name, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, name, parameters, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + RedisUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -476,7 +486,7 @@ export class RedisImpl implements Redis { /** * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Update Redis operation. * @param options The options parameters. @@ -498,7 +508,7 @@ export class RedisImpl implements Redis { /** * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -506,14 +516,14 @@ export class RedisImpl implements Redis { resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -546,13 +556,13 @@ export class RedisImpl implements Redis { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, name, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, name, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -561,7 +571,7 @@ export class RedisImpl implements Redis { /** * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -576,7 +586,7 @@ export class RedisImpl implements Redis { /** * Gets a Redis cache (resource description). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -593,7 +603,7 @@ export class RedisImpl implements Redis { /** * Lists all Redis caches in a resource group. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ private _listByResourceGroup( @@ -622,7 +632,7 @@ export class RedisImpl implements Redis { /** * Retrieve a Redis cache's access keys. This operation requires write permission to the cache * resource. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -640,7 +650,7 @@ export class RedisImpl implements Redis { /** * Regenerate Redis cache's access keys. This operation requires write permission to the cache * resource. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Specifies which key to regenerate. * @param options The options parameters. @@ -660,7 +670,7 @@ export class RedisImpl implements Redis { /** * Reboot specified Redis node(s). This operation requires write permission to the cache resource. * There can be potential data loss. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Specifies which Redis node(s) to reboot. * @param options The options parameters. @@ -679,7 +689,7 @@ export class RedisImpl implements Redis { /** * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis import operation. * @param options The options parameters. @@ -689,14 +699,14 @@ export class RedisImpl implements Redis { name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -729,13 +739,13 @@ export class RedisImpl implements Redis { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, name, parameters, options }, - importDataOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, name, parameters, options }, + spec: importDataOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -744,7 +754,7 @@ export class RedisImpl implements Redis { /** * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis import operation. * @param options The options parameters. @@ -766,7 +776,7 @@ export class RedisImpl implements Redis { /** * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis export operation. * @param options The options parameters. @@ -776,14 +786,14 @@ export class RedisImpl implements Redis { name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -816,13 +826,13 @@ export class RedisImpl implements Redis { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, name, parameters, options }, - exportDataOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, name, parameters, options }, + spec: exportDataOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -831,7 +841,7 @@ export class RedisImpl implements Redis { /** * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis export operation. * @param options The options parameters. @@ -853,7 +863,7 @@ export class RedisImpl implements Redis { /** * ListUpgradeNotificationsNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param nextLink The nextLink from the previous successful call to the ListUpgradeNotifications * method. @@ -873,7 +883,7 @@ export class RedisImpl implements Redis { /** * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. * @param options The options parameters. */ diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicy.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicy.ts new file mode 100644 index 000000000000..b30fdcd0e922 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicy.ts @@ -0,0 +1,109 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + RedisCacheAccessPolicy, + AccessPolicyListOptionalParams, + AccessPolicyCreateUpdateOptionalParams, + AccessPolicyCreateUpdateResponse, + AccessPolicyDeleteOptionalParams, + AccessPolicyGetOptionalParams, + AccessPolicyGetResponse +} from "../models"; + +/// +/** Interface representing a AccessPolicy. */ +export interface AccessPolicy { + /** + * Gets the list of access policies associated with this redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Adds an access policy to the redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Update Access Policy operation. + * @param options The options parameters. + */ + beginCreateUpdate( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options?: AccessPolicyCreateUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccessPolicyCreateUpdateResponse + > + >; + /** + * Adds an access policy to the redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being added to the Redis cache. + * @param parameters Parameters supplied to the Create Update Access Policy operation. + * @param options The options parameters. + */ + beginCreateUpdateAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options?: AccessPolicyCreateUpdateOptionalParams + ): Promise; + /** + * Deletes the access policy from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being deleted from the Redis cache. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the access policy from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being deleted from the Redis cache. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyDeleteOptionalParams + ): Promise; + /** + * Gets the detailed information about an access policy of a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy that is being deleted from the Redis cache. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyGetOptionalParams + ): Promise; +} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicyAssignment.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicyAssignment.ts new file mode 100644 index 000000000000..6f2c58238858 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicyAssignment.ts @@ -0,0 +1,109 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + RedisCacheAccessPolicyAssignmentSet, + AccessPolicyAssignmentListOptionalParams, + AccessPolicyAssignmentCreateUpdateOptionalParams, + AccessPolicyAssignmentCreateUpdateResponse, + AccessPolicyAssignmentDeleteOptionalParams, + AccessPolicyAssignmentGetOptionalParams, + AccessPolicyAssignmentGetResponse +} from "../models"; + +/// +/** Interface representing a AccessPolicyAssignment. */ +export interface AccessPolicyAssignment { + /** + * Gets the list of access policy assignments associated with this redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyAssignmentListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Adds the access policy assignment to the specified users + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy to assign. + * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. + * @param options The options parameters. + */ + beginCreateUpdate( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicyAssignmentSet, + options?: AccessPolicyAssignmentCreateUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + AccessPolicyAssignmentCreateUpdateResponse + > + >; + /** + * Adds the access policy assignment to the specified users + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy to assign. + * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. + * @param options The options parameters. + */ + beginCreateUpdateAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicyAssignmentSet, + options?: AccessPolicyAssignmentCreateUpdateOptionalParams + ): Promise; + /** + * Deletes the access policy assignment from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy being unassigned. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyAssignmentDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the access policy assignment from a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the access policy being unassigned. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyAssignmentDeleteOptionalParams + ): Promise; + /** + * Gets the list of assignments for an access policy of a redis cache + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cacheName The name of the Redis cache. + * @param accessPolicyName The name of the assigned access policy. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyAssignmentGetOptionalParams + ): Promise; +} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/firewallRules.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/firewallRules.ts index d6ced9f389a2..6929e35cc180 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/firewallRules.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/firewallRules.ts @@ -22,7 +22,7 @@ import { export interface FirewallRules { /** * Gets all firewall rules in the specified redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -33,7 +33,7 @@ export interface FirewallRules { ): PagedAsyncIterableIterator; /** * Create or update a redis cache firewall rule - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param ruleName The name of the firewall rule. * @param parameters Parameters supplied to the create or update redis firewall rule operation. @@ -48,7 +48,7 @@ export interface FirewallRules { ): Promise; /** * Gets a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param ruleName The name of the firewall rule. * @param options The options parameters. @@ -61,7 +61,7 @@ export interface FirewallRules { ): Promise; /** * Deletes a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param ruleName The name of the firewall rule. * @param options The options parameters. diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/index.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/index.ts index e161472f0263..346927fc01e5 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/index.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/index.ts @@ -14,3 +14,5 @@ export * from "./linkedServer"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./asyncOperationStatus"; +export * from "./accessPolicy"; +export * from "./accessPolicyAssignment"; diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/linkedServer.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/linkedServer.ts index 178e46712083..b7f6bc5ac66d 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/linkedServer.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/linkedServer.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { RedisLinkedServerWithProperties, LinkedServerListOptionalParams, @@ -24,7 +24,7 @@ import { export interface LinkedServer { /** * Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param options The options parameters. */ @@ -35,7 +35,7 @@ export interface LinkedServer { ): PagedAsyncIterableIterator; /** * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param parameters Parameters supplied to the Create Linked server operation. @@ -48,14 +48,14 @@ export interface LinkedServer { parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkedServerCreateResponse > >; /** * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param parameters Parameters supplied to the Create Linked server operation. @@ -70,7 +70,7 @@ export interface LinkedServer { ): Promise; /** * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param options The options parameters. @@ -80,10 +80,10 @@ export interface LinkedServer { name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param linkedServerName The name of the linked server that is being added to the Redis cache. * @param options The options parameters. @@ -96,7 +96,7 @@ export interface LinkedServer { ): Promise; /** * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param linkedServerName The name of the linked server. * @param options The options parameters. diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts index fa0cc7719bb1..2134820241ec 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts @@ -23,7 +23,7 @@ import { export interface PatchSchedules { /** * Gets all patch schedules in the specified redis cache (there is only one). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -34,7 +34,7 @@ export interface PatchSchedules { ): PagedAsyncIterableIterator; /** * Create or replace the patching schedule for Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param parameters Parameters to set the patching schedule for Redis cache. @@ -49,7 +49,7 @@ export interface PatchSchedules { ): Promise; /** * Deletes the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param options The options parameters. @@ -62,7 +62,7 @@ export interface PatchSchedules { ): Promise; /** * Gets the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the redis cache. * @param defaultParam Default string modeled as parameter for auto generation to work correctly. * @param options The options parameters. diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/privateEndpointConnections.ts index 17937ea28e24..b06ec21e9d5b 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/privateEndpointConnections.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PrivateEndpointConnection, PrivateEndpointConnectionsListOptionalParams, @@ -23,7 +23,7 @@ import { export interface PrivateEndpointConnections { /** * List all the private endpoint connections associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ @@ -34,7 +34,7 @@ export interface PrivateEndpointConnections { ): PagedAsyncIterableIterator; /** * Gets the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource @@ -48,7 +48,7 @@ export interface PrivateEndpointConnections { ): Promise; /** * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource @@ -62,14 +62,14 @@ export interface PrivateEndpointConnections { properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsPutResponse > >; /** * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource @@ -85,7 +85,7 @@ export interface PrivateEndpointConnections { ): Promise; /** * Deletes the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the * Azure resource diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateLinkResources.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/privateLinkResources.ts index b8740b709a79..ab3f7b346e08 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateLinkResources.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/privateLinkResources.ts @@ -17,7 +17,7 @@ import { export interface PrivateLinkResources { /** * Gets the private link resources that need to be created for a redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param cacheName The name of the Redis cache. * @param options The options parameters. */ diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/redis.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/redis.ts index 90c7fba54303..039984685aab 100644 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/redis.ts +++ b/sdk/redis/arm-rediscache/src/operationsInterfaces/redis.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { UpgradeNotification, RedisListUpgradeNotificationsOptionalParams, @@ -44,7 +44,7 @@ import { export interface Redis { /** * Gets any upgrade notifications for a Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param history how many minutes in past to look for upgrade notifications * @param options The options parameters. @@ -57,7 +57,7 @@ export interface Redis { ): PagedAsyncIterableIterator; /** * Lists all Redis caches in a resource group. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ listByResourceGroup( @@ -83,7 +83,7 @@ export interface Redis { ): Promise; /** * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Create Redis operation. * @param options The options parameters. @@ -94,11 +94,11 @@ export interface Redis { parameters: RedisCreateParameters, options?: RedisCreateOptionalParams ): Promise< - PollerLike, RedisCreateResponse> + SimplePollerLike, RedisCreateResponse> >; /** * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Create Redis operation. * @param options The options parameters. @@ -111,7 +111,7 @@ export interface Redis { ): Promise; /** * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Update Redis operation. * @param options The options parameters. @@ -122,11 +122,11 @@ export interface Redis { parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams ): Promise< - PollerLike, RedisUpdateResponse> + SimplePollerLike, RedisUpdateResponse> >; /** * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters supplied to the Update Redis operation. * @param options The options parameters. @@ -139,7 +139,7 @@ export interface Redis { ): Promise; /** * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -147,10 +147,10 @@ export interface Redis { resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -161,7 +161,7 @@ export interface Redis { ): Promise; /** * Gets a Redis cache (resource description). - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -173,7 +173,7 @@ export interface Redis { /** * Retrieve a Redis cache's access keys. This operation requires write permission to the cache * resource. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param options The options parameters. */ @@ -185,7 +185,7 @@ export interface Redis { /** * Regenerate Redis cache's access keys. This operation requires write permission to the cache * resource. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Specifies which key to regenerate. * @param options The options parameters. @@ -199,7 +199,7 @@ export interface Redis { /** * Reboot specified Redis node(s). This operation requires write permission to the cache resource. * There can be potential data loss. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Specifies which Redis node(s) to reboot. * @param options The options parameters. @@ -212,7 +212,7 @@ export interface Redis { ): Promise; /** * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis import operation. * @param options The options parameters. @@ -222,10 +222,10 @@ export interface Redis { name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis import operation. * @param options The options parameters. @@ -238,7 +238,7 @@ export interface Redis { ): Promise; /** * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis export operation. * @param options The options parameters. @@ -248,10 +248,10 @@ export interface Redis { name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param name The name of the Redis cache. * @param parameters Parameters for Redis export operation. * @param options The options parameters. diff --git a/sdk/redis/arm-rediscache/src/redisManagementClient.ts b/sdk/redis/arm-rediscache/src/redisManagementClient.ts index c65e46d52f15..7c8baa65f184 100644 --- a/sdk/redis/arm-rediscache/src/redisManagementClient.ts +++ b/sdk/redis/arm-rediscache/src/redisManagementClient.ts @@ -22,7 +22,9 @@ import { LinkedServerImpl, PrivateEndpointConnectionsImpl, PrivateLinkResourcesImpl, - AsyncOperationStatusImpl + AsyncOperationStatusImpl, + AccessPolicyImpl, + AccessPolicyAssignmentImpl } from "./operations"; import { Operations, @@ -32,7 +34,9 @@ import { LinkedServer, PrivateEndpointConnections, PrivateLinkResources, - AsyncOperationStatus + AsyncOperationStatus, + AccessPolicy, + AccessPolicyAssignment } from "./operationsInterfaces"; import { RedisManagementClientOptionalParams } from "./models"; @@ -44,8 +48,7 @@ export class RedisManagementClient extends coreClient.ServiceClient { /** * Initializes a new instance of the RedisManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. + * @param subscriptionId The ID of the target subscription. * @param options The parameter options */ constructor( @@ -69,7 +72,7 @@ export class RedisManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-rediscache/7.1.2`; + const packageDetails = `azsdk-js-arm-rediscache/7.2.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -122,7 +125,7 @@ export class RedisManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-06-01"; + this.apiVersion = options.apiVersion || "2023-05-01"; this.operations = new OperationsImpl(this); this.redis = new RedisImpl(this); this.firewallRules = new FirewallRulesImpl(this); @@ -131,6 +134,8 @@ export class RedisManagementClient extends coreClient.ServiceClient { this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); this.asyncOperationStatus = new AsyncOperationStatusImpl(this); + this.accessPolicy = new AccessPolicyImpl(this); + this.accessPolicyAssignment = new AccessPolicyAssignmentImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -170,4 +175,6 @@ export class RedisManagementClient extends coreClient.ServiceClient { privateEndpointConnections: PrivateEndpointConnections; privateLinkResources: PrivateLinkResources; asyncOperationStatus: AsyncOperationStatus; + accessPolicy: AccessPolicy; + accessPolicyAssignment: AccessPolicyAssignment; } diff --git a/sdk/redis/arm-rediscache/test/sampleTest.ts b/sdk/redis/arm-rediscache/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/redis/arm-rediscache/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/redis/arm-rediscache/tsconfig.json b/sdk/redis/arm-rediscache/tsconfig.json index a52528a33769..3e6ae96443f3 100644 --- a/sdk/redis/arm-rediscache/tsconfig.json +++ b/sdk/redis/arm-rediscache/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-rediscache": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"