diff --git a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts index bc7c2ccf0f9c..558b47229c33 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClient.ts @@ -21,6 +21,7 @@ class AppConfigurationManagementClient extends AppConfigurationManagementClientC operations: operations.Operations; privateEndpointConnections: operations.PrivateEndpointConnections; privateLinkResources: operations.PrivateLinkResources; + keyValues: operations.KeyValues; /** * Initializes a new instance of the AppConfigurationManagementClient class. @@ -34,6 +35,7 @@ class AppConfigurationManagementClient extends AppConfigurationManagementClientC this.operations = new operations.Operations(this); this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); this.privateLinkResources = new operations.PrivateLinkResources(this); + this.keyValues = new operations.KeyValues(this); } } diff --git a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClientContext.ts b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClientContext.ts index bacdf7ad3cfa..7a1b36f8dc1e 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClientContext.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/appConfigurationManagementClientContext.ts @@ -37,14 +37,14 @@ export class AppConfigurationManagementClientContext extends msRestAzure.AzureSe if (!options) { options = {}; } - if (!options.userAgent) { + if(!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = '2020-06-01'; + this.apiVersion = '2020-07-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -52,10 +52,10 @@ export class AppConfigurationManagementClientContext extends msRestAzure.AzureSe this.credentials = credentials; this.subscriptionId = subscriptionId; - if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/configurationStoresMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/configurationStoresMappers.ts index d882c951bb98..ede67433e0f8 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/configurationStoresMappers.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/configurationStoresMappers.ts @@ -14,10 +14,10 @@ export { ConfigurationStoreListResult, ConfigurationStoreUpdateParameters, EncryptionProperties, - ErrorModel, + ErrorDetails, + ErrorResponse, KeyValue, KeyVaultProperties, - ListKeyValueParameters, PrivateEndpoint, PrivateEndpointConnection, PrivateEndpointConnectionReference, diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts index abd3af6a199f..940532ce82af 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/index.ts @@ -241,11 +241,6 @@ export interface ConfigurationStoreUpdateParameters { * The encryption settings of the configuration store. */ encryption?: EncryptionProperties; - /** - * Control permission for data plane traffic coming from public networks while private endpoint - * is enabled. Possible values include: 'Enabled', 'Disabled' - */ - publicNetworkAccess?: PublicNetworkAccess; /** * The managed identity information for the configuration store. */ @@ -339,23 +334,24 @@ export interface RegenerateKeyParameters { } /** - * The parameters used to list a configuration store key-value + * The key-value resource along with all resource properties. */ -export interface ListKeyValueParameters { +export interface KeyValue extends BaseResource { /** - * The key to retrieve. + * The resource ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - key: string; + readonly id?: string; /** - * The label of the key. + * The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - label?: string; -} - -/** - * The result of a request to retrieve a key-value from the specified configuration store. - */ -export interface KeyValue { + readonly name?: string; + /** + * The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; /** * The primary identifier of a key-value. * The key is used in unison with the label to uniquely identify a key-value. @@ -370,16 +366,14 @@ export interface KeyValue { readonly label?: string; /** * The value of the key-value. - * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly value?: string; + value?: string; /** * The content type of the key-value's value. * Providing a proper content-type can enable transformations of values when they are retrieved * by applications. - * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly contentType?: string; + contentType?: string; /** * An ETag indicating the state of a key-value within a configuration store. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -398,9 +392,8 @@ export interface KeyValue { readonly locked?: boolean; /** * A dictionary of tags that can help identify what a key-value may be applicable for. - * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly tags?: { [propertyName: string]: string }; + tags?: { [propertyName: string]: string }; } /** @@ -426,6 +419,100 @@ export interface OperationDefinitionDisplay { description?: string; } +/** + * Specifications of the Log for Azure Monitoring + */ +export interface LogSpecification { + /** + * Name of the log + */ + name?: string; + /** + * Localized friendly display name of the log + */ + displayName?: string; + /** + * Blob duration of the log + */ + blobDuration?: string; +} + +/** + * Specifications of the Dimension of metrics + */ +export interface MetricDimension { + /** + * Name of the dimension + */ + name?: string; + /** + * Localized friendly display name of the dimension + */ + displayName?: string; + /** + * Internal name of the dimension. + */ + internalName?: string; +} + +/** + * Specifications of the Metrics for Azure Monitoring + */ +export interface MetricSpecification { + /** + * Name of the metric + */ + name?: string; + /** + * Localized friendly display name of the metric + */ + displayName?: string; + /** + * Localized friendly description of the metric + */ + displayDescription?: string; + /** + * Unit that makes sense for the metric + */ + unit?: string; + /** + * Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + */ + aggregationType?: string; + /** + * Internal metric name. + */ + internalMetricName?: string; + /** + * Dimensions of the metric + */ + dimensions?: MetricDimension[]; +} + +/** + * Service specification payload + */ +export interface ServiceSpecification { + /** + * Specifications of the Log for Azure Monitoring + */ + logSpecifications?: LogSpecification[]; + /** + * Specifications of the Metrics for Azure Monitoring + */ + metricSpecifications?: MetricSpecification[]; +} + +/** + * Extra Operation properties + */ +export interface OperationProperties { + /** + * Service specifications of the operation + */ + serviceSpecification?: ServiceSpecification; +} + /** * The definition of a configuration store operation. */ @@ -434,24 +521,49 @@ export interface OperationDefinition { * Operation name: {provider}/{resource}/{operation}. */ name?: string; + /** + * Indicates whether the operation is a data action + */ + isDataAction?: boolean; /** * The display information for the configuration store operation. */ display?: OperationDefinitionDisplay; + /** + * Origin of the operation + */ + origin?: string; + /** + * Properties of the operation + */ + properties?: OperationProperties; } /** - * AppConfiguration error object. + * The details of the error. */ -export interface ErrorModel { +export interface ErrorDetails { /** * Error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - code?: string; + readonly code?: string; + /** + * Error message indicating why the operation failed. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; +} + +/** + * Error response indicates that the service is not able to process the incoming request. The + * reason is provided in the error message. + */ +export interface ErrorResponse { /** - * Error message. + * The details of the error. */ - message?: string; + error?: ErrorDetails; } /** @@ -574,6 +686,28 @@ export interface OperationsListOptionalParams extends msRest.RequestOptionsBase skipToken?: string; } +/** + * Optional Parameters. + */ +export interface KeyValuesListByConfigurationStoreOptionalParams extends msRest.RequestOptionsBase { + /** + * A skip token is used to continue retrieving items after an operation returns a partial result. + * If a previous response contains a nextLink element, the value of the nextLink element will + * include a skipToken parameter that specifies a starting point to use for subsequent calls. + */ + skipToken?: string; +} + +/** + * Optional Parameters. + */ +export interface KeyValuesCreateOrUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * The parameters for creating a key-value. + */ + keyValueParameters?: KeyValue; +} + /** * An interface representing AppConfigurationManagementClientOptions. */ @@ -641,6 +775,18 @@ export interface PrivateLinkResourceListResult extends Array + */ +export interface KeyValueListResult extends Array { + /** + * The URI that can be used to request the next set of paged results. + */ + nextLink?: string; +} + /** * Defines values for IdentityType. * Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned, @@ -822,26 +968,6 @@ export type ConfigurationStoresRegenerateKeyResponse = ApiKey & { }; }; -/** - * Contains response data for the listKeyValue operation. - */ -export type ConfigurationStoresListKeyValueResponse = KeyValue & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: KeyValue; - }; -}; - /** * Contains response data for the beginCreate operation. */ @@ -1161,3 +1287,83 @@ export type PrivateLinkResourcesListByConfigurationStoreNextResponse = PrivateLi parsedBody: PrivateLinkResourceListResult; }; }; + +/** + * Contains response data for the listByConfigurationStore operation. + */ +export type KeyValuesListByConfigurationStoreResponse = KeyValueListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: KeyValueListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type KeyValuesGetResponse = KeyValue & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: KeyValue; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type KeyValuesCreateOrUpdateResponse = KeyValue & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: KeyValue; + }; +}; + +/** + * Contains response data for the listByConfigurationStoreNext operation. + */ +export type KeyValuesListByConfigurationStoreNextResponse = KeyValueListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: KeyValueListResult; + }; +}; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/keyValuesMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/keyValuesMappers.ts new file mode 100644 index 000000000000..988f62f6b9bb --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/keyValuesMappers.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + ConfigurationStore, + EncryptionProperties, + ErrorDetails, + ErrorResponse, + KeyValue, + KeyValueListResult, + KeyVaultProperties, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionReference, + PrivateLinkServiceConnectionState, + Resource, + ResourceIdentity, + Sku, + UserIdentity +} from "../models/mappers"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts index 0cfebe6dbc46..4b125989ecb7 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/mappers.ts @@ -367,12 +367,6 @@ export const ConfigurationStoreUpdateParameters: msRest.CompositeMapper = { className: "EncryptionProperties" } }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String" - } - }, identity: { serializedName: "identity", type: { @@ -527,87 +521,82 @@ export const RegenerateKeyParameters: msRest.CompositeMapper = { } }; -export const ListKeyValueParameters: msRest.CompositeMapper = { - serializedName: "ListKeyValueParameters", +export const KeyValue: msRest.CompositeMapper = { + serializedName: "KeyValue", type: { name: "Composite", - className: "ListKeyValueParameters", + className: "KeyValue", modelProperties: { - key: { - required: true, - serializedName: "key", + id: { + readOnly: true, + serializedName: "id", type: { name: "String" } }, - label: { - serializedName: "label", + name: { + readOnly: true, + serializedName: "name", type: { name: "String" } - } - } - } -}; - -export const KeyValue: msRest.CompositeMapper = { - serializedName: "KeyValue", - type: { - name: "Composite", - className: "KeyValue", - modelProperties: { + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, key: { readOnly: true, - serializedName: "key", + serializedName: "properties.key", type: { name: "String" } }, label: { readOnly: true, - serializedName: "label", + serializedName: "properties.label", type: { name: "String" } }, value: { - readOnly: true, - serializedName: "value", + serializedName: "properties.value", type: { name: "String" } }, contentType: { - readOnly: true, - serializedName: "contentType", + serializedName: "properties.contentType", type: { name: "String" } }, eTag: { readOnly: true, - serializedName: "eTag", + serializedName: "properties.eTag", type: { name: "String" } }, lastModified: { readOnly: true, - serializedName: "lastModified", + serializedName: "properties.lastModified", type: { name: "DateTime" } }, locked: { readOnly: true, - serializedName: "locked", + serializedName: "properties.locked", type: { name: "Boolean" } }, tags: { - readOnly: true, - serializedName: "tags", + serializedName: "properties.tags", type: { name: "Dictionary", value: { @@ -656,6 +645,171 @@ export const OperationDefinitionDisplay: msRest.CompositeMapper = { } }; +export const LogSpecification: msRest.CompositeMapper = { + serializedName: "LogSpecification", + type: { + name: "Composite", + className: "LogSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + blobDuration: { + serializedName: "blobDuration", + type: { + name: "String" + } + } + } + } +}; + +export const MetricDimension: msRest.CompositeMapper = { + serializedName: "MetricDimension", + type: { + name: "Composite", + className: "MetricDimension", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + internalName: { + serializedName: "internalName", + type: { + name: "String" + } + } + } + } +}; + +export const MetricSpecification: msRest.CompositeMapper = { + serializedName: "MetricSpecification", + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + internalMetricName: { + serializedName: "internalMetricName", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricDimension" + } + } + } + } + } + } +}; + +export const ServiceSpecification: msRest.CompositeMapper = { + serializedName: "ServiceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + logSpecifications: { + serializedName: "logSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LogSpecification" + } + } + } + }, + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } + } + } + } + } +}; + +export const OperationProperties: msRest.CompositeMapper = { + serializedName: "OperationProperties", + type: { + name: "Composite", + className: "OperationProperties", + modelProperties: { + serviceSpecification: { + serializedName: "serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification" + } + } + } + } +}; + export const OperationDefinition: msRest.CompositeMapper = { serializedName: "OperationDefinition", type: { @@ -668,30 +822,51 @@ export const OperationDefinition: msRest.CompositeMapper = { name: "String" } }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, display: { serializedName: "display", type: { name: "Composite", className: "OperationDefinitionDisplay" } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties" + } } } } }; -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", +export const ErrorDetails: msRest.CompositeMapper = { + serializedName: "ErrorDetails", type: { name: "Composite", - className: "ErrorModel", + className: "ErrorDetails", modelProperties: { code: { + readOnly: true, serializedName: "code", type: { name: "String" } }, message: { + readOnly: true, serializedName: "message", type: { name: "String" @@ -701,6 +876,23 @@ export const ErrorModel: msRest.CompositeMapper = { } }; +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetails" + } + } + } + } +}; + export const PrivateEndpointConnection: msRest.CompositeMapper = { serializedName: "PrivateEndpointConnection", type: { @@ -955,3 +1147,31 @@ export const PrivateLinkResourceListResult: msRest.CompositeMapper = { } } }; + +export const KeyValueListResult: msRest.CompositeMapper = { + serializedName: "KeyValueListResult", + type: { + name: "Composite", + className: "KeyValueListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyValue" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/operationsMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/operationsMappers.ts index 0c4c87228850..5d9a167a6e68 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/operationsMappers.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/operationsMappers.ts @@ -8,9 +8,15 @@ export { CheckNameAvailabilityParameters, - ErrorModel, + ErrorDetails, + ErrorResponse, + LogSpecification, + MetricDimension, + MetricSpecification, NameAvailabilityStatus, OperationDefinition, OperationDefinitionDisplay, - OperationDefinitionListResult + OperationDefinitionListResult, + OperationProperties, + ServiceSpecification } from "../models/mappers"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts index d098b569c352..73f112225e36 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/parameters.ts @@ -55,6 +55,16 @@ export const groupName: msRest.OperationURLParameter = { } } }; +export const keyValueName: msRest.OperationURLParameter = { + parameterPath: "keyValueName", + mapper: { + required: true, + serializedName: "keyValueName", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/privateEndpointConnectionsMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/privateEndpointConnectionsMappers.ts index 1f38807af79d..599a41cfc07e 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/privateEndpointConnectionsMappers.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/privateEndpointConnectionsMappers.ts @@ -10,7 +10,9 @@ export { BaseResource, ConfigurationStore, EncryptionProperties, - ErrorModel, + ErrorDetails, + ErrorResponse, + KeyValue, KeyVaultProperties, PrivateEndpoint, PrivateEndpointConnection, diff --git a/sdk/appconfiguration/arm-appconfiguration/src/models/privateLinkResourcesMappers.ts b/sdk/appconfiguration/arm-appconfiguration/src/models/privateLinkResourcesMappers.ts index 618676a35470..a4a163235b59 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/models/privateLinkResourcesMappers.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/models/privateLinkResourcesMappers.ts @@ -7,7 +7,8 @@ */ export { - ErrorModel, + ErrorDetails, + ErrorResponse, PrivateLinkResource, PrivateLinkResourceListResult } from "../models/mappers"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts index 668188671197..120b16077c0b 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/configurationStores.ts @@ -217,42 +217,6 @@ export class ConfigurationStores { callback) as Promise; } - /** - * Lists a configuration store key-value. - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param listKeyValueParameters The parameters for retrieving a key-value. - * @param [options] The optional parameters - * @returns Promise - */ - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param listKeyValueParameters The parameters for retrieving a key-value. - * @param callback The callback - */ - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param listKeyValueParameters The parameters for retrieving a key-value. - * @param options The optional parameters - * @param callback The callback - */ - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeyValue(resourceGroupName: string, configStoreName: string, listKeyValueParameters: Models.ListKeyValueParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - configStoreName, - listKeyValueParameters, - options - }, - listKeyValueOperationSpec, - callback) as Promise; - } - /** * Creates a configuration store with the specified parameters. * @param resourceGroupName The name of the resource group to which the container registry belongs. @@ -416,7 +380,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -441,7 +405,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -466,7 +430,7 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationStore }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -474,7 +438,7 @@ const getOperationSpec: msRest.OperationSpec = { const listKeysOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/ListKeys", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, @@ -492,7 +456,7 @@ const listKeysOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ApiKeyListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -500,7 +464,7 @@ const listKeysOperationSpec: msRest.OperationSpec = { const regenerateKeyOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, @@ -524,39 +488,7 @@ const regenerateKeyOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ApiKey }, default: { - bodyMapper: Mappers.ErrorModel - } - }, - serializer -}; - -const listKeyValueOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.configStoreName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "listKeyValueParameters", - mapper: { - ...Mappers.ListKeyValueParameters, - required: true - } - }, - responses: { - 200: { - bodyMapper: Mappers.KeyValue - }, - default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -591,7 +523,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationStore }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -616,7 +548,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -651,7 +583,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationStore }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -672,7 +604,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -693,7 +625,7 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ConfigurationStoreListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -714,7 +646,7 @@ const listKeysNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ApiKeyListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts index f578b9c95302..9ab7fae36a35 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/index.ts @@ -12,3 +12,4 @@ export * from "./configurationStores"; export * from "./operations"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./keyValues"; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/keyValues.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/keyValues.ts new file mode 100644 index 000000000000..7b5eedab8bc0 --- /dev/null +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/keyValues.ts @@ -0,0 +1,336 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/keyValuesMappers"; +import * as Parameters from "../models/parameters"; +import { AppConfigurationManagementClientContext } from "../appConfigurationManagementClientContext"; + +/** Class representing a KeyValues. */ +export class KeyValues { + private readonly client: AppConfigurationManagementClientContext; + + /** + * Create a KeyValues. + * @param {AppConfigurationManagementClientContext} client Reference to the service client. + */ + constructor(client: AppConfigurationManagementClientContext) { + this.client = client; + } + + /** + * Lists the key-values for a given configuration store. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param [options] The optional parameters + * @returns Promise + */ + listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: Models.KeyValuesListByConfigurationStoreOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param callback The callback + */ + listByConfigurationStore(resourceGroupName: string, configStoreName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param options The optional parameters + * @param callback The callback + */ + listByConfigurationStore(resourceGroupName: string, configStoreName: string, options: Models.KeyValuesListByConfigurationStoreOptionalParams, callback: msRest.ServiceCallback): void; + listByConfigurationStore(resourceGroupName: string, configStoreName: string, options?: Models.KeyValuesListByConfigurationStoreOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + configStoreName, + options + }, + listByConfigurationStoreOperationSpec, + callback) as Promise; + } + + /** + * Gets the properties of the specified key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param callback The callback + */ + get(resourceGroupName: string, configStoreName: string, keyValueName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, configStoreName: string, keyValueName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + configStoreName, + keyValueName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: Models.KeyValuesCreateOrUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, configStoreName: string, keyValueName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, configStoreName: string, keyValueName: string, options: Models.KeyValuesCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: Models.KeyValuesCreateOrUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + configStoreName, + keyValueName, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,configStoreName,keyValueName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Deletes a key-value. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param keyValueName Identifier of key and label combination. Key and label are joined by $ + * character. Label is optional. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, configStoreName: string, keyValueName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + configStoreName, + keyValueName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists the key-values for a given configuration store. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByConfigurationStoreNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByConfigurationStoreNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByConfigurationStoreNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByConfigurationStoreNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByConfigurationStoreNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByConfigurationStoreOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.skipToken + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.KeyValueListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.keyValueName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.KeyValue + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.keyValueName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "keyValueParameters" + ], + mapper: Mappers.KeyValue + }, + responses: { + 200: { + bodyMapper: Mappers.KeyValue + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.configStoreName, + Parameters.keyValueName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByConfigurationStoreNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.KeyValueListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts index 725134a5871b..d040705854fb 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/operations.ts @@ -136,7 +136,7 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.NameAvailabilityStatus }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -157,7 +157,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationDefinitionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -178,7 +178,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationDefinitionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts index 1e14a2cb5512..a94b91e0184d 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateEndpointConnections.ts @@ -216,7 +216,7 @@ const listByConfigurationStoreOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateEndpointConnectionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -242,7 +242,7 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateEndpointConnection }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -278,7 +278,7 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateEndpointConnection }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -304,7 +304,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -325,7 +325,7 @@ const listByConfigurationStoreNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateEndpointConnectionListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer diff --git a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts index 190cce104e87..c930044cb839 100644 --- a/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts +++ b/sdk/appconfiguration/arm-appconfiguration/src/operations/privateLinkResources.ts @@ -144,7 +144,7 @@ const listByConfigurationStoreOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateLinkResourceListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -170,7 +170,7 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateLinkResource }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer @@ -191,7 +191,7 @@ const listByConfigurationStoreNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateLinkResourceListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, serializer