From ed0fee222797ae3aa0ca207a7eb025ca9470584f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 23 Nov 2021 08:48:52 +0000 Subject: [PATCH] CodeGen from PR 16847 in Azure/azure-rest-api-specs Merge 00eb338b0fb5d1e0e07a3e1fff50f1f7137a36d8 into 47b551f58ee1b24f4783c2e927b1673b39d87348 --- .../AppConfigurationManagementClient.cs | 3 + .../ConfigurationStoresOperations.cs | 42 +- .../ConfigurationStoresRestOperations.cs | 104 +--- .../src/Generated/KeyValuesDeleteOperation.cs | 68 +++ .../src/Generated/KeyValuesOperations.cs | 295 ++++++++++ .../src/Generated/KeyValuesRestOperations.cs | 520 ++++++++++++++++++ .../ConfigurationStore.Serialization.cs | 71 ++- .../Generated/Models/ConfigurationStore.cs | 22 +- ...tionStoreUpdateParameters.Serialization.cs | 5 + .../ConfigurationStoreUpdateParameters.cs | 2 + .../src/Generated/Models/CreatedByType.cs | 57 ++ .../Generated/Models/Error.Serialization.cs | 35 -- .../src/Generated/Models/Error.cs | 32 -- .../ErrorAdditionalInfo.Serialization.cs | 40 ++ .../Generated/Models/ErrorAdditionalInfo.cs | 32 ++ .../Models/ErrorDetails.Serialization.cs | 52 ++ .../src/Generated/Models/ErrorDetails.cs | 40 ++ .../Models/ErrorResponse.Serialization.cs | 34 ++ .../src/Generated/Models/ErrorResponse.cs | 28 + .../Models/KeyValue.Serialization.cs | 146 +++-- .../src/Generated/Models/KeyValue.cs | 24 +- .../KeyValueListResult.Serialization.cs | 46 ++ .../Generated/Models/KeyValueListResult.cs | 36 ++ .../ListKeyValueParameters.Serialization.cs | 28 - .../Models/ListKeyValueParameters.cs | 33 -- .../Models/LogSpecification.Serialization.cs | 41 ++ .../src/Generated/Models/LogSpecification.cs | 36 ++ .../Models/MetricDimension.Serialization.cs | 41 ++ .../src/Generated/Models/MetricDimension.cs | 36 ++ .../MetricSpecification.Serialization.cs | 87 +++ .../Generated/Models/MetricSpecification.cs | 60 ++ .../OperationDefinition.Serialization.cs | 30 +- .../Generated/Models/OperationDefinition.cs | 14 +- .../OperationProperties.Serialization.cs | 34 ++ .../Generated/Models/OperationProperties.cs | 28 + .../Models/Resource.Serialization.cs | 38 +- .../src/Generated/Models/Resource.cs | 35 +- .../ServiceSpecification.Serialization.cs | 56 ++ .../Generated/Models/ServiceSpecification.cs | 37 ++ .../Models/SystemData.Serialization.cs | 80 +++ .../src/Generated/Models/SystemData.cs | 50 ++ .../Models/TrackedResource.Serialization.cs | 83 +++ .../src/Generated/Models/TrackedResource.cs | 48 ++ .../src/Generated/Operations.cs | 2 +- .../PrivateEndpointConnectionsOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../src/Generated/RestOperations.cs | 2 +- .../src/autorest.md | 4 +- 50 files changed, 2222 insertions(+), 423 deletions(-) create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesDeleteOperation.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesOperations.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesRestOperations.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/CreatedByType.cs delete mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.Serialization.cs delete mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.cs delete mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.Serialization.cs delete mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.Serialization.cs create mode 100644 sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.cs diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationManagementClient.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationManagementClient.cs index 7da5926ead41..9b9b2e8b6367 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationManagementClient.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/AppConfigurationManagementClient.cs @@ -64,5 +64,8 @@ public AppConfigurationManagementClient(string subscriptionId, Uri endpoint, Tok /// Returns an instance of PrivateLinkResourcesOperations. public virtual PrivateLinkResourcesOperations PrivateLinkResources => new PrivateLinkResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); + + /// Returns an instance of KeyValuesOperations. + public virtual KeyValuesOperations KeyValues => new KeyValuesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint); } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresOperations.cs index 8fd966e45d9a..8ba6a909438f 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresOperations.cs @@ -33,7 +33,7 @@ protected ConfigurationStoresOperations() /// The Microsoft Azure subscription ID. /// server parameter. /// Api Version. - internal ConfigurationStoresOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + internal ConfigurationStoresOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { RestClient = new ConfigurationStoresRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; @@ -118,46 +118,6 @@ public virtual Response RegenerateKey(string resourceGroupName, string c } } - /// Lists a configuration store key-value. - /// The name of the resource group to which the container registry belongs. - /// The name of the configuration store. - /// The parameters for retrieving a key-value. - /// The cancellation token to use. - public virtual async Task> ListKeyValueAsync(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) - { - using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeyValue"); - scope.Start(); - try - { - return await RestClient.ListKeyValueAsync(resourceGroupName, configStoreName, listKeyValueParameters, cancellationToken).ConfigureAwait(false); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// Lists a configuration store key-value. - /// The name of the resource group to which the container registry belongs. - /// The name of the configuration store. - /// The parameters for retrieving a key-value. - /// The cancellation token to use. - public virtual Response ListKeyValue(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) - { - using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeyValue"); - scope.Start(); - try - { - return RestClient.ListKeyValue(resourceGroupName, configStoreName, listKeyValueParameters, cancellationToken); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// Lists the configuration stores for a given subscription. /// 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. /// The cancellation token to use. diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresRestOperations.cs index 3ed0df0746b6..510543d4b6b2 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/ConfigurationStoresRestOperations.cs @@ -31,7 +31,7 @@ internal partial class ConfigurationStoresRestOperations /// server parameter. /// Api Version. /// or is null. - public ConfigurationStoresRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + public ConfigurationStoresRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { if (subscriptionId == null) { @@ -541,7 +541,7 @@ internal HttpMessage CreateListKeysRequest(string resourceGroupName, string conf uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); uri.AppendPath(configStoreName, true); - uri.AppendPath("/ListKeys", false); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", apiVersion, true); if (skipToken != null) { @@ -631,7 +631,7 @@ internal HttpMessage CreateRegenerateKeyRequest(string resourceGroupName, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); uri.AppendPath(configStoreName, true); - uri.AppendPath("/RegenerateKey", false); + uri.AppendPath("/regenerateKey", false); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -716,104 +716,6 @@ public Response RegenerateKey(string resourceGroupName, string configSto } } - internal HttpMessage CreateListKeyValueRequest(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); - uri.AppendPath(configStoreName, true); - uri.AppendPath("/listKeyValue", false); - uri.AppendQuery("api-version", apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(listKeyValueParameters); - request.Content = content; - return message; - } - - /// Lists a configuration store key-value. - /// The name of the resource group to which the container registry belongs. - /// The name of the configuration store. - /// The parameters for retrieving a key-value. - /// The cancellation token to use. - /// , , or is null. - public async Task> ListKeyValueAsync(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (configStoreName == null) - { - throw new ArgumentNullException(nameof(configStoreName)); - } - if (listKeyValueParameters == null) - { - throw new ArgumentNullException(nameof(listKeyValueParameters)); - } - - using var message = CreateListKeyValueRequest(resourceGroupName, configStoreName, listKeyValueParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - KeyValue value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = KeyValue.DeserializeKeyValue(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Lists a configuration store key-value. - /// The name of the resource group to which the container registry belongs. - /// The name of the configuration store. - /// The parameters for retrieving a key-value. - /// The cancellation token to use. - /// , , or is null. - public Response ListKeyValue(string resourceGroupName, string configStoreName, ListKeyValueParameters listKeyValueParameters, CancellationToken cancellationToken = default) - { - if (resourceGroupName == null) - { - throw new ArgumentNullException(nameof(resourceGroupName)); - } - if (configStoreName == null) - { - throw new ArgumentNullException(nameof(configStoreName)); - } - if (listKeyValueParameters == null) - { - throw new ArgumentNullException(nameof(listKeyValueParameters)); - } - - using var message = CreateListKeyValueRequest(resourceGroupName, configStoreName, listKeyValueParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - KeyValue value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = KeyValue.DeserializeKeyValue(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - internal HttpMessage CreateListNextPageRequest(string nextLink, string skipToken) { var message = _pipeline.CreateMessage(); diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesDeleteOperation.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesDeleteOperation.cs new file mode 100644 index 000000000000..68acbc0df4d7 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesDeleteOperation.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppConfiguration +{ + /// Deletes a key-value. + public partial class KeyValuesDeleteOperation : Operation, IOperationSource + { + private readonly ArmOperationHelpers _operation; + + /// Initializes a new instance of KeyValuesDeleteOperation for mocking. + protected KeyValuesDeleteOperation() + { + } + + internal KeyValuesDeleteOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) + { + _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "KeyValuesDeleteOperation"); + } + /// + public override string Id => _operation.Id; + + /// + public override Response Value => _operation.Value; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override Response GetRawResponse() => _operation.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + + Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + return response; + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + return await new ValueTask(response).ConfigureAwait(false); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesOperations.cs new file mode 100644 index 000000000000..b8a193a3c5b6 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesOperations.cs @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppConfiguration.Models; + +namespace Azure.ResourceManager.AppConfiguration +{ + /// The KeyValues service client. + public partial class KeyValuesOperations + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal KeyValuesRestOperations RestClient { get; } + + /// Initializes a new instance of KeyValuesOperations for mocking. + protected KeyValuesOperations() + { + } + + /// Initializes a new instance of KeyValuesOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + internal KeyValuesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") + { + RestClient = new KeyValuesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Gets the properties of the specified key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + public virtual async Task> GetAsync(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.Get"); + scope.Start(); + try + { + return await RestClient.GetAsync(resourceGroupName, configStoreName, keyValueName, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the properties of the specified key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + public virtual Response Get(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.Get"); + scope.Start(); + try + { + return RestClient.Get(resourceGroupName, configStoreName, keyValueName, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The parameters for creating a key-value. + /// The cancellation token to use. + public virtual async Task> CreateOrUpdateAsync(string resourceGroupName, string configStoreName, string keyValueName, KeyValue keyValueParameters = null, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.CreateOrUpdate"); + scope.Start(); + try + { + return await RestClient.CreateOrUpdateAsync(resourceGroupName, configStoreName, keyValueName, keyValueParameters, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Creates a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The parameters for creating a key-value. + /// The cancellation token to use. + public virtual Response CreateOrUpdate(string resourceGroupName, string configStoreName, string keyValueName, KeyValue keyValueParameters = null, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.CreateOrUpdate"); + scope.Start(); + try + { + return RestClient.CreateOrUpdate(resourceGroupName, configStoreName, keyValueName, keyValueParameters, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Lists the key-values for a given configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// 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. + /// The cancellation token to use. + /// or is null. + public virtual AsyncPageable ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.ListByConfigurationStore"); + scope.Start(); + try + { + var response = await RestClient.ListByConfigurationStoreAsync(resourceGroupName, configStoreName, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.ListByConfigurationStore"); + scope.Start(); + try + { + var response = await RestClient.ListByConfigurationStoreNextPageAsync(nextLink, resourceGroupName, configStoreName, skipToken, cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Lists the key-values for a given configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// 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. + /// The cancellation token to use. + /// or is null. + public virtual Pageable ListByConfigurationStore(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.ListByConfigurationStore"); + scope.Start(); + try + { + var response = RestClient.ListByConfigurationStore(resourceGroupName, configStoreName, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.ListByConfigurationStore"); + scope.Start(); + try + { + var response = RestClient.ListByConfigurationStoreNextPage(nextLink, resourceGroupName, configStoreName, skipToken, cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Deletes a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + /// , , or is null. + public virtual async Task StartDeleteAsync(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.StartDelete"); + scope.Start(); + try + { + var originalResponse = await RestClient.DeleteAsync(resourceGroupName, configStoreName, keyValueName, cancellationToken).ConfigureAwait(false); + return new KeyValuesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, configStoreName, keyValueName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deletes a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + /// , , or is null. + public virtual KeyValuesDeleteOperation StartDelete(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var scope = _clientDiagnostics.CreateScope("KeyValuesOperations.StartDelete"); + scope.Start(); + try + { + var originalResponse = RestClient.Delete(resourceGroupName, configStoreName, keyValueName, cancellationToken); + return new KeyValuesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, configStoreName, keyValueName).Request, originalResponse); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesRestOperations.cs new file mode 100644 index 000000000000..241c2b98f341 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/KeyValuesRestOperations.cs @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppConfiguration.Models; + +namespace Azure.ResourceManager.AppConfiguration +{ + internal partial class KeyValuesRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of KeyValuesRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The Microsoft Azure subscription ID. + /// server parameter. + /// Api Version. + /// or is null. + public KeyValuesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateListByConfigurationStoreRequest(string resourceGroupName, string configStoreName, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/keyValues", false); + uri.AppendQuery("api-version", apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists the key-values for a given configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// 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. + /// The cancellation token to use. + /// or is null. + public async Task> ListByConfigurationStoreAsync(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + KeyValueListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyValueListResult.DeserializeKeyValueListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the key-values for a given configuration store. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// 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. + /// The cancellation token to use. + /// or is null. + public Response ListByConfigurationStore(string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + KeyValueListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyValueListResult.DeserializeKeyValueListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string configStoreName, string keyValueName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/keyValues/", false); + uri.AppendPath(keyValueName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets the properties of the specified key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAsync(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName, keyValueName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + KeyValue value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyValue.DeserializeKeyValue(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets the properties of the specified key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + /// , , or is null. + public Response Get(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var message = CreateGetRequest(resourceGroupName, configStoreName, keyValueName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + KeyValue value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyValue.DeserializeKeyValue(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string configStoreName, string keyValueName, KeyValue keyValueParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/keyValues/", false); + uri.AppendPath(keyValueName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (keyValueParameters != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(keyValueParameters); + request.Content = content; + } + return message; + } + + /// Creates a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The parameters for creating a key-value. + /// The cancellation token to use. + /// , , or is null. + public async Task> CreateOrUpdateAsync(string resourceGroupName, string configStoreName, string keyValueName, KeyValue keyValueParameters = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, keyValueName, keyValueParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + KeyValue value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyValue.DeserializeKeyValue(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Creates a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The parameters for creating a key-value. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string configStoreName, string keyValueName, KeyValue keyValueParameters = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, keyValueName, keyValueParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + KeyValue value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyValue.DeserializeKeyValue(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string configStoreName, string keyValueName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); + uri.AppendPath(configStoreName, true); + uri.AppendPath("/keyValues/", false); + uri.AppendPath(keyValueName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Deletes a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteAsync(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, configStoreName, keyValueName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Deletes a key-value. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// Identifier of key and label combination. Key and label are joined by $ character. Label is optional. + /// The cancellation token to use. + /// , , or is null. + public Response Delete(string resourceGroupName, string configStoreName, string keyValueName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + if (keyValueName == null) + { + throw new ArgumentNullException(nameof(keyValueName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, configStoreName, keyValueName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByConfigurationStoreNextPageRequest(string nextLink, string resourceGroupName, string configStoreName, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists the key-values for a given configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// 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. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListByConfigurationStoreNextPageAsync(string nextLink, string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreName, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + KeyValueListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = KeyValueListResult.DeserializeKeyValueListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists the key-values for a given configuration store. + /// The URL to the next page of results. + /// The name of the resource group to which the container registry belongs. + /// The name of the configuration store. + /// 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. + /// The cancellation token to use. + /// , , or is null. + public Response ListByConfigurationStoreNextPage(string nextLink, string resourceGroupName, string configStoreName, string skipToken = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (configStoreName == null) + { + throw new ArgumentNullException(nameof(configStoreName)); + } + + using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreName, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + KeyValueListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = KeyValueListResult.DeserializeKeyValueListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.Serialization.cs index cbbb62d29711..fb1174d6aeda 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.Serialization.cs @@ -24,8 +24,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("sku"); writer.WriteObjectValue(Sku); - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"); @@ -37,6 +35,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndObject(); } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); writer.WritePropertyName("properties"); writer.WriteStartObject(); if (Optional.IsDefined(Encryption)) @@ -49,6 +49,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("publicNetworkAccess"); writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); } + if (Optional.IsDefined(DisableLocalAuth)) + { + writer.WritePropertyName("disableLocalAuth"); + writer.WriteBooleanValue(DisableLocalAuth.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -57,17 +62,19 @@ internal static ConfigurationStore DeserializeConfigurationStore(JsonElement ele { Optional identity = default; Sku sku = default; + Optional systemData = default; + Optional> tags = default; + string location = default; Optional id = default; Optional name = default; Optional type = default; - string location = default; - Optional> tags = default; Optional provisioningState = default; Optional creationDate = default; Optional endpoint = default; Optional encryption = default; Optional> privateEndpointConnections = default; Optional publicNetworkAccess = default; + Optional disableLocalAuth = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("identity")) @@ -85,24 +92,14 @@ internal static ConfigurationStore DeserializeConfigurationStore(JsonElement ele sku = Sku.DeserializeSku(property.Value); continue; } - if (property.NameEquals("id")) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) + if (property.NameEquals("systemData")) { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = SystemData.DeserializeSystemData(property.Value); continue; } if (property.NameEquals("tags")) @@ -120,6 +117,26 @@ internal static ConfigurationStore DeserializeConfigurationStore(JsonElement ele tags = dictionary; continue; } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -189,11 +206,21 @@ internal static ConfigurationStore DeserializeConfigurationStore(JsonElement ele publicNetworkAccess = new PublicNetworkAccess(property0.Value.GetString()); continue; } + if (property0.NameEquals("disableLocalAuth")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + disableLocalAuth = property0.Value.GetBoolean(); + continue; + } } continue; } } - return new ConfigurationStore(id.Value, name.Value, type.Value, location, Optional.ToDictionary(tags), identity.Value, sku, Optional.ToNullable(provisioningState), Optional.ToNullable(creationDate), endpoint.Value, encryption.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(publicNetworkAccess)); + return new ConfigurationStore(id.Value, name.Value, type.Value, Optional.ToDictionary(tags), location, identity.Value, sku, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(creationDate), endpoint.Value, encryption.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(disableLocalAuth)); } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.cs index 761d5bf862d3..c35c75edfb32 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStore.cs @@ -12,10 +12,10 @@ namespace Azure.ResourceManager.AppConfiguration.Models { /// The configuration store along with all resource properties. The Configuration Store will have all information to begin utilizing it. - public partial class ConfigurationStore : Resource + public partial class ConfigurationStore : TrackedResource { /// Initializes a new instance of ConfigurationStore. - /// The location of the resource. This cannot be changed after the resource is created. + /// The geo-location where the resource lives. /// The sku of the configuration store. /// or is null. public ConfigurationStore(string location, Sku sku) : base(location) @@ -34,35 +34,41 @@ public ConfigurationStore(string location, Sku sku) : base(location) } /// Initializes a new instance of ConfigurationStore. - /// The resource ID. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. /// The name of the resource. - /// The type of the resource. - /// The location of the resource. This cannot be changed after the resource is created. - /// The tags of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Resource tags. + /// The geo-location where the resource lives. /// The managed identity information, if configured. /// The sku of the configuration store. + /// Resource system metadata. /// The provisioning state of the configuration store. /// The creation date of configuration store. /// The DNS endpoint where the configuration store API will be available. /// The encryption settings of the configuration store. /// The list of private endpoint connections that are set up for this resource. /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. - internal ConfigurationStore(string id, string name, string type, string location, IDictionary tags, ResourceIdentity identity, Sku sku, ProvisioningState? provisioningState, DateTimeOffset? creationDate, string endpoint, EncryptionProperties encryption, IReadOnlyList privateEndpointConnections, PublicNetworkAccess? publicNetworkAccess) : base(id, name, type, location, tags) + /// Disables all authentication methods other than AAD authentication. + internal ConfigurationStore(string id, string name, string type, IDictionary tags, string location, ResourceIdentity identity, Sku sku, SystemData systemData, ProvisioningState? provisioningState, DateTimeOffset? creationDate, string endpoint, EncryptionProperties encryption, IReadOnlyList privateEndpointConnections, PublicNetworkAccess? publicNetworkAccess, bool? disableLocalAuth) : base(id, name, type, tags, location) { Identity = identity; Sku = sku; + SystemData = systemData; ProvisioningState = provisioningState; CreationDate = creationDate; Endpoint = endpoint; Encryption = encryption; PrivateEndpointConnections = privateEndpointConnections; PublicNetworkAccess = publicNetworkAccess; + DisableLocalAuth = disableLocalAuth; } /// The managed identity information, if configured. public ResourceIdentity Identity { get; set; } /// The sku of the configuration store. public Sku Sku { get; set; } + /// Resource system metadata. + public SystemData SystemData { get; } /// The provisioning state of the configuration store. public ProvisioningState? ProvisioningState { get; } /// The creation date of configuration store. @@ -75,5 +81,7 @@ internal ConfigurationStore(string id, string name, string type, string location public IReadOnlyList PrivateEndpointConnections { get; } /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. public PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Disables all authentication methods other than AAD authentication. + public bool? DisableLocalAuth { get; set; } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.Serialization.cs index b433e0ee8461..be8e5cae4a3b 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.Serialization.cs @@ -43,6 +43,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("encryption"); writer.WriteObjectValue(Encryption); } + if (Optional.IsDefined(DisableLocalAuth)) + { + writer.WritePropertyName("disableLocalAuth"); + writer.WriteBooleanValue(DisableLocalAuth.Value); + } if (Optional.IsDefined(PublicNetworkAccess)) { writer.WritePropertyName("publicNetworkAccess"); diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.cs index 65042166c62c..eb6f0c30b8f8 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ConfigurationStoreUpdateParameters.cs @@ -27,6 +27,8 @@ public ConfigurationStoreUpdateParameters() public IDictionary Tags { get; } /// The encryption settings of the configuration store. public EncryptionProperties Encryption { get; set; } + /// Disables all authentication methods other than AAD authentication. + public bool? DisableLocalAuth { get; set; } /// Control permission for data plane traffic coming from public networks while private endpoint is enabled. public PublicNetworkAccess? PublicNetworkAccess { get; set; } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/CreatedByType.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..73dac1a84d32 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The type of identity that created the resource. + public readonly partial struct CreatedByType : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public CreatedByType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserValue = "User"; + private const string ApplicationValue = "Application"; + private const string ManagedIdentityValue = "ManagedIdentity"; + private const string KeyValue = "Key"; + + /// User. + public static CreatedByType User { get; } = new CreatedByType(UserValue); + /// Application. + public static CreatedByType Application { get; } = new CreatedByType(ApplicationValue); + /// ManagedIdentity. + public static CreatedByType ManagedIdentity { get; } = new CreatedByType(ManagedIdentityValue); + /// Key. + public static CreatedByType Key { get; } = new CreatedByType(KeyValue); + /// Determines if two values are the same. + public static bool operator ==(CreatedByType left, CreatedByType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CreatedByType left, CreatedByType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CreatedByType(string value) => new CreatedByType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CreatedByType other && Equals(other); + /// + public bool Equals(CreatedByType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.Serialization.cs deleted file mode 100644 index e5eb04140449..000000000000 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.AppConfiguration.Models -{ - internal partial class Error - { - internal static Error DeserializeError(JsonElement element) - { - Optional code = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code")) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message")) - { - message = property.Value.GetString(); - continue; - } - } - return new Error(code.Value, message.Value); - } - } -} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.cs deleted file mode 100644 index 6bc7bf081d0d..000000000000 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Error.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.AppConfiguration.Models -{ - /// AppConfiguration error object. - internal partial class Error - { - /// Initializes a new instance of Error. - internal Error() - { - } - - /// Initializes a new instance of Error. - /// Error code. - /// Error message. - internal Error(string code, string message) - { - Code = code; - Message = message; - } - - /// Error code. - public string Code { get; } - /// Error message. - public string Message { get; } - } -} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs new file mode 100644 index 000000000000..e2390538a7d1 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + internal partial class ErrorAdditionalInfo + { + internal static ErrorAdditionalInfo DeserializeErrorAdditionalInfo(JsonElement element) + { + Optional type = default; + Optional info = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("info")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + info = property.Value.GetObject(); + continue; + } + } + return new ErrorAdditionalInfo(type.Value, info.Value); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..2d073ee55d75 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The resource management error additional info. + internal partial class ErrorAdditionalInfo + { + /// Initializes a new instance of ErrorAdditionalInfo. + internal ErrorAdditionalInfo() + { + } + + /// Initializes a new instance of ErrorAdditionalInfo. + /// The additional info type. + /// The additional info. + internal ErrorAdditionalInfo(string type, object info) + { + Type = type; + Info = info; + } + + /// The additional info type. + public string Type { get; } + /// The additional info. + public object Info { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.Serialization.cs new file mode 100644 index 000000000000..7270095a7466 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + internal partial class ErrorDetails + { + internal static ErrorDetails DeserializeErrorDetails(JsonElement element) + { + Optional code = default; + Optional message = default; + Optional> additionalInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalInfo")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ErrorAdditionalInfo.DeserializeErrorAdditionalInfo(item)); + } + additionalInfo = array; + continue; + } + } + return new ErrorDetails(code.Value, message.Value, Optional.ToList(additionalInfo)); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.cs new file mode 100644 index 000000000000..3048440fbe44 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorDetails.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The details of the error. + internal partial class ErrorDetails + { + /// Initializes a new instance of ErrorDetails. + internal ErrorDetails() + { + AdditionalInfo = new ChangeTrackingList(); + } + + /// Initializes a new instance of ErrorDetails. + /// Error code. + /// Error message indicating why the operation failed. + /// The error additional info. + internal ErrorDetails(string code, string message, IReadOnlyList additionalInfo) + { + Code = code; + Message = message; + AdditionalInfo = additionalInfo; + } + + /// Error code. + public string Code { get; } + /// Error message indicating why the operation failed. + public string Message { get; } + /// The error additional info. + public IReadOnlyList AdditionalInfo { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.Serialization.cs new file mode 100644 index 000000000000..39cab62a62d7 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + internal partial class ErrorResponse + { + internal static ErrorResponse DeserializeErrorResponse(JsonElement element) + { + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + error = ErrorDetails.DeserializeErrorDetails(property.Value); + continue; + } + } + return new ErrorResponse(error.Value); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..83705a7085e4 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + internal partial class ErrorResponse + { + /// Initializes a new instance of ErrorResponse. + internal ErrorResponse() + { + } + + /// Initializes a new instance of ErrorResponse. + /// The details of the error. + internal ErrorResponse(ErrorDetails error) + { + Error = error; + } + + /// The details of the error. + public ErrorDetails Error { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.Serialization.cs index 98c862f8fc1a..011dc46b6e32 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.Serialization.cs @@ -12,10 +12,43 @@ namespace Azure.ResourceManager.AppConfiguration.Models { - public partial class KeyValue + public partial class KeyValue : IUtf8JsonSerializable { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(ContentType)) + { + writer.WritePropertyName("contentType"); + writer.WriteStringValue(ContentType); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + internal static KeyValue DeserializeKeyValue(JsonElement element) { + Optional id = default; + Optional name = default; + Optional type = default; Optional key = default; Optional label = default; Optional value = default; @@ -23,71 +56,98 @@ internal static KeyValue DeserializeKeyValue(JsonElement element) Optional eTag = default; Optional lastModified = default; Optional locked = default; - Optional> tags = default; + Optional> tags = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("key")) - { - key = property.Value.GetString(); - continue; - } - if (property.NameEquals("label")) - { - label = property.Value.GetString(); - continue; - } - if (property.NameEquals("value")) + if (property.NameEquals("id")) { - value = property.Value.GetString(); + id = property.Value.GetString(); continue; } - if (property.NameEquals("contentType")) + if (property.NameEquals("name")) { - contentType = property.Value.GetString(); + name = property.Value.GetString(); continue; } - if (property.NameEquals("eTag")) + if (property.NameEquals("type")) { - eTag = property.Value.GetString(); - continue; - } - if (property.NameEquals("lastModified")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - lastModified = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("locked")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - locked = property.Value.GetBoolean(); + type = property.Value.GetString(); continue; } - if (property.NameEquals("tags")) + if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (property0.NameEquals("key")) + { + key = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("label")) + { + label = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("value")) + { + value = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("contentType")) + { + contentType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("eTag")) + { + eTag = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("lastModified")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastModified = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("locked")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + locked = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("tags")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + tags = dictionary; + continue; + } } - tags = dictionary; continue; } } - return new KeyValue(key.Value, label.Value, value.Value, contentType.Value, eTag.Value, Optional.ToNullable(lastModified), Optional.ToNullable(locked), Optional.ToDictionary(tags)); + return new KeyValue(id.Value, name.Value, type.Value, key.Value, label.Value, value.Value, contentType.Value, eTag.Value, Optional.ToNullable(lastModified), Optional.ToNullable(locked), Optional.ToDictionary(tags)); } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.cs index 64c654ec68bf..24dadf3b7889 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValue.cs @@ -11,16 +11,19 @@ namespace Azure.ResourceManager.AppConfiguration.Models { - /// The result of a request to retrieve a key-value from the specified configuration store. + /// The key-value resource along with all resource properties. public partial class KeyValue { /// Initializes a new instance of KeyValue. - internal KeyValue() + public KeyValue() { Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of KeyValue. + /// The resource ID. + /// The name of the resource. + /// The type of the resource. /// /// The primary identifier of a key-value. /// @@ -45,8 +48,11 @@ internal KeyValue() /// A locked key-value may not be modified until it is unlocked. /// /// A dictionary of tags that can help identify what a key-value may be applicable for. - internal KeyValue(string key, string label, string value, string contentType, string eTag, DateTimeOffset? lastModified, bool? locked, IReadOnlyDictionary tags) + internal KeyValue(string id, string name, string type, string key, string label, string value, string contentType, string eTag, DateTimeOffset? lastModified, bool? locked, IDictionary tags) { + Id = id; + Name = name; + Type = type; Key = key; Label = label; Value = value; @@ -57,6 +63,12 @@ internal KeyValue(string key, string label, string value, string contentType, st Tags = tags; } + /// The resource ID. + public string Id { get; } + /// The name of the resource. + public string Name { get; } + /// The type of the resource. + public string Type { get; } /// /// The primary identifier of a key-value. /// @@ -70,13 +82,13 @@ internal KeyValue(string key, string label, string value, string contentType, st /// public string Label { get; } /// The value of the key-value. - public string Value { get; } + public string Value { get; set; } /// /// 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. /// - public string ContentType { get; } + public string ContentType { get; set; } /// An ETag indicating the state of a key-value within a configuration store. public string ETag { get; } /// The last time a modifying operation was performed on the given key-value. @@ -88,6 +100,6 @@ internal KeyValue(string key, string label, string value, string contentType, st /// public bool? Locked { get; } /// A dictionary of tags that can help identify what a key-value may be applicable for. - public IReadOnlyDictionary Tags { get; } + public IDictionary Tags { get; } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.Serialization.cs new file mode 100644 index 000000000000..26c2d1021fd7 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + internal partial class KeyValueListResult + { + internal static KeyValueListResult DeserializeKeyValueListResult(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValue.DeserializeKeyValue(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new KeyValueListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.cs new file mode 100644 index 000000000000..f695a7edbe2e --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/KeyValueListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The result of a request to list key-values. + internal partial class KeyValueListResult + { + /// Initializes a new instance of KeyValueListResult. + internal KeyValueListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of KeyValueListResult. + /// The collection value. + /// The URI that can be used to request the next set of paged results. + internal KeyValueListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The collection value. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next set of paged results. + public string NextLink { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.Serialization.cs deleted file mode 100644 index 2ae900b47307..000000000000 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.AppConfiguration.Models -{ - public partial class ListKeyValueParameters : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("key"); - writer.WriteStringValue(Key); - if (Optional.IsDefined(Label)) - { - writer.WritePropertyName("label"); - writer.WriteStringValue(Label); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.cs deleted file mode 100644 index 659cafd1d9a0..000000000000 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ListKeyValueParameters.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.AppConfiguration.Models -{ - /// The parameters used to list a configuration store key-value. - public partial class ListKeyValueParameters - { - /// Initializes a new instance of ListKeyValueParameters. - /// The key to retrieve. - /// is null. - public ListKeyValueParameters(string key) - { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - Key = key; - } - - /// The key to retrieve. - public string Key { get; } - /// The label of the key. - public string Label { get; set; } - } -} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.Serialization.cs new file mode 100644 index 000000000000..6cdbe5f1d1e6 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class LogSpecification + { + internal static LogSpecification DeserializeLogSpecification(JsonElement element) + { + Optional name = default; + Optional displayName = default; + Optional blobDuration = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobDuration")) + { + blobDuration = property.Value.GetString(); + continue; + } + } + return new LogSpecification(name.Value, displayName.Value, blobDuration.Value); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.cs new file mode 100644 index 000000000000..f4a9ee4d6406 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/LogSpecification.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Specifications of the Log for Azure Monitoring. + public partial class LogSpecification + { + /// Initializes a new instance of LogSpecification. + internal LogSpecification() + { + } + + /// Initializes a new instance of LogSpecification. + /// Name of the log. + /// Localized friendly display name of the log. + /// Blob duration of the log. + internal LogSpecification(string name, string displayName, string blobDuration) + { + Name = name; + DisplayName = displayName; + BlobDuration = blobDuration; + } + + /// Name of the log. + public string Name { get; } + /// Localized friendly display name of the log. + public string DisplayName { get; } + /// Blob duration of the log. + public string BlobDuration { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.Serialization.cs new file mode 100644 index 000000000000..61451bca07c4 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class MetricDimension + { + internal static MetricDimension DeserializeMetricDimension(JsonElement element) + { + Optional name = default; + Optional displayName = default; + Optional internalName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("internalName")) + { + internalName = property.Value.GetString(); + continue; + } + } + return new MetricDimension(name.Value, displayName.Value, internalName.Value); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.cs new file mode 100644 index 000000000000..2dbb978bb27b --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricDimension.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Specifications of the Dimension of metrics. + public partial class MetricDimension + { + /// Initializes a new instance of MetricDimension. + internal MetricDimension() + { + } + + /// Initializes a new instance of MetricDimension. + /// Name of the dimension. + /// Localized friendly display name of the dimension. + /// Internal name of the dimension. + internal MetricDimension(string name, string displayName, string internalName) + { + Name = name; + DisplayName = displayName; + InternalName = internalName; + } + + /// Name of the dimension. + public string Name { get; } + /// Localized friendly display name of the dimension. + public string DisplayName { get; } + /// Internal name of the dimension. + public string InternalName { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.Serialization.cs new file mode 100644 index 000000000000..34bd073c0d78 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.Serialization.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class MetricSpecification + { + internal static MetricSpecification DeserializeMetricSpecification(JsonElement element) + { + Optional name = default; + Optional displayName = default; + Optional displayDescription = default; + Optional unit = default; + Optional aggregationType = default; + Optional internalMetricName = default; + Optional> dimensions = default; + Optional fillGapWithZero = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName")) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayDescription")) + { + displayDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("unit")) + { + unit = property.Value.GetString(); + continue; + } + if (property.NameEquals("aggregationType")) + { + aggregationType = property.Value.GetString(); + continue; + } + if (property.NameEquals("internalMetricName")) + { + internalMetricName = property.Value.GetString(); + continue; + } + if (property.NameEquals("dimensions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetricDimension.DeserializeMetricDimension(item)); + } + dimensions = array; + continue; + } + if (property.NameEquals("fillGapWithZero")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + fillGapWithZero = property.Value.GetBoolean(); + continue; + } + } + return new MetricSpecification(name.Value, displayName.Value, displayDescription.Value, unit.Value, aggregationType.Value, internalMetricName.Value, Optional.ToList(dimensions), Optional.ToNullable(fillGapWithZero)); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.cs new file mode 100644 index 000000000000..dddcebda3c49 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/MetricSpecification.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Specifications of the Metrics for Azure Monitoring. + public partial class MetricSpecification + { + /// Initializes a new instance of MetricSpecification. + internal MetricSpecification() + { + Dimensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of MetricSpecification. + /// Name of the metric. + /// Localized friendly display name of the metric. + /// Localized friendly description of the metric. + /// Unit that makes sense for the metric. + /// Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + /// Internal metric name. + /// Dimensions of the metric. + /// Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + internal MetricSpecification(string name, string displayName, string displayDescription, string unit, string aggregationType, string internalMetricName, IReadOnlyList dimensions, bool? fillGapWithZero) + { + Name = name; + DisplayName = displayName; + DisplayDescription = displayDescription; + Unit = unit; + AggregationType = aggregationType; + InternalMetricName = internalMetricName; + Dimensions = dimensions; + FillGapWithZero = fillGapWithZero; + } + + /// Name of the metric. + public string Name { get; } + /// Localized friendly display name of the metric. + public string DisplayName { get; } + /// Localized friendly description of the metric. + public string DisplayDescription { get; } + /// Unit that makes sense for the metric. + public string Unit { get; } + /// Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + public string AggregationType { get; } + /// Internal metric name. + public string InternalMetricName { get; } + /// Dimensions of the metric. + public IReadOnlyList Dimensions { get; } + /// Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + public bool? FillGapWithZero { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.Serialization.cs index bf863f3166ac..b2d8472a4d3e 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.Serialization.cs @@ -15,7 +15,10 @@ public partial class OperationDefinition internal static OperationDefinition DeserializeOperationDefinition(JsonElement element) { Optional name = default; + Optional isDataAction = default; Optional display = default; + Optional origin = default; + Optional properties = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) @@ -23,6 +26,16 @@ internal static OperationDefinition DeserializeOperationDefinition(JsonElement e name = property.Value.GetString(); continue; } + if (property.NameEquals("isDataAction")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + isDataAction = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("display")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -33,8 +46,23 @@ internal static OperationDefinition DeserializeOperationDefinition(JsonElement e display = OperationDefinitionDisplay.DeserializeOperationDefinitionDisplay(property.Value); continue; } + if (property.NameEquals("origin")) + { + origin = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = OperationProperties.DeserializeOperationProperties(property.Value); + continue; + } } - return new OperationDefinition(name.Value, display.Value); + return new OperationDefinition(name.Value, Optional.ToNullable(isDataAction), display.Value, origin.Value, properties.Value); } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.cs index 4ffe1971cfd3..36b82baada28 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationDefinition.cs @@ -17,16 +17,28 @@ internal OperationDefinition() /// Initializes a new instance of OperationDefinition. /// Operation name: {provider}/{resource}/{operation}. + /// Indicates whether the operation is a data action. /// The display information for the configuration store operation. - internal OperationDefinition(string name, OperationDefinitionDisplay display) + /// Origin of the operation. + /// Properties of the operation. + internal OperationDefinition(string name, bool? isDataAction, OperationDefinitionDisplay display, string origin, OperationProperties properties) { Name = name; + IsDataAction = isDataAction; Display = display; + Origin = origin; + Properties = properties; } /// Operation name: {provider}/{resource}/{operation}. public string Name { get; } + /// Indicates whether the operation is a data action. + public bool? IsDataAction { get; } /// The display information for the configuration store operation. public OperationDefinitionDisplay Display { get; } + /// Origin of the operation. + public string Origin { get; } + /// Properties of the operation. + public OperationProperties Properties { get; } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.Serialization.cs new file mode 100644 index 000000000000..85261e5b1cd4 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.Serialization.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class OperationProperties + { + internal static OperationProperties DeserializeOperationProperties(JsonElement element) + { + Optional serviceSpecification = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serviceSpecification")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + serviceSpecification = ServiceSpecification.DeserializeServiceSpecification(property.Value); + continue; + } + } + return new OperationProperties(serviceSpecification.Value); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.cs new file mode 100644 index 000000000000..a798333d6e89 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/OperationProperties.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Extra Operation properties. + public partial class OperationProperties + { + /// Initializes a new instance of OperationProperties. + internal OperationProperties() + { + } + + /// Initializes a new instance of OperationProperties. + /// Service specifications of the operation. + internal OperationProperties(ServiceSpecification serviceSpecification) + { + ServiceSpecification = serviceSpecification; + } + + /// Service specifications of the operation. + public ServiceSpecification ServiceSpecification { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.Serialization.cs index 2f1949e67da0..60e0fed512dd 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.Serialization.cs @@ -5,7 +5,6 @@ #nullable disable -using System.Collections.Generic; using System.Text.Json; using Azure.Core; @@ -16,19 +15,6 @@ public partial class Resource : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("location"); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } writer.WriteEndObject(); } @@ -37,8 +23,6 @@ internal static Resource DeserializeResource(JsonElement element) Optional id = default; Optional name = default; Optional type = default; - string location = default; - Optional> tags = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) @@ -56,28 +40,8 @@ internal static Resource DeserializeResource(JsonElement element) type = property.Value.GetString(); continue; } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } } - return new Resource(id.Value, name.Value, type.Value, location, Optional.ToDictionary(tags)); + return new Resource(id.Value, name.Value, type.Value); } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.cs index e8491238f495..d5f2f2433ec6 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/Resource.cs @@ -5,53 +5,32 @@ #nullable disable -using System; -using System.Collections.Generic; -using Azure.Core; - namespace Azure.ResourceManager.AppConfiguration.Models { - /// An Azure resource. + /// Common fields that are returned in the response for all Azure Resource Manager resources. public partial class Resource { /// Initializes a new instance of Resource. - /// The location of the resource. This cannot be changed after the resource is created. - /// is null. - public Resource(string location) + public Resource() { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - Location = location; - Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of Resource. - /// The resource ID. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. /// The name of the resource. - /// The type of the resource. - /// The location of the resource. This cannot be changed after the resource is created. - /// The tags of the resource. - internal Resource(string id, string name, string type, string location, IDictionary tags) + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + internal Resource(string id, string name, string type) { Id = id; Name = name; Type = type; - Location = location; - Tags = tags; } - /// The resource ID. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. public string Id { get; } /// The name of the resource. public string Name { get; } - /// The type of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". public string Type { get; } - /// The location of the resource. This cannot be changed after the resource is created. - public string Location { get; set; } - /// The tags of the resource. - public IDictionary Tags { get; } } } diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.Serialization.cs new file mode 100644 index 000000000000..df786caa90e2 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class ServiceSpecification + { + internal static ServiceSpecification DeserializeServiceSpecification(JsonElement element) + { + Optional> logSpecifications = default; + Optional> metricSpecifications = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("logSpecifications")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LogSpecification.DeserializeLogSpecification(item)); + } + logSpecifications = array; + continue; + } + if (property.NameEquals("metricSpecifications")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetricSpecification.DeserializeMetricSpecification(item)); + } + metricSpecifications = array; + continue; + } + } + return new ServiceSpecification(Optional.ToList(logSpecifications), Optional.ToList(metricSpecifications)); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.cs new file mode 100644 index 000000000000..543c430a045c --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/ServiceSpecification.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Service specification payload. + public partial class ServiceSpecification + { + /// Initializes a new instance of ServiceSpecification. + internal ServiceSpecification() + { + LogSpecifications = new ChangeTrackingList(); + MetricSpecifications = new ChangeTrackingList(); + } + + /// Initializes a new instance of ServiceSpecification. + /// Specifications of the Log for Azure Monitoring. + /// Specifications of the Metrics for Azure Monitoring. + internal ServiceSpecification(IReadOnlyList logSpecifications, IReadOnlyList metricSpecifications) + { + LogSpecifications = logSpecifications; + MetricSpecifications = metricSpecifications; + } + + /// Specifications of the Log for Azure Monitoring. + public IReadOnlyList LogSpecifications { get; } + /// Specifications of the Metrics for Azure Monitoring. + public IReadOnlyList MetricSpecifications { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.Serialization.cs new file mode 100644 index 000000000000..67ad78c1b094 --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.Serialization.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class SystemData + { + internal static SystemData DeserializeSystemData(JsonElement element) + { + Optional createdBy = default; + Optional createdByType = default; + Optional createdAt = default; + Optional lastModifiedBy = default; + Optional lastModifiedByType = default; + Optional lastModifiedAt = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdBy")) + { + createdBy = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdByType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdByType = new CreatedByType(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdAt")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedBy")) + { + lastModifiedBy = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastModifiedByType")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + lastModifiedByType = new CreatedByType(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastModifiedAt")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + lastModifiedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new SystemData(createdBy.Value, Optional.ToNullable(createdByType), Optional.ToNullable(createdAt), lastModifiedBy.Value, Optional.ToNullable(lastModifiedByType), Optional.ToNullable(lastModifiedAt)); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..b4f7dcfb91ac --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/SystemData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + /// Initializes a new instance of SystemData. + internal SystemData() + { + } + + /// Initializes a new instance of SystemData. + /// The identity that created the resource. + /// The type of identity that created the resource. + /// The timestamp of resource creation (UTC). + /// The identity that last modified the resource. + /// The type of identity that last modified the resource. + /// The timestamp of resource last modification (UTC). + internal SystemData(string createdBy, CreatedByType? createdByType, DateTimeOffset? createdAt, string lastModifiedBy, CreatedByType? lastModifiedByType, DateTimeOffset? lastModifiedAt) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + } + + /// The identity that created the resource. + public string CreatedBy { get; } + /// The type of identity that created the resource. + public CreatedByType? CreatedByType { get; } + /// The timestamp of resource creation (UTC). + public DateTimeOffset? CreatedAt { get; } + /// The identity that last modified the resource. + public string LastModifiedBy { get; } + /// The type of identity that last modified the resource. + public CreatedByType? LastModifiedByType { get; } + /// The timestamp of resource last modification (UTC). + public DateTimeOffset? LastModifiedAt { get; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.Serialization.cs new file mode 100644 index 000000000000..2b3a8f33b65d --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.Serialization.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + public partial class TrackedResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + writer.WriteEndObject(); + } + + internal static TrackedResource DeserializeTrackedResource(JsonElement element) + { + Optional> tags = default; + string location = default; + Optional id = default; + Optional name = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location")) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + } + return new TrackedResource(id.Value, name.Value, type.Value, Optional.ToDictionary(tags), location); + } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..8269b8feeade --- /dev/null +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/TrackedResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppConfiguration.Models +{ + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + public partial class TrackedResource : Resource + { + /// Initializes a new instance of TrackedResource. + /// The geo-location where the resource lives. + /// is null. + public TrackedResource(string location) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + + Tags = new ChangeTrackingDictionary(); + Location = location; + } + + /// Initializes a new instance of TrackedResource. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Resource tags. + /// The geo-location where the resource lives. + internal TrackedResource(string id, string name, string type, IDictionary tags, string location) : base(id, name, type) + { + Tags = tags; + Location = location; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The geo-location where the resource lives. + public string Location { get; set; } + } +} diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Operations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Operations.cs index 9001c471bc63..f0419db825dd 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Operations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Operations.cs @@ -33,7 +33,7 @@ protected Operations() /// The Microsoft Azure subscription ID. /// server parameter. /// Api Version. - internal Operations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + internal Operations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { RestClient = new RestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsOperations.cs index 85a94bd6e4b1..478a6f79b3c2 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -33,7 +33,7 @@ protected PrivateEndpointConnectionsOperations() /// The Microsoft Azure subscription ID. /// server parameter. /// Api Version. - internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsRestOperations.cs index 9997b1b901a6..0849d3ed4111 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateEndpointConnectionsRestOperations.cs @@ -31,7 +31,7 @@ internal partial class PrivateEndpointConnectionsRestOperations /// server parameter. /// Api Version. /// or is null. - public PrivateEndpointConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + public PrivateEndpointConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { if (subscriptionId == null) { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesOperations.cs index 4bbdc97b5097..99ef37e77360 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesOperations.cs @@ -33,7 +33,7 @@ protected PrivateLinkResourcesOperations() /// The Microsoft Azure subscription ID. /// server parameter. /// Api Version. - internal PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + internal PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { RestClient = new PrivateLinkResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion); _clientDiagnostics = clientDiagnostics; diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesRestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesRestOperations.cs index 9a8841273cdf..f91f85f389a9 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesRestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/PrivateLinkResourcesRestOperations.cs @@ -31,7 +31,7 @@ internal partial class PrivateLinkResourcesRestOperations /// server parameter. /// Api Version. /// or is null. - public PrivateLinkResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + public PrivateLinkResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { if (subscriptionId == null) { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations.cs index be6f26ec7ded..4ff4e37e7877 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/RestOperations.cs @@ -31,7 +31,7 @@ internal partial class RestOperations /// server parameter. /// Api Version. /// or is null. - public RestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + public RestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-03-01-preview") { if (subscriptionId == null) { diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md index 0915f9c2ed8c..96d7428b2db5 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/d302c82f32daec0feb68cd7d68d45ba898b67ee7/specification/appconfiguration/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/342d36417c0c2c4aff9227ad1925f971966a9181/specification/appconfiguration/resource-manager/readme.md ``` ## Swagger workarounds @@ -26,4 +26,4 @@ directive: where: $.definitions.ConfigurationStoreProperties transform: > $.properties.privateEndpointConnections["x-nullable"] = true; -```` \ No newline at end of file +````