From ae3947edc6337db1432689e22b652d6973d9ec7c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 24 Jan 2022 06:41:16 +0000 Subject: [PATCH] CodeGen from PR 17444 in Azure/azure-rest-api-specs [Azure App Configuration] Add 2021-10-01-preview version (#17444) * Add 2021-10-01 folder * Update readme * Remove wrong folder * Add 2021-10-01-preview folder * Update enum value --- .../arm-appconfiguration/CHANGELOG.md | 16 +- .../arm-appconfiguration/_meta.json | 6 +- .../arm-appconfiguration/api-extractor.json | 25 +- .../arm-appconfiguration/package.json | 2 +- .../review/arm-appconfiguration.api.md | 66 +++++ .../src/appConfigurationManagementClient.ts | 4 +- .../arm-appconfiguration/src/models/index.ts | 102 +++++++ .../src/models/mappers.ts | 122 +++++++++ .../src/models/parameters.ts | 13 +- .../src/operations/configurationStores.ts | 259 +++++++++++++++++- .../src/operations/operations.ts | 43 +++ .../configurationStores.ts | 47 +++- .../src/operationsInterfaces/operations.ts | 16 +- .../arm-appconfiguration/tsconfig.json | 16 +- 14 files changed, 704 insertions(+), 33 deletions(-) diff --git a/sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md index 61ffbe8c22be..36a785f3e3e2 100644 --- a/sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 3.0.0-beta.2 (2022-01-24) -## 3.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 3.0.0-beta.1 (2022-01-11) - -The package of @azure/arm-appconfiguration is using our next generation design principles since version 3.0.0-beta.1, which contains breaking changes. +The package of @azure/arm-appconfiguration is using our next generation design principles since version 3.0.0-beta.2, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/appconfiguration/arm-appconfiguration/_meta.json b/sdk/appconfiguration/arm-appconfiguration/_meta.json index dfe465051dd9..97eb5f4a3dad 100644 --- a/sdk/appconfiguration/arm-appconfiguration/_meta.json +++ b/sdk/appconfiguration/arm-appconfiguration/_meta.json @@ -1,7 +1,7 @@ { - "commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247", + "commit": "07a5e295f24eb5ee641cb6bec6bbbfa49d1c7b40", "readme": "specification/appconfiguration/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/appconfiguration/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211217.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/appconfiguration/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20211217.1" + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/appconfiguration/arm-appconfiguration/api-extractor.json b/sdk/appconfiguration/arm-appconfiguration/api-extractor.json index 08be32d6b7cc..08e68e9237c4 100644 --- a/sdk/appconfiguration/arm-appconfiguration/api-extractor.json +++ b/sdk/appconfiguration/arm-appconfiguration/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-appconfiguration.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/appconfiguration/arm-appconfiguration/package.json b/sdk/appconfiguration/arm-appconfiguration/package.json index 14c547032d2a..cd0b9dca8b85 100644 --- a/sdk/appconfiguration/arm-appconfiguration/package.json +++ b/sdk/appconfiguration/arm-appconfiguration/package.json @@ -99,4 +99,4 @@ }, "sideEffects": false, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/appconfiguration/arm-appconfiguration/review/arm-appconfiguration.api.md b/sdk/appconfiguration/arm-appconfiguration/review/arm-appconfiguration.api.md index 641684e9aee3..8fcfe44d1f16 100644 --- a/sdk/appconfiguration/arm-appconfiguration/review/arm-appconfiguration.api.md +++ b/sdk/appconfiguration/arm-appconfiguration/review/arm-appconfiguration.api.md @@ -78,6 +78,9 @@ export type ConfigurationStore = TrackedResource & { readonly privateEndpointConnections?: PrivateEndpointConnectionReference[]; publicNetworkAccess?: PublicNetworkAccess; disableLocalAuth?: boolean; + softDeleteRetentionInDays?: number; + enablePurgeProtection?: boolean; + createMode?: CreateMode; }; // @public @@ -92,11 +95,15 @@ export interface ConfigurationStores { beginCreateAndWait(resourceGroupName: string, configStoreName: string, configStoreCreationParameters: ConfigurationStore, options?: ConfigurationStoresCreateOptionalParams): Promise; beginDelete(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresDeleteOptionalParams): Promise; + beginPurgeDeleted(location: string, configStoreName: string, options?: ConfigurationStoresPurgeDeletedOptionalParams): Promise, void>>; + beginPurgeDeletedAndWait(location: string, configStoreName: string, options?: ConfigurationStoresPurgeDeletedOptionalParams): Promise; beginUpdate(resourceGroupName: string, configStoreName: string, configStoreUpdateParameters: ConfigurationStoreUpdateParameters, options?: ConfigurationStoresUpdateOptionalParams): Promise, ConfigurationStoresUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, configStoreName: string, configStoreUpdateParameters: ConfigurationStoreUpdateParameters, options?: ConfigurationStoresUpdateOptionalParams): Promise; get(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresGetOptionalParams): Promise; + getDeleted(location: string, configStoreName: string, options?: ConfigurationStoresGetDeletedOptionalParams): Promise; list(options?: ConfigurationStoresListOptionalParams): PagedAsyncIterableIterator; listByResourceGroup(resourceGroupName: string, options?: ConfigurationStoresListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listDeleted(options?: ConfigurationStoresListDeletedOptionalParams): PagedAsyncIterableIterator; listKeys(resourceGroupName: string, configStoreName: string, options?: ConfigurationStoresListKeysOptionalParams): PagedAsyncIterableIterator; regenerateKey(resourceGroupName: string, configStoreName: string, regenerateKeyParameters: RegenerateKeyParameters, options?: ConfigurationStoresRegenerateKeyOptionalParams): Promise; } @@ -116,6 +123,13 @@ export interface ConfigurationStoresDeleteOptionalParams extends coreClient.Oper updateIntervalInMs?: number; } +// @public +export interface ConfigurationStoresGetDeletedOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationStoresGetDeletedResponse = DeletedConfigurationStore; + // @public export interface ConfigurationStoresGetOptionalParams extends coreClient.OperationOptions { } @@ -139,6 +153,20 @@ export interface ConfigurationStoresListByResourceGroupOptionalParams extends co // @public export type ConfigurationStoresListByResourceGroupResponse = ConfigurationStoreListResult; +// @public +export interface ConfigurationStoresListDeletedNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationStoresListDeletedNextResponse = DeletedConfigurationStoreListResult; + +// @public +export interface ConfigurationStoresListDeletedOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ConfigurationStoresListDeletedResponse = DeletedConfigurationStoreListResult; + // @public export interface ConfigurationStoresListKeysNextOptionalParams extends coreClient.OperationOptions { skipToken?: string; @@ -171,6 +199,12 @@ export interface ConfigurationStoresListOptionalParams extends coreClient.Operat // @public export type ConfigurationStoresListResponse = ConfigurationStoreListResult; +// @public +export interface ConfigurationStoresPurgeDeletedOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface ConfigurationStoresRegenerateKeyOptionalParams extends coreClient.OperationOptions { } @@ -205,6 +239,30 @@ export type ConnectionStatus = string; // @public export type CreatedByType = string; +// @public +export type CreateMode = "Recover" | "Default"; + +// @public +export interface DeletedConfigurationStore { + readonly configurationStoreId?: string; + readonly deletionDate?: Date; + readonly id?: string; + readonly location?: string; + readonly name?: string; + readonly purgeProtectionEnabled?: boolean; + readonly scheduledPurgeDate?: Date; + readonly tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface DeletedConfigurationStoreListResult { + nextLink?: string; + value?: DeletedConfigurationStore[]; +} + // @public export interface EncryptionProperties { keyVaultProperties?: KeyVaultProperties; @@ -445,6 +503,7 @@ export interface OperationProperties { export interface Operations { checkNameAvailability(checkNameAvailabilityParameters: CheckNameAvailabilityParameters, options?: OperationsCheckNameAvailabilityOptionalParams): Promise; list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + regionalCheckNameAvailability(location: string, checkNameAvailabilityParameters: CheckNameAvailabilityParameters, options?: OperationsRegionalCheckNameAvailabilityOptionalParams): Promise; } // @public @@ -470,6 +529,13 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption // @public export type OperationsListResponse = OperationDefinitionListResult; +// @public +export interface OperationsRegionalCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsRegionalCheckNameAvailabilityResponse = NameAvailabilityStatus; + // @public export interface PrivateEndpoint { id?: string; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts index 7cd72daee525..4e09701a01af 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts @@ -56,7 +56,7 @@ export class AppConfigurationManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-appconfiguration/3.0.0-beta.1`; + const packageDetails = `azsdk-js-arm-appconfiguration/3.0.0-beta.2`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -79,7 +79,7 @@ export class AppConfigurationManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-03-01-preview"; + this.apiVersion = options.apiVersion || "2021-10-01-preview"; this.configurationStores = new ConfigurationStoresImpl(this); this.operations = new OperationsImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts index ec23c1ed4936..b3930811cf4c 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts @@ -513,6 +513,63 @@ export interface KeyValue { tags?: { [propertyName: string]: string }; } +/** List of deleted configuration stores */ +export interface DeletedConfigurationStoreListResult { + /** The list of deleted configuration store. */ + value?: DeletedConfigurationStore[]; + /** The URL to get the next set of deleted configuration stores. */ + nextLink?: string; +} + +/** Deleted configuration store information with extended details. */ +export interface DeletedConfigurationStore { + /** + * The resource ID for the deleted configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The resource type of the configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The resource id of the original configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly configurationStoreId?: string; + /** + * The location of the original configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly location?: string; + /** + * The deleted date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deletionDate?: Date; + /** + * The scheduled purged date. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly scheduledPurgeDate?: Date; + /** + * Tags of the original configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tags?: { [propertyName: string]: string }; + /** + * Purge protection status of the original configuration store. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly purgeProtectionEnabled?: boolean; +} + /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export type TrackedResource = Resource & { /** Resource tags. */ @@ -558,6 +615,12 @@ export type ConfigurationStore = TrackedResource & { publicNetworkAccess?: PublicNetworkAccess; /** Disables all authentication methods other than AAD authentication. */ disableLocalAuth?: boolean; + /** The amount of time in days that the configuration store will be retained when it is soft deleted. */ + softDeleteRetentionInDays?: number; + /** Property specifying whether protection against purge is enabled for this configuration store. */ + enablePurgeProtection?: boolean; + /** Indicates whether the configuration store need to be recovered. */ + createMode?: CreateMode; }; /** Known values of {@link IdentityType} that the service accepts. */ @@ -689,6 +752,8 @@ export enum KnownConfigurationResourceType { * **Microsoft.AppConfiguration\/configurationStores** */ export type ConfigurationResourceType = string; +/** Defines values for CreateMode. */ +export type CreateMode = "Recover" | "Default"; /** Optional parameters. */ export interface ConfigurationStoresListOptionalParams @@ -767,6 +832,29 @@ export interface ConfigurationStoresRegenerateKeyOptionalParams /** Contains response data for the regenerateKey operation. */ export type ConfigurationStoresRegenerateKeyResponse = ApiKey; +/** Optional parameters. */ +export interface ConfigurationStoresListDeletedOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listDeleted operation. */ +export type ConfigurationStoresListDeletedResponse = DeletedConfigurationStoreListResult; + +/** Optional parameters. */ +export interface ConfigurationStoresGetDeletedOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getDeleted operation. */ +export type ConfigurationStoresGetDeletedResponse = DeletedConfigurationStore; + +/** Optional parameters. */ +export interface ConfigurationStoresPurgeDeletedOptionalParams + 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 ConfigurationStoresListNextOptionalParams extends coreClient.OperationOptions { @@ -797,6 +885,13 @@ export interface ConfigurationStoresListKeysNextOptionalParams /** Contains response data for the listKeysNext operation. */ export type ConfigurationStoresListKeysNextResponse = ApiKeyListResult; +/** Optional parameters. */ +export interface ConfigurationStoresListDeletedNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listDeletedNext operation. */ +export type ConfigurationStoresListDeletedNextResponse = DeletedConfigurationStoreListResult; + /** Optional parameters. */ export interface OperationsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions {} @@ -814,6 +909,13 @@ export interface OperationsListOptionalParams /** Contains response data for the list operation. */ export type OperationsListResponse = OperationDefinitionListResult; +/** Optional parameters. */ +export interface OperationsRegionalCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the regionalCheckNameAvailability operation. */ +export type OperationsRegionalCheckNameAvailabilityResponse = NameAvailabilityStatus; + /** Optional parameters. */ export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts index 05f8e7237862..440ec87faee3 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts @@ -1132,6 +1132,106 @@ export const KeyValue: coreClient.CompositeMapper = { } }; +export const DeletedConfigurationStoreListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeletedConfigurationStoreListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeletedConfigurationStore" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const DeletedConfigurationStore: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeletedConfigurationStore", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + configurationStoreId: { + serializedName: "properties.configurationStoreId", + readOnly: true, + type: { + name: "String" + } + }, + location: { + serializedName: "properties.location", + readOnly: true, + type: { + name: "String" + } + }, + deletionDate: { + serializedName: "properties.deletionDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + scheduledPurgeDate: { + serializedName: "properties.scheduledPurgeDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + tags: { + serializedName: "properties.tags", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + purgeProtectionEnabled: { + serializedName: "properties.purgeProtectionEnabled", + readOnly: true, + type: { + name: "Boolean" + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1231,10 +1331,32 @@ export const ConfigurationStore: coreClient.CompositeMapper = { } }, disableLocalAuth: { + defaultValue: false, serializedName: "properties.disableLocalAuth", type: { name: "Boolean" } + }, + softDeleteRetentionInDays: { + defaultValue: 7, + serializedName: "properties.softDeleteRetentionInDays", + type: { + name: "Number" + } + }, + enablePurgeProtection: { + defaultValue: false, + serializedName: "properties.enablePurgeProtection", + type: { + name: "Boolean" + } + }, + createMode: { + serializedName: "properties.createMode", + type: { + name: "Enum", + allowedValues: ["Recover", "Default"] + } } } } diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts index 4d6607498f79..ac37fac11899 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts @@ -58,7 +58,7 @@ export const subscriptionId: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-03-01-preview", + defaultValue: "2021-10-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -131,6 +131,17 @@ export const regenerateKeyParameters: OperationParameter = { mapper: RegenerateKeyParametersMapper }; +export const location: OperationURLParameter = { + parameterPath: "location", + mapper: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } +}; + export const nextLink: OperationURLParameter = { parameterPath: "nextLink", mapper: { diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts index 6da143d3dc98..68edd6bdf425 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts @@ -23,6 +23,9 @@ import { ApiKey, ConfigurationStoresListKeysNextOptionalParams, ConfigurationStoresListKeysOptionalParams, + DeletedConfigurationStore, + ConfigurationStoresListDeletedNextOptionalParams, + ConfigurationStoresListDeletedOptionalParams, ConfigurationStoresListResponse, ConfigurationStoresListByResourceGroupResponse, ConfigurationStoresGetOptionalParams, @@ -37,9 +40,14 @@ import { RegenerateKeyParameters, ConfigurationStoresRegenerateKeyOptionalParams, ConfigurationStoresRegenerateKeyResponse, + ConfigurationStoresListDeletedResponse, + ConfigurationStoresGetDeletedOptionalParams, + ConfigurationStoresGetDeletedResponse, + ConfigurationStoresPurgeDeletedOptionalParams, ConfigurationStoresListNextResponse, ConfigurationStoresListByResourceGroupNextResponse, - ConfigurationStoresListKeysNextResponse + ConfigurationStoresListKeysNextResponse, + ConfigurationStoresListDeletedNextResponse } from "../models"; /// @@ -221,6 +229,48 @@ export class ConfigurationStoresImpl implements ConfigurationStores { } } + /** + * Gets information about the deleted configuration stores in a subscription. + * @param options The options parameters. + */ + public listDeleted( + options?: ConfigurationStoresListDeletedOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listDeletedPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listDeletedPagingPage(options); + } + }; + } + + private async *listDeletedPagingPage( + options?: ConfigurationStoresListDeletedOptionalParams + ): AsyncIterableIterator { + let result = await this._listDeleted(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listDeletedNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listDeletedPagingAll( + options?: ConfigurationStoresListDeletedOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listDeletedPagingPage(options)) { + yield* page; + } + } + /** * Lists the configuration stores for a given subscription. * @param options The options parameters. @@ -569,6 +619,116 @@ export class ConfigurationStoresImpl implements ConfigurationStores { ); } + /** + * Gets information about the deleted configuration stores in a subscription. + * @param options The options parameters. + */ + private _listDeleted( + options?: ConfigurationStoresListDeletedOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listDeletedOperationSpec + ); + } + + /** + * Gets a deleted Azure app configuration store. + * @param location The location in which uniqueness will be verified. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + getDeleted( + location: string, + configStoreName: string, + options?: ConfigurationStoresGetDeletedOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, configStoreName, options }, + getDeletedOperationSpec + ); + } + + /** + * Permanently deletes the specified configuration store. + * @param location The location in which uniqueness will be verified. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + async beginPurgeDeleted( + location: string, + configStoreName: string, + options?: ConfigurationStoresPurgeDeletedOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = 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 = new LroImpl( + sendOperation, + { location, configStoreName, options }, + purgeDeletedOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Permanently deletes the specified configuration store. + * @param location The location in which uniqueness will be verified. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + async beginPurgeDeletedAndWait( + location: string, + configStoreName: string, + options?: ConfigurationStoresPurgeDeletedOptionalParams + ): Promise { + const poller = await this.beginPurgeDeleted( + location, + configStoreName, + options + ); + return poller.pollUntilDone(); + } + /** * ListNext * @param nextLink The nextLink from the previous successful call to the List method. @@ -619,6 +779,21 @@ export class ConfigurationStoresImpl implements ConfigurationStores { listKeysNextOperationSpec ); } + + /** + * ListDeletedNext + * @param nextLink The nextLink from the previous successful call to the ListDeleted method. + * @param options The options parameters. + */ + private _listDeletedNext( + nextLink: string, + options?: ConfigurationStoresListDeletedNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listDeletedNextOperationSpec + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -818,6 +993,68 @@ const regenerateKeyOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const listDeletedOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeletedConfigurationStoreListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const getDeletedOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeletedConfigurationStore + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.configStoreName, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; +const purgeDeletedOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.configStoreName, + Parameters.location + ], + headerParameters: [Parameters.accept], + serializer +}; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", @@ -881,3 +1118,23 @@ const listKeysNextOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listDeletedNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeletedConfigurationStoreListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts index a44919fd4300..4b8eb8f0efbe 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts @@ -20,6 +20,8 @@ import { OperationsCheckNameAvailabilityOptionalParams, OperationsCheckNameAvailabilityResponse, OperationsListResponse, + OperationsRegionalCheckNameAvailabilityOptionalParams, + OperationsRegionalCheckNameAvailabilityResponse, OperationsListNextResponse } from "../models"; @@ -104,6 +106,24 @@ export class OperationsImpl implements Operations { return this.client.sendOperationRequest({ options }, listOperationSpec); } + /** + * Checks whether the configuration store name is available for use. + * @param location The location in which uniqueness will be verified. + * @param checkNameAvailabilityParameters The object containing information for the availability + * request. + * @param options The options parameters. + */ + regionalCheckNameAvailability( + location: string, + checkNameAvailabilityParameters: CheckNameAvailabilityParameters, + options?: OperationsRegionalCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, checkNameAvailabilityParameters, options }, + regionalCheckNameAvailabilityOperationSpec + ); + } + /** * ListNext * @param nextLink The nextLink from the previous successful call to the List method. @@ -157,6 +177,29 @@ const listOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const regionalCheckNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.NameAvailabilityStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.checkNameAvailabilityParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/configurationStores.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/configurationStores.ts index cf46c2643e61..906c5f39ae21 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/configurationStores.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/configurationStores.ts @@ -14,6 +14,8 @@ import { ConfigurationStoresListByResourceGroupOptionalParams, ApiKey, ConfigurationStoresListKeysOptionalParams, + DeletedConfigurationStore, + ConfigurationStoresListDeletedOptionalParams, ConfigurationStoresGetOptionalParams, ConfigurationStoresGetResponse, ConfigurationStoresCreateOptionalParams, @@ -24,7 +26,10 @@ import { ConfigurationStoresUpdateResponse, RegenerateKeyParameters, ConfigurationStoresRegenerateKeyOptionalParams, - ConfigurationStoresRegenerateKeyResponse + ConfigurationStoresRegenerateKeyResponse, + ConfigurationStoresGetDeletedOptionalParams, + ConfigurationStoresGetDeletedResponse, + ConfigurationStoresPurgeDeletedOptionalParams } from "../models"; /// @@ -57,6 +62,13 @@ export interface ConfigurationStores { configStoreName: string, options?: ConfigurationStoresListKeysOptionalParams ): PagedAsyncIterableIterator; + /** + * Gets information about the deleted configuration stores in a subscription. + * @param options The options parameters. + */ + listDeleted( + options?: ConfigurationStoresListDeletedOptionalParams + ): PagedAsyncIterableIterator; /** * Gets the properties of the specified configuration store. * @param resourceGroupName The name of the resource group to which the container registry belongs. @@ -165,4 +177,37 @@ export interface ConfigurationStores { regenerateKeyParameters: RegenerateKeyParameters, options?: ConfigurationStoresRegenerateKeyOptionalParams ): Promise; + /** + * Gets a deleted Azure app configuration store. + * @param location The location in which uniqueness will be verified. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + getDeleted( + location: string, + configStoreName: string, + options?: ConfigurationStoresGetDeletedOptionalParams + ): Promise; + /** + * Permanently deletes the specified configuration store. + * @param location The location in which uniqueness will be verified. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + beginPurgeDeleted( + location: string, + configStoreName: string, + options?: ConfigurationStoresPurgeDeletedOptionalParams + ): Promise, void>>; + /** + * Permanently deletes the specified configuration store. + * @param location The location in which uniqueness will be verified. + * @param configStoreName The name of the configuration store. + * @param options The options parameters. + */ + beginPurgeDeletedAndWait( + location: string, + configStoreName: string, + options?: ConfigurationStoresPurgeDeletedOptionalParams + ): Promise; } diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/operations.ts b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/operations.ts index b40e214aff49..39f495c2bdd5 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/operations.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operationsInterfaces/operations.ts @@ -12,7 +12,9 @@ import { OperationsListOptionalParams, CheckNameAvailabilityParameters, OperationsCheckNameAvailabilityOptionalParams, - OperationsCheckNameAvailabilityResponse + OperationsCheckNameAvailabilityResponse, + OperationsRegionalCheckNameAvailabilityOptionalParams, + OperationsRegionalCheckNameAvailabilityResponse } from "../models"; /// @@ -35,4 +37,16 @@ export interface Operations { checkNameAvailabilityParameters: CheckNameAvailabilityParameters, options?: OperationsCheckNameAvailabilityOptionalParams ): Promise; + /** + * Checks whether the configuration store name is available for use. + * @param location The location in which uniqueness will be verified. + * @param checkNameAvailabilityParameters The object containing information for the availability + * request. + * @param options The options parameters. + */ + regionalCheckNameAvailability( + location: string, + checkNameAvailabilityParameters: CheckNameAvailabilityParameters, + options?: OperationsRegionalCheckNameAvailabilityOptionalParams + ): Promise; } diff --git a/sdk/appconfiguration/arm-appconfiguration/tsconfig.json b/sdk/appconfiguration/arm-appconfiguration/tsconfig.json index 6e3251194117..3e6ae96443f3 100644 --- a/sdk/appconfiguration/arm-appconfiguration/tsconfig.json +++ b/sdk/appconfiguration/arm-appconfiguration/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file