diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md index 7bf928544d70e..b200cdf2df157 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.7 (Unreleased) +## 1.0.0-beta.1 (2022-07-21) + +- Azure Resource Manager AppConfiguration client library for Java. This package contains Microsoft Azure SDK for AppConfiguration Management SDK. Package tag package-2022-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md index a320d92ddf7bc..cf7198c60af4a 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-appconfiguration - 1.0.0-beta.6 + 1.0.0-beta.7 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md index 5e7ee3ad635e7..19dd7374b7ba5 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md @@ -20,11 +20,11 @@ - [CreateOrUpdate](#keyvalues_createorupdate) - [Delete](#keyvalues_delete) - [Get](#keyvalues_get) -- [ListByConfigurationStore](#keyvalues_listbyconfigurationstore) ## Operations - [CheckNameAvailability](#operations_checknameavailability) +- [List](#operations_list) - [RegionalCheckNameAvailability](#operations_regionalchecknameavailability) ## PrivateEndpointConnections @@ -506,28 +506,6 @@ public final class KeyValuesGetSamples { } ``` -### KeyValues_ListByConfigurationStore - -```java -import com.azure.core.util.Context; - -/** Samples for KeyValues ListByConfigurationStore. */ -public final class KeyValuesListByConfigurationStoreSamples { - /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresListKeyValues.json - */ - /** - * Sample code: KeyValues_ListByConfigurationStore. - * - * @param manager Entry point to AppConfigurationManager. - */ - public static void keyValuesListByConfigurationStore( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager.keyValues().listByConfigurationStore("myResourceGroup", "contoso", null, Context.NONE); - } -} -``` - ### Operations_CheckNameAvailability ```java @@ -577,6 +555,27 @@ public final class OperationsCheckNameAvailabilitySamples { } ``` +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/OperationsList.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void operationsList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.operations().list(null, Context.NONE); + } +} +``` + ### Operations_RegionalCheckNameAvailability ```java @@ -631,30 +630,35 @@ public final class OperationsRegionalCheckNameAvailabilitySamples { ### PrivateEndpointConnections_CreateOrUpdate ```java +import com.azure.core.util.Context; import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; +import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresCreatePrivateEndpointConnection.json + * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json */ /** - * Sample code: PrivateEndpointConnection_CreateOrUpdate. + * Sample code: PrivateEndpointConnection_Update. * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionCreateOrUpdate( + public static void privateEndpointConnectionUpdate( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() - .define("myConnection") - .withExistingConfigurationStore("myResourceGroup", "contoso") + PrivateEndpointConnection resource = + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "contoso", "myConnection", Context.NONE) + .getValue(); + resource + .update() .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState() .withStatus(ConnectionStatus.APPROVED) .withDescription("Auto-Approved")) - .create(); + .apply(); } } ``` diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java index aab3326a05b45..bc0ef410c9627 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java @@ -219,7 +219,7 @@ public AppConfigurationManager authenticate(TokenCredential credential, AzurePro .append("-") .append("com.azure.resourcemanager.appconfiguration") .append("/") - .append("1.0.0-beta.6"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java index 5115374be5539..6ffcc2ed5eac1 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; @@ -15,37 +14,6 @@ /** An instance of this class provides access to all the operations defined in KeyValuesClient. */ public interface KeyValuesClient { - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName); - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param skipToken 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context); - /** * Gets the properties of the specified key-value. * diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java index 72a18fcc3788a..139aca81caaa2 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java @@ -77,7 +77,9 @@ Response getWithResponse( String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context); /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -96,7 +98,9 @@ SyncPoller, PrivateEndpointConnection PrivateEndpointConnectionInner privateEndpointConnection); /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -117,7 +121,9 @@ SyncPoller, PrivateEndpointConnection Context context); /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -136,7 +142,9 @@ PrivateEndpointConnectionInner createOrUpdate( PrivateEndpointConnectionInner privateEndpointConnection); /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java index 3d1438d30a15e..24a6731f8fbc0 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java @@ -19,10 +19,6 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; @@ -33,7 +29,6 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appconfiguration.fluent.KeyValuesClient; import com.azure.resourcemanager.appconfiguration.fluent.models.KeyValueInner; -import com.azure.resourcemanager.appconfiguration.models.KeyValueListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -64,22 +59,6 @@ public final class KeyValuesClientImpl implements KeyValuesClient { @Host("{$host}") @ServiceInterface(name = "AppConfigurationMana") private interface KeyValuesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration" - + "/configurationStores/{configStoreName}/keyValues") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByConfigurationStore( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration" @@ -128,238 +107,6 @@ Mono>> delete( @PathParam("keyValueName") String keyValueName, @HeaderParam("Accept") String accept, Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByConfigurationStoreNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param skipToken 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName, String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (configStoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param skipToken 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName, String skipToken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (configStoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param skipToken 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName, String skipToken) { - return new PagedFlux<>( - () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken), - nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink)); - } - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync(String resourceGroupName, String configStoreName) { - final String skipToken = null; - return new PagedFlux<>( - () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken), - nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink)); - } - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param skipToken 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName, String skipToken, Context context) { - return new PagedFlux<>( - () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken, context), - nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName) { - final String skipToken = null; - return new PagedIterable<>(listByConfigurationStoreAsync(resourceGroupName, configStoreName, skipToken)); - } - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param skipToken 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context) { - return new PagedIterable<>( - listByConfigurationStoreAsync(resourceGroupName, configStoreName, skipToken, context)); } /** @@ -998,79 +745,4 @@ public void delete(String resourceGroupName, String configStoreName, String keyV public void delete(String resourceGroupName, String configStoreName, String keyValueName, Context context) { deleteAsync(resourceGroupName, configStoreName, keyValueName, context).block(); } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java index 021d2161b0d4f..f3a8fab179adb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.appconfiguration.implementation; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; @@ -28,19 +27,6 @@ public KeyValuesImpl( this.serviceManager = serviceManager; } - public PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName); - return Utils.mapPage(inner, inner1 -> new KeyValueImpl(inner1, this.manager())); - } - - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName, skipToken, context); - return Utils.mapPage(inner, inner1 -> new KeyValueImpl(inner1, this.manager())); - } - public KeyValue get(String resourceGroupName, String configStoreName, String keyValueName) { KeyValueInner inner = this.serviceClient().get(resourceGroupName, configStoreName, keyValueName); if (inner != null) { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java index 3c619651955ec..d52999789d6a6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java @@ -497,7 +497,9 @@ public Response getWithResponse( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -567,7 +569,9 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -636,7 +640,9 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -668,7 +674,9 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -703,7 +711,9 @@ private Mono>> createOrUpdateWithResponseAsync( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -726,7 +736,9 @@ public SyncPoller, PrivateEndpointCon } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -751,7 +763,9 @@ public SyncPoller, PrivateEndpointCon } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -775,7 +789,9 @@ private Mono createOrUpdateAsync( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -801,7 +817,9 @@ private Mono createOrUpdateAsync( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. @@ -824,7 +842,9 @@ public PrivateEndpointConnectionInner createOrUpdate( } /** - * Update the state of the specified private endpoint connection associated with the configuration store. + * Update the state of the specified private endpoint connection associated with the configuration store. This + * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created + * with the Network resource provider. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValueListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValueListResult.java deleted file mode 100644 index 8e8036197b7e5..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValueListResult.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.appconfiguration.fluent.models.KeyValueInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The result of a request to list key-values. */ -@Fluent -public final class KeyValueListResult { - /* - * The collection value. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI that can be used to request the next set of paged results. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The collection value. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The collection value. - * - * @param value the value value to set. - * @return the KeyValueListResult object itself. - */ - public KeyValueListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next set of paged results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next set of paged results. - * - * @param nextLink the nextLink value to set. - * @return the KeyValueListResult object itself. - */ - public KeyValueListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java index 4a52c8bf7a6db..b4000906cb5d2 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java @@ -4,41 +4,11 @@ package com.azure.resourcemanager.appconfiguration.models; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; /** Resource collection API of KeyValues. */ public interface KeyValues { - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedIterable}. - */ - PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName); - - /** - * Lists the key-values for a given configuration store. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param configStoreName The name of the configuration store. - * @param skipToken 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a request to list key-values as paginated response with {@link PagedIterable}. - */ - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context); - /** * Gets the properties of the specified key-value. * diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesListByConfigurationStoreSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListSamples.java similarity index 51% rename from sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesListByConfigurationStoreSamples.java rename to sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListSamples.java index b836b7c93c2c2..be935830ffc66 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesListByConfigurationStoreSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListSamples.java @@ -6,18 +6,17 @@ import com.azure.core.util.Context; -/** Samples for KeyValues ListByConfigurationStore. */ -public final class KeyValuesListByConfigurationStoreSamples { +/** Samples for Operations List. */ +public final class OperationsListSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresListKeyValues.json + * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/OperationsList.json */ /** - * Sample code: KeyValues_ListByConfigurationStore. + * Sample code: Operations_List. * * @param manager Entry point to AppConfigurationManager. */ - public static void keyValuesListByConfigurationStore( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager.keyValues().listByConfigurationStore("myResourceGroup", "contoso", null, Context.NONE); + public static void operationsList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.operations().list(null, Context.NONE); } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 625980d28dbe7..9f596224ac8e2 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -4,29 +4,34 @@ package com.azure.resourcemanager.appconfiguration.generated; +import com.azure.core.util.Context; import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; +import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresCreatePrivateEndpointConnection.json + * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2022-05-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json */ /** - * Sample code: PrivateEndpointConnection_CreateOrUpdate. + * Sample code: PrivateEndpointConnection_Update. * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionCreateOrUpdate( + public static void privateEndpointConnectionUpdate( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() - .define("myConnection") - .withExistingConfigurationStore("myResourceGroup", "contoso") + PrivateEndpointConnection resource = + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "contoso", "myConnection", Context.NONE) + .getValue(); + resource + .update() .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState() .withStatus(ConnectionStatus.APPROVED) .withDescription("Auto-Approved")) - .create(); + .apply(); } }