diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md index edc794ce9a48d..7cdeef43bd8d2 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-08-31) +- Azure Resource Manager AzureArcData client library for Java. This package contains Microsoft Azure SDK for AzureArcData Management SDK. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-2021-08-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-07-21) diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md index 8d189fa6ffb4a..b68e5910faa56 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-azurearcdata - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,7 +74,6 @@ See [API design][design] for general introduction on design and key concepts on ## Examples -[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md) ## Troubleshooting diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/DataControllersClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/DataControllersClient.java index 49f0a7bee68a6..d8c03b698926c 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/DataControllersClient.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/DataControllersClient.java @@ -131,6 +131,34 @@ DataControllerResourceInner putDataController( DataControllerResourceInner dataControllerResource, Context context); + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String dataControllerName); + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String dataControllerName, Context context); + /** * Deletes a dataController resource. * @@ -152,10 +180,9 @@ DataControllerResourceInner putDataController( * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context); + void delete(String resourceGroupName, String dataControllerName, Context context); /** * Retrieves a dataController resource. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java index 6e29427dab0bf..6cb84258c3bb0 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java @@ -159,6 +159,34 @@ SqlManagedInstanceInner create( SqlManagedInstanceInner sqlManagedInstance, Context context); + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlManagedInstanceName); + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlManagedInstanceName, Context context); + /** * Deletes a SQL Managed Instance resource. * @@ -180,10 +208,9 @@ SqlManagedInstanceInner create( * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context); + void delete(String resourceGroupName, String sqlManagedInstanceName, Context context); /** * Updates a SQL Managed Instance resource. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerInstancesClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerInstancesClient.java index eeb39cee2409f..6e362cf1ec4a0 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerInstancesClient.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerInstancesClient.java @@ -159,6 +159,34 @@ SqlServerInstanceInner create( SqlServerInstanceInner sqlServerInstance, Context context); + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlServerInstanceName); + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlServerInstanceName, Context context); + /** * Deletes a SQL Server Instance resource. * @@ -180,10 +208,9 @@ SqlServerInstanceInner create( * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context); + void delete(String resourceGroupName, String sqlServerInstanceName, Context context); /** * Updates a SQL Server Instance resource. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/OperationInner.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/OperationInner.java index de9bd56b107f3..b57633882bc60 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/OperationInner.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/OperationInner.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.azurearcdata.models.OperationDisplay; import com.azure.resourcemanager.azurearcdata.models.OperationOrigin; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -46,6 +47,7 @@ public final class OperationInner { * Additional descriptions for the operation. */ @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; /** diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersClientImpl.java index a0da4a4f34341..05c80f047bebb 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersClientImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersClientImpl.java @@ -114,9 +114,9 @@ Mono>> putDataController( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + "/dataControllers/{dataControllerName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -789,7 +789,8 @@ public DataControllerResourceInner putDataController( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String dataControllerName) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dataControllerName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -838,7 +839,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( + private Mono>> deleteWithResponseAsync( String resourceGroupName, String dataControllerName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -873,6 +874,77 @@ private Mono> deleteWithResponseAsync( context); } + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String dataControllerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, dataControllerName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dataControllerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, dataControllerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dataControllerName) { + return beginDeleteAsync(resourceGroupName, dataControllerName).getSyncPoller(); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dataControllerName, Context context) { + return beginDeleteAsync(resourceGroupName, dataControllerName, context).getSyncPoller(); + } + /** * Deletes a dataController resource. * @@ -885,8 +957,27 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String dataControllerName) { - return deleteWithResponseAsync(resourceGroupName, dataControllerName) - .flatMap((Response res) -> Mono.empty()); + return beginDeleteAsync(resourceGroupName, dataControllerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataControllerName, Context context) { + return beginDeleteAsync(resourceGroupName, dataControllerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -912,11 +1003,10 @@ public void delete(String resourceGroupName, String dataControllerName) { * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context) { - return deleteWithResponseAsync(resourceGroupName, dataControllerName, context).block(); + public void delete(String resourceGroupName, String dataControllerName, Context context) { + deleteAsync(resourceGroupName, dataControllerName, context).block(); } /** diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersImpl.java index ec5498c3192b9..b184f2339c9c5 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersImpl.java @@ -53,8 +53,8 @@ public void deleteByResourceGroup(String resourceGroupName, String dataControlle this.serviceClient().delete(resourceGroupName, dataControllerName); } - public Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, dataControllerName, context); + public void delete(String resourceGroupName, String dataControllerName, Context context) { + this.serviceClient().delete(resourceGroupName, dataControllerName, context); } public DataControllerResource getByResourceGroup(String resourceGroupName, String dataControllerName) { @@ -139,10 +139,10 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'dataControllers'.", id))); } - this.deleteWithResponse(resourceGroupName, dataControllerName, Context.NONE).getValue(); + this.delete(resourceGroupName, dataControllerName, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -159,7 +159,7 @@ public Response deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'dataControllers'.", id))); } - return this.deleteWithResponse(resourceGroupName, dataControllerName, context); + this.delete(resourceGroupName, dataControllerName, context); } private DataControllersClient serviceClient() { diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesClientImpl.java index ce24bd702682b..d882f8a11c026 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesClientImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesClientImpl.java @@ -129,9 +129,9 @@ Mono>> create( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + "/sqlManagedInstances/{sqlManagedInstanceName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -937,7 +937,8 @@ public SqlManagedInstanceInner create( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String sqlManagedInstanceName) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlManagedInstanceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -987,7 +988,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( + private Mono>> deleteWithResponseAsync( String resourceGroupName, String sqlManagedInstanceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1023,6 +1024,79 @@ private Mono> deleteWithResponseAsync( context); } + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlManagedInstanceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sqlManagedInstanceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlManagedInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sqlManagedInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlManagedInstanceName) { + return beginDeleteAsync(resourceGroupName, sqlManagedInstanceName).getSyncPoller(); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlManagedInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlManagedInstanceName, context).getSyncPoller(); + } + /** * Deletes a SQL Managed Instance resource. * @@ -1035,8 +1109,27 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String sqlManagedInstanceName) { - return deleteWithResponseAsync(resourceGroupName, sqlManagedInstanceName) - .flatMap((Response res) -> Mono.empty()); + return beginDeleteAsync(resourceGroupName, sqlManagedInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlManagedInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlManagedInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1062,11 +1155,10 @@ public void delete(String resourceGroupName, String sqlManagedInstanceName) { * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, sqlManagedInstanceName, context).block(); + public void delete(String resourceGroupName, String sqlManagedInstanceName, Context context) { + deleteAsync(resourceGroupName, sqlManagedInstanceName, context).block(); } /** diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesImpl.java index fefbc183159f5..92b5c3bcec081 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesImpl.java @@ -79,8 +79,8 @@ public void deleteByResourceGroup(String resourceGroupName, String sqlManagedIns this.serviceClient().delete(resourceGroupName, sqlManagedInstanceName); } - public Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, sqlManagedInstanceName, context); + public void delete(String resourceGroupName, String sqlManagedInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sqlManagedInstanceName, context); } public SqlManagedInstance getById(String id) { @@ -143,10 +143,10 @@ public void deleteById(String id) { .format( "The resource ID '%s' is not valid. Missing path segment 'sqlManagedInstances'.", id))); } - this.deleteWithResponse(resourceGroupName, sqlManagedInstanceName, Context.NONE).getValue(); + this.delete(resourceGroupName, sqlManagedInstanceName, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -164,7 +164,7 @@ public Response deleteByIdWithResponse(String id, Context context) { .format( "The resource ID '%s' is not valid. Missing path segment 'sqlManagedInstances'.", id))); } - return this.deleteWithResponse(resourceGroupName, sqlManagedInstanceName, context); + this.delete(resourceGroupName, sqlManagedInstanceName, context); } private SqlManagedInstancesClient serviceClient() { diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesClientImpl.java index dc73beb7e8255..011046a5acbf4 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesClientImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesClientImpl.java @@ -129,9 +129,9 @@ Mono>> create( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + "/sqlServerInstances/{sqlServerInstanceName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono>> delete( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -933,7 +933,8 @@ public SqlServerInstanceInner create( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String sqlServerInstanceName) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlServerInstanceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -982,7 +983,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( + private Mono>> deleteWithResponseAsync( String resourceGroupName, String sqlServerInstanceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1017,6 +1018,79 @@ private Mono> deleteWithResponseAsync( context); } + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlServerInstanceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlServerInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlServerInstanceName) { + return beginDeleteAsync(resourceGroupName, sqlServerInstanceName).getSyncPoller(); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlServerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlServerInstanceName, context).getSyncPoller(); + } + /** * Deletes a SQL Server Instance resource. * @@ -1029,8 +1103,27 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String sqlServerInstanceName) { - return deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName) - .flatMap((Response res) -> Mono.empty()); + return beginDeleteAsync(resourceGroupName, sqlServerInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlServerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlServerInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1056,11 +1149,10 @@ public void delete(String resourceGroupName, String sqlServerInstanceName) { * @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 response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName, context).block(); + public void delete(String resourceGroupName, String sqlServerInstanceName, Context context) { + deleteAsync(resourceGroupName, sqlServerInstanceName, context).block(); } /** diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesImpl.java index 77145334c0842..6aa95e680d2b7 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesImpl.java @@ -79,8 +79,8 @@ public void deleteByResourceGroup(String resourceGroupName, String sqlServerInst this.serviceClient().delete(resourceGroupName, sqlServerInstanceName); } - public Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, sqlServerInstanceName, context); + public void delete(String resourceGroupName, String sqlServerInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sqlServerInstanceName, context); } public SqlServerInstance getById(String id) { @@ -143,10 +143,10 @@ public void deleteById(String id) { .format( "The resource ID '%s' is not valid. Missing path segment 'sqlServerInstances'.", id))); } - this.deleteWithResponse(resourceGroupName, sqlServerInstanceName, Context.NONE).getValue(); + this.delete(resourceGroupName, sqlServerInstanceName, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -164,7 +164,7 @@ public Response deleteByIdWithResponse(String id, Context context) { .format( "The resource ID '%s' is not valid. Missing path segment 'sqlServerInstances'.", id))); } - return this.deleteWithResponse(resourceGroupName, sqlServerInstanceName, context); + this.delete(resourceGroupName, sqlServerInstanceName, context); } private SqlServerInstancesClient serviceClient() { diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerUpdate.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerUpdate.java index 0ba784b1c5492..40c162932c27f 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerUpdate.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerUpdate.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class DataControllerUpdate { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllers.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllers.java index 9314e36bfd28d..579daa945c480 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllers.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllers.java @@ -73,9 +73,8 @@ public interface DataControllers { * @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 response. */ - Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context); + void delete(String resourceGroupName, String dataControllerName, Context context); /** * Retrieves a dataController resource. @@ -144,9 +143,8 @@ Response getByResourceGroupWithResponse( * @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 response. */ - Response deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new DataControllerResource resource. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java index 049236bd681f3..c39a6e3fa9928 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.HashMap; import java.util.Map; @@ -25,6 +26,7 @@ public final class K8SResourceRequirements { * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ @JsonProperty(value = "requests") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map requests; /* @@ -34,6 +36,7 @@ public final class K8SResourceRequirements { * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ @JsonProperty(value = "limits") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map limits; /* diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ResourceIdentityType.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ResourceIdentityType.java deleted file mode 100644 index 06635620501e4..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ResourceIdentityType.java +++ /dev/null @@ -1,44 +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.azurearcdata.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for ResourceIdentityType. */ -public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"); - - /** The actual serialized value for a ResourceIdentityType instance. */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceIdentityType fromString(String value) { - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java index 414543d3d9d31..f5dd0d8e9a473 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class SqlManagedInstanceUpdate { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstances.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstances.java index f835c5d339704..3c2fae966dede 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstances.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstances.java @@ -99,9 +99,8 @@ Response getByResourceGroupWithResponse( * @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 response. */ - Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context); + void delete(String resourceGroupName, String sqlManagedInstanceName, Context context); /** * Retrieves a SQL Managed Instance resource. @@ -144,9 +143,8 @@ Response getByResourceGroupWithResponse( * @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 response. */ - Response deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new SqlManagedInstance resource. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceUpdate.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceUpdate.java index c13e3be0c8927..9263855be4a76 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceUpdate.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceUpdate.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class SqlServerInstanceUpdate { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstances.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstances.java index c66aef782b2a1..3f47165c53e00 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstances.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstances.java @@ -99,9 +99,8 @@ Response getByResourceGroupWithResponse( * @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 response. */ - Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context); + void delete(String resourceGroupName, String sqlServerInstanceName, Context context); /** * Retrieves a SQL Server Instance resource. @@ -144,9 +143,8 @@ Response getByResourceGroupWithResponse( * @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 response. */ - Response deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new SqlServerInstance resource. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java deleted file mode 100644 index b8ee56896dfdf..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for DataControllers Delete. */ -public final class DataControllersDeleteSamples { - /** - * Sample code: Delete a dataController. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void deleteADataController( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.dataControllers().deleteWithResponse("testrg", "testdataController", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.java deleted file mode 100644 index f94622c4ce32f..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for DataControllers GetByResourceGroup. */ -public final class DataControllersGetByResourceGroupSamples { - /** - * Sample code: Get a data controller. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void getADataController( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager - .dataControllers() - .getByResourceGroupWithResponse("testrg", "testdataController", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java deleted file mode 100644 index 297f0ec00154a..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for DataControllers ListByResourceGroup. */ -public final class DataControllersListByResourceGroupSamples { - /** - * Sample code: Gets all dataControllers in a resource group. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void getsAllDataControllersInAResourceGroup( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.dataControllers().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java deleted file mode 100644 index e92f3d9f4e769..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for DataControllers List. */ -public final class DataControllersListSamples { - /** - * Sample code: Gets all dataControllers in a subscription. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void getsAllDataControllersInASubscription( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.dataControllers().list(Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java deleted file mode 100644 index af445f5400916..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java +++ /dev/null @@ -1,40 +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.azurearcdata; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurearcdata.models.DataControllerResource; -import java.util.HashMap; -import java.util.Map; - -/** Samples for DataControllers PatchDataController. */ -public final class DataControllersPatchDataControllerSamples { - /** - * Sample code: Updates a dataController tags. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void updatesADataControllerTags( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - DataControllerResource resource = - azureArcDataManager - .dataControllers() - .getByResourceGroupWithResponse("testrg", "testdataController1", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("mytag", "myval")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java deleted file mode 100644 index 1f06741dada7a..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java +++ /dev/null @@ -1,83 +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.azurearcdata; - -import com.azure.resourcemanager.azurearcdata.models.BasicLoginInformation; -import com.azure.resourcemanager.azurearcdata.models.DataControllerProperties; -import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; -import com.azure.resourcemanager.azurearcdata.models.ExtendedLocationTypes; -import com.azure.resourcemanager.azurearcdata.models.Infrastructure; -import com.azure.resourcemanager.azurearcdata.models.LogAnalyticsWorkspaceConfig; -import com.azure.resourcemanager.azurearcdata.models.OnPremiseProperty; -import com.azure.resourcemanager.azurearcdata.models.UploadServicePrincipal; -import com.azure.resourcemanager.azurearcdata.models.UploadWatermark; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/** Samples for DataControllers PutDataController. */ -public final class DataControllersPutDataControllerSamples { - /** - * Sample code: Create or update a Data Controller. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void createOrUpdateADataController( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager - .dataControllers() - .define("testdataController") - .withRegion("northeurope") - .withExistingResourceGroup("testrg") - .withProperties( - new DataControllerProperties() - .withInfrastructure(Infrastructure.ONPREMISES) - .withOnPremiseProperty( - new OnPremiseProperty() - .withId(UUID.fromString("12345678-1234-1234-ab12-1a2b3c4d5e6f")) - .withPublicSigningKey("publicOnPremSigningKey")) - .withUploadWatermark( - new UploadWatermark() - .withMetrics(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) - .withLogs(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) - .withUsages(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z"))) - .withBasicLoginInformation( - new BasicLoginInformation().withUsername("username").withPassword("********")) - .withLogAnalyticsWorkspaceConfig( - new LogAnalyticsWorkspaceConfig() - .withWorkspaceId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withPrimaryKey("********")) - .withUploadServicePrincipal( - new UploadServicePrincipal() - .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withAuthority("https://login.microsoftonline.com/") - .withClientSecret("********")) - .withClusterId( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") - .withExtensionId( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s/providers/Microsoft.KubernetesConfiguration/extensions/extension")) - .withTags(mapOf("mytag", "myval")) - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java deleted file mode 100644 index e6fb5cdda877d..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for Operations List. */ -public final class OperationsListSamples { - /** - * Sample code: Lists all of the available Azure Data Services on Azure Arc API operations. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void listsAllOfTheAvailableAzureDataServicesOnAzureArcAPIOperations( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.operations().list(Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java deleted file mode 100644 index ebfbac967d187..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java +++ /dev/null @@ -1,96 +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.azurearcdata; - -import com.azure.resourcemanager.azurearcdata.models.ArcSqlManagedInstanceLicenseType; -import com.azure.resourcemanager.azurearcdata.models.BasicLoginInformation; -import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; -import com.azure.resourcemanager.azurearcdata.models.ExtendedLocationTypes; -import com.azure.resourcemanager.azurearcdata.models.K8SResourceRequirements; -import com.azure.resourcemanager.azurearcdata.models.K8SScheduling; -import com.azure.resourcemanager.azurearcdata.models.K8SSchedulingOptions; -import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SRaw; -import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SSpec; -import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceProperties; -import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceSku; -import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceSkuTier; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SqlManagedInstances Create. */ -public final class SqlManagedInstancesCreateSamples { - /** - * Sample code: Create or update a SQL Managed Instance. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void createOrUpdateASQLManagedInstance( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager - .sqlManagedInstances() - .define("testsqlManagedInstance") - .withRegion("northeurope") - .withExistingResourceGroup("testrg") - .withProperties( - new SqlManagedInstanceProperties() - .withAdmin("Admin user") - .withStartTime("Instance start time") - .withEndTime("Instance end time") - .withK8SRaw( - new SqlManagedInstanceK8SRaw() - .withSpec( - new SqlManagedInstanceK8SSpec() - .withScheduling( - new K8SScheduling() - .withDefaultProperty( - new K8SSchedulingOptions() - .withResources( - new K8SResourceRequirements() - .withRequests( - mapOf( - "additionalProperty", - "additionalValue", - "cpu", - "1", - "memory", - "8Gi")) - .withLimits( - mapOf( - "additionalProperty", - "additionalValue", - "cpu", - "1", - "memory", - "8Gi"))))) - .withReplicas(1))) - .withBasicLoginInformation( - new BasicLoginInformation().withUsername("username").withPassword("********")) - .withLicenseType(ArcSqlManagedInstanceLicenseType.LICENSE_INCLUDED) - .withClusterId( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") - .withExtensionId( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s/providers/Microsoft.KubernetesConfiguration/extensions/extension")) - .withTags(mapOf("mytag", "myval")) - .withExtendedLocation( - new ExtendedLocation() - .withName( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withSku(new SqlManagedInstanceSku().withTier(SqlManagedInstanceSkuTier.GENERAL_PURPOSE).withDev(true)) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java deleted file mode 100644 index 6124999fe7d2e..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlManagedInstances Delete. */ -public final class SqlManagedInstancesDeleteSamples { - /** - * Sample code: Delete a SQL Instance. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void deleteASQLInstance( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.sqlManagedInstances().deleteWithResponse("testrg", "testsqlManagedInstance", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.java deleted file mode 100644 index 3552150a45aad..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlManagedInstances GetByResourceGroup. */ -public final class SqlManagedInstancesGetByResourceGroupSamples { - /** - * Sample code: Updates a SQL Instance tags. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void updatesASQLInstanceTags( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager - .sqlManagedInstances() - .getByResourceGroupWithResponse("testrg", "testsqlManagedInstance", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java deleted file mode 100644 index 1a4645d715c14..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlManagedInstances ListByResourceGroup. */ -public final class SqlManagedInstancesListByResourceGroupSamples { - /** - * Sample code: Gets all SQL Instance in a resource group. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void getsAllSQLInstanceInAResourceGroup( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.sqlManagedInstances().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java deleted file mode 100644 index 4462780774800..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlManagedInstances List. */ -public final class SqlManagedInstancesListSamples { - /** - * Sample code: Gets all SQL Instance in a subscription. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void getsAllSQLInstanceInASubscription( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.sqlManagedInstances().list(Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java deleted file mode 100644 index 68de4717069f7..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java +++ /dev/null @@ -1,40 +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.azurearcdata; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstance; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SqlManagedInstances Update. */ -public final class SqlManagedInstancesUpdateSamples { - /** - * Sample code: Updates a sql Instance tags. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void updatesASqlInstanceTags( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - SqlManagedInstance resource = - azureArcDataManager - .sqlManagedInstances() - .getByResourceGroupWithResponse("testrg", "testsqlManagedInstance", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("mytag", "myval")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java deleted file mode 100644 index 773280cdcfecc..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java +++ /dev/null @@ -1,63 +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.azurearcdata; - -import com.azure.resourcemanager.azurearcdata.models.ArcSqlServerLicenseType; -import com.azure.resourcemanager.azurearcdata.models.ConnectionStatus; -import com.azure.resourcemanager.azurearcdata.models.DefenderStatus; -import com.azure.resourcemanager.azurearcdata.models.EditionType; -import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceProperties; -import com.azure.resourcemanager.azurearcdata.models.SqlVersion; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SqlServerInstances Create. */ -public final class SqlServerInstancesCreateSamples { - /** - * Sample code: Updates a SQL Server Instance tags. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void updatesASQLServerInstanceTags( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager - .sqlServerInstances() - .define("testsqlServerInstance") - .withRegion("northeurope") - .withExistingResourceGroup("testrg") - .withTags(mapOf("mytag", "myval")) - .withProperties( - new SqlServerInstanceProperties() - .withVersion(SqlVersion.SQL_SERVER_2017) - .withEdition(EditionType.DEVELOPER) - .withContainerResourceId("Arc Machine Name") - .withVCore("4") - .withStatus(ConnectionStatus.CONNECTED) - .withPatchLevel("patchlevel") - .withCollation("collation") - .withCurrentVersion("2008 R2") - .withInstanceName("name of instance") - .withTcpDynamicPorts("1433") - .withTcpStaticPorts("1433") - .withProductId("sql id") - .withLicenseType(ArcSqlServerLicenseType.FREE) - .withAzureDefenderStatusLastUpdated(OffsetDateTime.parse("2020-01-02T17:18:19.1234567Z")) - .withAzureDefenderStatus(DefenderStatus.PROTECTED)) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java deleted file mode 100644 index 08c1bca6668df..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlServerInstances Delete. */ -public final class SqlServerInstancesDeleteSamples { - /** - * Sample code: Delete a SQL Server Instance. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void deleteASQLServerInstance( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.sqlServerInstances().deleteWithResponse("testrg", "testsqlServerInstance", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.java deleted file mode 100644 index 4987fe6d689be..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlServerInstances GetByResourceGroup. */ -public final class SqlServerInstancesGetByResourceGroupSamples { - /** - * Sample code: Updates a SQL Server Instance tags. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void updatesASQLServerInstanceTags( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager - .sqlServerInstances() - .getByResourceGroupWithResponse("testrg", "testsqlServerInstance", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java deleted file mode 100644 index d093757db02d9..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlServerInstances ListByResourceGroup. */ -public final class SqlServerInstancesListByResourceGroupSamples { - /** - * Sample code: Gets all SQL Server Instance in a resource group. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void getsAllSQLServerInstanceInAResourceGroup( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.sqlServerInstances().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java deleted file mode 100644 index afcc6add64a00..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java +++ /dev/null @@ -1,21 +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.azurearcdata; - -import com.azure.core.util.Context; - -/** Samples for SqlServerInstances List. */ -public final class SqlServerInstancesListSamples { - /** - * Sample code: Gets all SQL Server Instance in a subscription. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void getsAllSQLServerInstanceInASubscription( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - azureArcDataManager.sqlServerInstances().list(Context.NONE); - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java deleted file mode 100644 index d99020d21b2ea..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java +++ /dev/null @@ -1,40 +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.azurearcdata; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.azurearcdata.models.SqlServerInstance; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SqlServerInstances Update. */ -public final class SqlServerInstancesUpdateSamples { - /** - * Sample code: Updates a SQL Server Instance tags. - * - * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful - * set of web APIs to manage Azure Data Services on Azure Arc Resources. - */ - public static void updatesASQLServerInstanceTags( - com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { - SqlServerInstance resource = - azureArcDataManager - .sqlServerInstances() - .getByResourceGroupWithResponse("testrg", "testsqlServerInstance", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("mytag", "myval")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -}