From 7cce84319277415f336a09866b4429128af121a5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 7 Apr 2022 17:33:09 +0000 Subject: [PATCH] CodeGen from PR 18588 in Azure/azure-rest-api-specs Merge a0bb50ed086a5a14e0999a579475e7ab056104f0 into e7d2d8c48cf6f8f63de7e252c467930449b5fd88 --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 385 ++++- .../pom.xml | 2 +- .../azurearcdata/AzureArcDataManager.java | 88 +- .../ActiveDirectoryConnectorsClient.java | 215 +++ .../fluent/AzureArcDataManagementClient.java | 14 + .../fluent/DataControllersClient.java | 52 +- .../azurearcdata/fluent/OperationsClient.java | 6 +- .../fluent/PostgresInstancesClient.java | 238 +++ .../fluent/SqlManagedInstancesClient.java | 48 +- .../fluent/SqlServerInstancesClient.java | 48 +- ...ActiveDirectoryConnectorResourceInner.java | 59 + .../models/DataControllerResourceInner.java | 12 +- .../fluent/models/OperationInner.java | 9 +- .../fluent/models/PostgresInstanceInner.java | 151 ++ .../models/SqlManagedInstanceInner.java | 23 +- .../fluent/models/SqlServerInstanceInner.java | 9 +- .../ActiveDirectoryConnectorResourceImpl.java | 117 ++ .../ActiveDirectoryConnectorsClientImpl.java | 1210 ++++++++++++++ .../ActiveDirectoryConnectorsImpl.java | 214 +++ .../AzureArcDataManagementClientBuilder.java | 37 +- .../AzureArcDataManagementClientImpl.java | 36 +- .../DataControllerResourceImpl.java | 9 +- .../DataControllersClientImpl.java | 166 +- .../implementation/DataControllersImpl.java | 19 +- .../implementation/OperationsClientImpl.java | 27 +- .../implementation/OperationsImpl.java | 3 +- .../implementation/PostgresInstanceImpl.java | 213 +++ .../PostgresInstancesClientImpl.java | 1448 +++++++++++++++++ .../implementation/PostgresInstancesImpl.java | 179 ++ .../SqlManagedInstanceImpl.java | 5 - .../SqlManagedInstancesClientImpl.java | 156 +- .../SqlManagedInstancesImpl.java | 19 +- .../SqlServerInstancesClientImpl.java | 156 +- .../SqlServerInstancesImpl.java | 19 +- .../models/AccountProvisioningMode.java | 34 + .../ActiveDirectoryConnectorDnsDetails.java | 140 ++ ...ActiveDirectoryConnectorDomainDetails.java | 175 ++ .../ActiveDirectoryConnectorListResult.java | 55 + .../ActiveDirectoryConnectorProperties.java | 133 ++ .../ActiveDirectoryConnectorResource.java | 115 ++ .../models/ActiveDirectoryConnectorSpec.java | 91 ++ .../ActiveDirectoryConnectorStatus.java | 140 ++ .../models/ActiveDirectoryConnectors.java | 145 ++ .../ActiveDirectoryDomainController.java | 55 + .../ActiveDirectoryDomainControllers.java | 81 + .../models/ActiveDirectoryInformation.java | 52 + .../ArcSqlManagedInstanceLicenseType.java | 44 +- .../models/BasicLoginInformation.java | 4 - .../azurearcdata/models/CommonSku.java | 170 ++ .../azurearcdata/models/ConnectionStatus.java | 3 + .../models/DataControllerProperties.java | 84 +- .../models/DataControllerResource.java | 14 +- .../models/DataControllerUpdate.java | 33 +- .../azurearcdata/models/DataControllers.java | 22 +- .../azurearcdata/models/ExtendedLocation.java | 4 - .../azurearcdata/models/HostType.java | 43 + .../models/K8SResourceRequirements.java | 3 - .../azurearcdata/models/K8SScheduling.java | 3 - .../models/K8SSchedulingOptions.java | 3 - .../models/KeytabInformation.java | 46 + .../models/LogAnalyticsWorkspaceConfig.java | 4 - .../azurearcdata/models/ODataError.java | 133 -- .../models/OnPremiseProperty.java | 9 +- .../azurearcdata/models/OperationDisplay.java | 13 +- .../models/OperationListResult.java | 4 - .../azurearcdata/models/Operations.java | 6 +- .../models/PageOfDataControllerResource.java | 12 +- .../azurearcdata/models/PostgresInstance.java | 263 +++ .../models/PostgresInstanceListResult.java | 55 + .../models/PostgresInstanceProperties.java | 170 ++ .../models/PostgresInstanceSku.java | 86 + .../models/PostgresInstanceSkuTier.java | 44 + .../models/PostgresInstanceUpdate.java | 78 + .../models/PostgresInstances.java | 156 ++ .../models/SqlManagedInstance.java | 8 - .../models/SqlManagedInstanceK8SRaw.java | 3 - .../models/SqlManagedInstanceK8SSpec.java | 3 - .../models/SqlManagedInstanceListResult.java | 4 - .../models/SqlManagedInstanceProperties.java | 38 +- .../models/SqlManagedInstanceSku.java | 18 +- .../models/SqlManagedInstanceUpdate.java | 4 - .../models/SqlManagedInstances.java | 18 +- .../models/SqlServerInstance.java | 2 +- .../models/SqlServerInstanceListResult.java | 4 - .../models/SqlServerInstanceProperties.java | 39 +- .../models/SqlServerInstanceUpdate.java | 4 - .../models/SqlServerInstances.java | 18 +- .../azurearcdata/models/SqlVersion.java | 20 +- .../models/UploadServicePrincipal.java | 4 - .../azurearcdata/models/UploadWatermark.java | 4 - ...ctiveDirectoryConnectorsCreateSamples.java | 58 + ...ctiveDirectoryConnectorsDeleteSamples.java | 23 + .../ActiveDirectoryConnectorsGetSamples.java | 25 + .../ActiveDirectoryConnectorsListSamples.java | 23 + .../DataControllersDeleteSamples.java | 2 +- ...aControllersGetByResourceGroupSamples.java | 2 +- ...ControllersListByResourceGroupSamples.java | 2 +- .../generated/DataControllersListSamples.java | 2 +- ...ControllersPatchDataControllerSamples.java | 2 +- ...taControllersPutDataControllerSamples.java | 6 +- .../generated/OperationsListSamples.java | 2 +- .../PostgresInstancesCreateSamples.java | 59 + .../PostgresInstancesDeleteSamples.java | 22 + ...resInstancesGetByResourceGroupSamples.java | 22 + ...esInstancesListByResourceGroupSamples.java | 23 + .../PostgresInstancesListSamples.java | 23 + .../PostgresInstancesUpdateSamples.java | 42 + .../SqlManagedInstancesCreateSamples.java | 7 +- .../SqlManagedInstancesDeleteSamples.java | 2 +- ...gedInstancesGetByResourceGroupSamples.java | 2 +- ...edInstancesListByResourceGroupSamples.java | 2 +- .../SqlManagedInstancesListSamples.java | 2 +- .../SqlManagedInstancesUpdateSamples.java | 2 +- .../SqlServerInstancesCreateSamples.java | 14 +- .../SqlServerInstancesDeleteSamples.java | 2 +- ...verInstancesGetByResourceGroupSamples.java | 2 +- ...erInstancesListByResourceGroupSamples.java | 2 +- .../SqlServerInstancesListSamples.java | 2 +- .../SqlServerInstancesUpdateSamples.java | 2 +- 121 files changed, 7890 insertions(+), 805 deletions(-) create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/ActiveDirectoryConnectorsClient.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/PostgresInstancesClient.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/ActiveDirectoryConnectorResourceInner.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/PostgresInstanceInner.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorResourceImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsClientImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstanceImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesClientImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/AccountProvisioningMode.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDnsDetails.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDomainDetails.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorListResult.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorProperties.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorResource.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorSpec.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorStatus.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectors.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainController.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainControllers.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryInformation.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/CommonSku.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/HostType.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/KeytabInformation.java delete mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ODataError.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstance.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceListResult.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceProperties.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSku.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSkuTier.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceUpdate.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstances.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsCreateSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsDeleteSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsGetSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsListSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesCreateSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesDeleteSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesGetByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesUpdateSamples.java diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md index ff68a17703069..27c69bf26191d 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-04-07) + +- 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-preview-2022-03. 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/azurearcdata/azure-resourcemanager-azurearcdata/README.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md index 05139906ee43c..0d9cdb26f7fce 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md @@ -2,7 +2,7 @@ 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). +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-preview-2022-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-azurearcdata - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md index c3d5163fe497b..ed57db483a62d 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md @@ -1,6 +1,13 @@ # Code snippets and samples +## ActiveDirectoryConnectors + +- [Create](#activedirectoryconnectors_create) +- [Delete](#activedirectoryconnectors_delete) +- [Get](#activedirectoryconnectors_get) +- [List](#activedirectoryconnectors_list) + ## DataControllers - [Delete](#datacontrollers_delete) @@ -14,6 +21,15 @@ - [List](#operations_list) +## PostgresInstances + +- [Create](#postgresinstances_create) +- [Delete](#postgresinstances_delete) +- [GetByResourceGroup](#postgresinstances_getbyresourcegroup) +- [List](#postgresinstances_list) +- [ListByResourceGroup](#postgresinstances_listbyresourcegroup) +- [Update](#postgresinstances_update) + ## SqlManagedInstances - [Create](#sqlmanagedinstances_create) @@ -31,6 +47,131 @@ - [List](#sqlserverinstances_list) - [ListByResourceGroup](#sqlserverinstances_listbyresourcegroup) - [Update](#sqlserverinstances_update) +### ActiveDirectoryConnectors_Create + +```java +import com.azure.resourcemanager.azurearcdata.models.AccountProvisioningMode; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorDnsDetails; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorDomainDetails; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorProperties; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorSpec; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryDomainController; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryDomainControllers; +import java.util.Arrays; + +/** Samples for ActiveDirectoryConnectors Create. */ +public final class ActiveDirectoryConnectorsCreateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateActiveDirectoryConnector.json + */ + /** + * Sample code: Create or update an Active Directory connector instance. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void createOrUpdateAnActiveDirectoryConnectorInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager + .activeDirectoryConnectors() + .define("testADConnector") + .withExistingDataController("testrg", "testdataController") + .withProperties( + new ActiveDirectoryConnectorProperties() + .withSpec( + new ActiveDirectoryConnectorSpec() + .withActiveDirectory( + new ActiveDirectoryConnectorDomainDetails() + .withRealm("CONTOSO.LOCAL") + .withServiceAccountProvisioning(AccountProvisioningMode.MANUAL) + .withDomainControllers( + new ActiveDirectoryDomainControllers() + .withPrimaryDomainController( + new ActiveDirectoryDomainController().withHostname("dc1.contoso.local")) + .withSecondaryDomainControllers( + Arrays + .asList( + new ActiveDirectoryDomainController() + .withHostname("dc2.contoso.local"), + new ActiveDirectoryDomainController() + .withHostname("dc3.contoso.local"))))) + .withDns( + new ActiveDirectoryConnectorDnsDetails() + .withNameserverIpAddresses(Arrays.asList("11.11.111.111", "22.22.222.222")) + .withReplicas(1L) + .withPreferK8SDnsForPtrLookups(false)))) + .create(); + } +} +``` + +### ActiveDirectoryConnectors_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ActiveDirectoryConnectors Delete. */ +public final class ActiveDirectoryConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteActiveDirectoryConnector.json + */ + /** + * Sample code: Deletes an Active Directory connector instance. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void deletesAnActiveDirectoryConnectorInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.activeDirectoryConnectors().delete("testrg", "testdataController", "testADConnector", Context.NONE); + } +} +``` + +### ActiveDirectoryConnectors_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ActiveDirectoryConnectors Get. */ +public final class ActiveDirectoryConnectorsGetSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetActiveDirectoryConnector.json + */ + /** + * Sample code: Retrieves an Active Directory connector resource. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void retrievesAnActiveDirectoryConnectorResource( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager + .activeDirectoryConnectors() + .getWithResponse("testrg", "testdataController", "testADConnector", Context.NONE); + } +} +``` + +### ActiveDirectoryConnectors_List + +```java +import com.azure.core.util.Context; + +/** Samples for ActiveDirectoryConnectors List. */ +public final class ActiveDirectoryConnectorsListSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByDataControllerActiveDirectoryConnector.json + */ + /** + * Sample code: Gets all Active Directory connectors associated with a data controller. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllActiveDirectoryConnectorsAssociatedWithADataController( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.activeDirectoryConnectors().list("testrg", "testdataController", Context.NONE); + } +} +``` + ### DataControllers_Delete ```java @@ -39,7 +180,7 @@ import com.azure.core.util.Context; /** Samples for DataControllers Delete. */ public final class DataControllersDeleteSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/DeleteDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteDataController.json */ /** * Sample code: Delete a dataController. @@ -60,7 +201,7 @@ import com.azure.core.util.Context; /** Samples for DataControllers GetByResourceGroup. */ public final class DataControllersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/GetDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetDataController.json */ /** * Sample code: Get a data controller. @@ -81,7 +222,7 @@ import com.azure.core.util.Context; /** Samples for DataControllers List. */ public final class DataControllersListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListSubscriptionDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionDataController.json */ /** * Sample code: Gets all dataControllers in a subscription. @@ -103,7 +244,7 @@ import com.azure.core.util.Context; /** Samples for DataControllers ListByResourceGroup. */ public final class DataControllersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListByResourceGroupDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupDataController.json */ /** * Sample code: Gets all dataControllers in a resource group. @@ -128,7 +269,7 @@ import java.util.Map; /** Samples for DataControllers PatchDataController. */ public final class DataControllersPatchDataControllerSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/UpdateDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateDataController.json */ /** * Sample code: Updates a dataController tags. @@ -177,7 +318,7 @@ import java.util.UUID; /** Samples for DataControllers PutDataController. */ public final class DataControllersPutDataControllerSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/CreateOrUpdateDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateDataController.json */ /** * Sample code: Create or update a Data Controller. @@ -205,6 +346,10 @@ public final class DataControllersPutDataControllerSamples { .withUsages(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z"))) .withBasicLoginInformation( new BasicLoginInformation().withUsername("username").withPassword("********")) + .withMetricsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("********")) + .withLogsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("********")) .withLogAnalyticsWorkspaceConfig( new LogAnalyticsWorkspaceConfig() .withWorkspaceId(UUID.fromString("00000000-1111-2222-3333-444444444444")) @@ -249,7 +394,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListOperation.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListOperation.json */ /** * Sample code: Lists all of the available Azure Data Services on Azure Arc API operations. @@ -263,9 +408,195 @@ public final class OperationsListSamples { } ``` +### PostgresInstances_Create + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +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.PostgresInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceSku; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceSkuTier; +import java.io.IOException; + +/** Samples for PostgresInstances Create. */ +public final class PostgresInstancesCreateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdatePostgresInstance.json + */ + /** + * Sample code: Create or update a Postgres Instance. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void createOrUpdateAPostgresInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) throws IOException { + manager + .postgresInstances() + .define("testpostgresInstance") + .withRegion("eastus") + .withExistingResourceGroup("testrg") + .withProperties( + new PostgresInstanceProperties() + .withDataControllerId("dataControllerId") + .withAdmin("admin") + .withBasicLoginInformation( + new BasicLoginInformation().withUsername("username").withPassword("********")) + .withK8SRaw( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"apiVersion\":\"apiVersion\",\"kind\":\"postgresql-12\",\"metadata\":{\"name\":\"pg1\",\"creationTimestamp\":\"2020-08-25T14:55:10Z\",\"generation\":1,\"namespace\":\"test\",\"resourceVersion\":\"527780\",\"selfLink\":\"/apis/arcdata.microsoft.com/v1alpha1/namespaces/test/postgresql-12s/pg1\",\"uid\":\"1111aaaa-ffff-ffff-ffff-99999aaaaaaa\"},\"spec\":{\"backups\":{\"deltaMinutes\":3,\"fullMinutes\":10,\"tiers\":[{\"retention\":{\"maximums\":[\"6\",\"512MB\"],\"minimums\":[\"3\"]},\"storage\":{\"volumeSize\":\"1Gi\"}}]},\"engine\":{\"extensions\":[{\"name\":\"citus\"}]},\"scale\":{\"shards\":3},\"scheduling\":{\"default\":{\"resources\":{\"requests\":{\"memory\":\"256Mi\"}}}},\"service\":{\"type\":\"NodePort\"},\"storage\":{\"data\":{\"className\":\"local-storage\",\"size\":\"5Gi\"},\"logs\":{\"className\":\"local-storage\",\"size\":\"5Gi\"}}},\"status\":{\"externalEndpoint\":null,\"readyPods\":\"4/4\",\"state\":\"Ready\"}}", + Object.class, + SerializerEncoding.JSON))) + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withSku( + new PostgresInstanceSku() + .withName("default") + .withDev(true) + .withTier(PostgresInstanceSkuTier.HYPERSCALE)) + .create(); + } +} +``` + +### PostgresInstances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PostgresInstances Delete. */ +public final class PostgresInstancesDeleteSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeletePostgresInstance.json + */ + /** + * Sample code: Deletes a PostgresInstances. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void deletesAPostgresInstances(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().delete("testrg", "testpostgresInstance", Context.NONE); + } +} +``` + +### PostgresInstances_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PostgresInstances GetByResourceGroup. */ +public final class PostgresInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetPostgresInstance.json + */ + /** + * Sample code: Gets a postgres Instances. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAPostgresInstances(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().getByResourceGroupWithResponse("testrg", "testpostgresInstances", Context.NONE); + } +} +``` + +### PostgresInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for PostgresInstances List. */ +public final class PostgresInstancesListSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionPostgresInstance.json + */ + /** + * Sample code: Gets all Postgres Instance in a subscription. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllPostgresInstanceInASubscription( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().list(Context.NONE); + } +} +``` + +### PostgresInstances_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PostgresInstances ListByResourceGroup. */ +public final class PostgresInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupPostgresInstance.json + */ + /** + * Sample code: Gets all postgres Instances in a resource group. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllPostgresInstancesInAResourceGroup( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().listByResourceGroup("testrg", Context.NONE); + } +} +``` + +### PostgresInstances_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PostgresInstances Update. */ +public final class PostgresInstancesUpdateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdatePostgresInstance.json + */ + /** + * Sample code: Updates a postgres Instances tags. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void updatesAPostgresInstancesTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + PostgresInstance resource = + manager + .postgresInstances() + .getByResourceGroupWithResponse("testrg", "testpostgresInstance", 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; + } +} +``` + ### SqlManagedInstances_Create ```java +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryInformation; import com.azure.resourcemanager.azurearcdata.models.ArcSqlManagedInstanceLicenseType; import com.azure.resourcemanager.azurearcdata.models.BasicLoginInformation; import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; @@ -273,6 +604,7 @@ 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.KeytabInformation; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SRaw; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SSpec; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceProperties; @@ -284,7 +616,7 @@ import java.util.Map; /** Samples for SqlManagedInstances Create. */ public final class SqlManagedInstancesCreateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/CreateOrUpdateSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateSqlManagedInstance.json */ /** * Sample code: Create or update a SQL Managed Instance. @@ -337,6 +669,9 @@ public final class SqlManagedInstancesCreateSamples { .withAdditionalProperties(mapOf("additionalProperty", 1234))) .withBasicLoginInformation( new BasicLoginInformation().withUsername("username").withPassword("********")) + .withActiveDirectoryInformation( + new ActiveDirectoryInformation() + .withKeytabInformation(new KeytabInformation().withKeytab("********"))) .withLicenseType(ArcSqlManagedInstanceLicenseType.LICENSE_INCLUDED) .withClusterId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") @@ -373,7 +708,7 @@ import com.azure.core.util.Context; /** Samples for SqlManagedInstances Delete. */ public final class SqlManagedInstancesDeleteSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/DeleteSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteSqlManagedInstance.json */ /** * Sample code: Delete a SQL Instance. @@ -394,7 +729,7 @@ import com.azure.core.util.Context; /** Samples for SqlManagedInstances GetByResourceGroup. */ public final class SqlManagedInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/GetSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetSqlManagedInstance.json */ /** * Sample code: Updates a SQL Instance tags. @@ -415,7 +750,7 @@ import com.azure.core.util.Context; /** Samples for SqlManagedInstances List. */ public final class SqlManagedInstancesListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListSubscriptionSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionSqlManagedInstance.json */ /** * Sample code: Gets all SQL Instance in a subscription. @@ -437,7 +772,7 @@ import com.azure.core.util.Context; /** Samples for SqlManagedInstances ListByResourceGroup. */ public final class SqlManagedInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListByResourceGroupSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupSqlManagedInstance.json */ /** * Sample code: Gets all SQL Instance in a resource group. @@ -462,7 +797,7 @@ import java.util.Map; /** Samples for SqlManagedInstances Update. */ public final class SqlManagedInstancesUpdateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/UpdateSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateSqlManagedInstance.json */ /** * Sample code: Updates a sql Instance tags. @@ -498,6 +833,7 @@ 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.HostType; import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceProperties; import com.azure.resourcemanager.azurearcdata.models.SqlVersion; import java.time.OffsetDateTime; @@ -507,7 +843,7 @@ import java.util.Map; /** Samples for SqlServerInstances Create. */ public final class SqlServerInstancesCreateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/CreateOrUpdateSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. @@ -524,21 +860,22 @@ public final class SqlServerInstancesCreateSamples { .withTags(mapOf("mytag", "myval")) .withProperties( new SqlServerInstanceProperties() - .withVersion(SqlVersion.SQL_SERVER_2017) + .withVersion(SqlVersion.SQL_SERVER_2012) .withEdition(EditionType.DEVELOPER) - .withContainerResourceId("Arc Machine Name") + .withContainerResourceId("Resource id of hosting Arc Machine") .withVCore("4") - .withStatus(ConnectionStatus.CONNECTED) + .withStatus(ConnectionStatus.REGISTERED) .withPatchLevel("patchlevel") .withCollation("collation") - .withCurrentVersion("2008 R2") + .withCurrentVersion("2012") .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)) + .withAzureDefenderStatus(DefenderStatus.PROTECTED) + .withHostType(HostType.PHYSICAL_SERVER)) .create(); } @@ -563,7 +900,7 @@ import com.azure.core.util.Context; /** Samples for SqlServerInstances Delete. */ public final class SqlServerInstancesDeleteSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/DeleteSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteSqlServerInstance.json */ /** * Sample code: Delete a SQL Server Instance. @@ -584,7 +921,7 @@ import com.azure.core.util.Context; /** Samples for SqlServerInstances GetByResourceGroup. */ public final class SqlServerInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/GetSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. @@ -606,7 +943,7 @@ import com.azure.core.util.Context; /** Samples for SqlServerInstances List. */ public final class SqlServerInstancesListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListSubscriptionSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionSqlServerInstance.json */ /** * Sample code: Gets all SQL Server Instance in a subscription. @@ -628,7 +965,7 @@ import com.azure.core.util.Context; /** Samples for SqlServerInstances ListByResourceGroup. */ public final class SqlServerInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListByResourceGroupSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupSqlServerInstance.json */ /** * Sample code: Gets all SQL Server Instance in a resource group. @@ -653,7 +990,7 @@ import java.util.Map; /** Samples for SqlServerInstances Update. */ public final class SqlServerInstancesUpdateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/UpdateSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml index 48f9820944b26..4be1be1a8d4b1 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for AzureArcData Management - This package contains Microsoft Azure SDK for AzureArcData Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. 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. + This package contains Microsoft Azure SDK for AzureArcData Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-preview-2022-03. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/AzureArcDataManager.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/AzureArcDataManager.java index 24cc1eb8a59ee..7f1ef17b93f31 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/AzureArcDataManager.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/AzureArcDataManager.java @@ -8,12 +8,15 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -21,13 +24,17 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.fluent.AzureArcDataManagementClient; +import com.azure.resourcemanager.azurearcdata.implementation.ActiveDirectoryConnectorsImpl; import com.azure.resourcemanager.azurearcdata.implementation.AzureArcDataManagementClientBuilder; import com.azure.resourcemanager.azurearcdata.implementation.DataControllersImpl; import com.azure.resourcemanager.azurearcdata.implementation.OperationsImpl; +import com.azure.resourcemanager.azurearcdata.implementation.PostgresInstancesImpl; import com.azure.resourcemanager.azurearcdata.implementation.SqlManagedInstancesImpl; import com.azure.resourcemanager.azurearcdata.implementation.SqlServerInstancesImpl; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectors; import com.azure.resourcemanager.azurearcdata.models.DataControllers; import com.azure.resourcemanager.azurearcdata.models.Operations; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstances; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstances; import com.azure.resourcemanager.azurearcdata.models.SqlServerInstances; import java.time.Duration; @@ -35,6 +42,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful set of web APIs to manage @@ -49,6 +57,10 @@ public final class AzureArcDataManager { private DataControllers dataControllers; + private ActiveDirectoryConnectors activeDirectoryConnectors; + + private PostgresInstances postgresInstances; + private final AzureArcDataManagementClient clientObject; private AzureArcDataManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -76,6 +88,19 @@ public static AzureArcDataManager authenticate(TokenCredential credential, Azure return configure().authenticate(credential, profile); } + /** + * Creates an instance of AzureArcData service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the AzureArcData service API instance. + */ + public static AzureArcDataManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AzureArcDataManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create AzureArcDataManager with optional configuration. * @@ -87,13 +112,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -154,6 +180,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -161,9 +200,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -185,7 +226,7 @@ public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.azurearcdata") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -203,16 +244,34 @@ public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -256,6 +315,23 @@ public DataControllers dataControllers() { return dataControllers; } + /** @return Resource collection API of ActiveDirectoryConnectors. */ + public ActiveDirectoryConnectors activeDirectoryConnectors() { + if (this.activeDirectoryConnectors == null) { + this.activeDirectoryConnectors = + new ActiveDirectoryConnectorsImpl(clientObject.getActiveDirectoryConnectors(), this); + } + return activeDirectoryConnectors; + } + + /** @return Resource collection API of PostgresInstances. */ + public PostgresInstances postgresInstances() { + if (this.postgresInstances == null) { + this.postgresInstances = new PostgresInstancesImpl(clientObject.getPostgresInstances(), this); + } + return postgresInstances; + } + /** * @return Wrapped service client AzureArcDataManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/ActiveDirectoryConnectorsClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/ActiveDirectoryConnectorsClient.java new file mode 100644 index 0000000000000..4d2f2df3f4fc3 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/ActiveDirectoryConnectorsClient.java @@ -0,0 +1,215 @@ +// 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.fluent; + +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; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurearcdata.fluent.models.ActiveDirectoryConnectorResourceInner; + +/** An instance of this class provides access to all the operations defined in ActiveDirectoryConnectorsClient. */ +public interface ActiveDirectoryConnectorsClient { + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String dataControllerName); + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String dataControllerName, Context context); + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 {@link SyncPoller} for polling of active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ActiveDirectoryConnectorResourceInner> beginCreate( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource); + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 {@link SyncPoller} for polling of active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ActiveDirectoryConnectorResourceInner> beginCreate( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + Context context); + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActiveDirectoryConnectorResourceInner create( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource); + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActiveDirectoryConnectorResourceInner create( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + Context context); + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName); + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context); + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName); + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context); + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActiveDirectoryConnectorResourceInner get( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName); + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/AzureArcDataManagementClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/AzureArcDataManagementClient.java index da11f09fe2a9f..6c1fb44f4cd63 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/AzureArcDataManagementClient.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/AzureArcDataManagementClient.java @@ -71,4 +71,18 @@ public interface AzureArcDataManagementClient { * @return the DataControllersClient object. */ DataControllersClient getDataControllers(); + + /** + * Gets the ActiveDirectoryConnectorsClient object to access its operations. + * + * @return the ActiveDirectoryConnectorsClient object. + */ + ActiveDirectoryConnectorsClient getActiveDirectoryConnectors(); + + /** + * Gets the PostgresInstancesClient object to access its operations. + * + * @return the PostgresInstancesClient object. + */ + PostgresInstancesClient getPostgresInstances(); } 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 d8c03b698926c..65792fe1d4c8b 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 @@ -21,7 +21,7 @@ public interface DataControllersClient { * * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -33,7 +33,7 @@ public interface DataControllersClient { * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -45,7 +45,7 @@ public interface DataControllersClient { * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -58,7 +58,7 @@ public interface DataControllersClient { * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -67,14 +67,14 @@ public interface DataControllersClient { * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return the {@link SyncPoller} for polling of data controller resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataControllerResourceInner> beginPutDataController( String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource); @@ -82,15 +82,15 @@ SyncPoller, DataControllerResourceInner> * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return the {@link SyncPoller} for polling of data controller resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataControllerResourceInner> beginPutDataController( String resourceGroupName, String dataControllerName, @@ -101,7 +101,7 @@ SyncPoller, DataControllerResourceInner> * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -116,7 +116,7 @@ DataControllerResourceInner putDataController( * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -135,27 +135,27 @@ DataControllerResourceInner putDataController( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) 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 dataControllerName The name of the data controller. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String dataControllerName, Context context); @@ -163,7 +163,7 @@ SyncPoller, Void> beginDelete( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -175,7 +175,7 @@ SyncPoller, Void> beginDelete( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -188,7 +188,7 @@ SyncPoller, Void> beginDelete( * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -201,12 +201,12 @@ SyncPoller, Void> beginDelete( * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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 data controller resource. + * @return data controller resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -216,7 +216,7 @@ Response getByResourceGroupWithResponse( * Updates a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource The update data controller resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -231,13 +231,13 @@ DataControllerResourceInner patchDataController( * Updates a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource The update data controller resource. * @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 data controller resource. + * @return data controller resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response patchDataControllerWithResponse( diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/OperationsClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/OperationsClient.java index 41bea71529e20..532d935f22057 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/OperationsClient.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/OperationsClient.java @@ -17,7 +17,8 @@ public interface OperationsClient { * * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +30,8 @@ public interface OperationsClient { * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/PostgresInstancesClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/PostgresInstancesClient.java new file mode 100644 index 0000000000000..0f3e21a1e4e69 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/PostgresInstancesClient.java @@ -0,0 +1,238 @@ +// 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.fluent; + +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; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurearcdata.fluent.models.PostgresInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceUpdate; + +/** An instance of this class provides access to all the operations defined in PostgresInstancesClient. */ +public interface PostgresInstancesClient { + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PostgresInstanceInner getByResourceGroup(String resourceGroupName, String postgresInstanceName); + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String postgresInstanceName, Context context); + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 {@link SyncPoller} for polling of a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PostgresInstanceInner> beginCreate( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource); + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 {@link SyncPoller} for polling of a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PostgresInstanceInner> beginCreate( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource, Context context); + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PostgresInstanceInner create(String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource); + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PostgresInstanceInner create( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource, Context context); + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String postgresInstanceName); + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String postgresInstanceName, Context context); + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String postgresInstanceName); + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String postgresInstanceName, Context context); + + /** + * Updates a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param parameters The Postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PostgresInstanceInner update( + String resourceGroupName, String postgresInstanceName, PostgresInstanceUpdate parameters); + + /** + * Updates a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param parameters The Postgres 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 a Postgres Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String postgresInstanceName, PostgresInstanceUpdate parameters, Context context); +} 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 6cb84258c3bb0..ab55b20c5b6ac 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 @@ -21,7 +21,7 @@ public interface SqlManagedInstancesClient { * * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -33,7 +33,7 @@ public interface SqlManagedInstancesClient { * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -45,7 +45,7 @@ public interface SqlManagedInstancesClient { * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -58,7 +58,7 @@ public interface SqlManagedInstancesClient { * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -85,7 +85,7 @@ public interface SqlManagedInstancesClient { * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -95,14 +95,14 @@ Response getByResourceGroupWithResponse( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return the {@link SyncPoller} for polling of a SqlManagedInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SqlManagedInstanceInner> beginCreate( String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance); @@ -110,15 +110,15 @@ SyncPoller, SqlManagedInstanceInner> beginCr * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return the {@link SyncPoller} for polling of a SqlManagedInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SqlManagedInstanceInner> beginCreate( String resourceGroupName, String sqlManagedInstanceName, @@ -129,7 +129,7 @@ SyncPoller, SqlManagedInstanceInner> beginCr * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -144,7 +144,7 @@ SqlManagedInstanceInner create( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -163,27 +163,27 @@ SqlManagedInstanceInner create( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) 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 sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String sqlManagedInstanceName, Context context); @@ -191,7 +191,7 @@ SyncPoller, Void> beginDelete( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. @@ -203,7 +203,7 @@ SyncPoller, Void> beginDelete( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. @@ -216,7 +216,7 @@ SyncPoller, Void> beginDelete( * Updates a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param parameters The SQL Managed Instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -231,13 +231,13 @@ SqlManagedInstanceInner update( * Updates a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param parameters The SQL Managed 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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( 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 6e362cf1ec4a0..5a7466268a51c 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 @@ -21,7 +21,7 @@ public interface SqlServerInstancesClient { * * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -33,7 +33,7 @@ public interface SqlServerInstancesClient { * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -45,7 +45,7 @@ public interface SqlServerInstancesClient { * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -58,7 +58,7 @@ public interface SqlServerInstancesClient { * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -85,7 +85,7 @@ public interface SqlServerInstancesClient { * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -95,14 +95,14 @@ Response getByResourceGroupWithResponse( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return the {@link SyncPoller} for polling of a SqlServerInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SqlServerInstanceInner> beginCreate( String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance); @@ -110,15 +110,15 @@ SyncPoller, SqlServerInstanceInner> beginCrea * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return the {@link SyncPoller} for polling of a SqlServerInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SqlServerInstanceInner> beginCreate( String resourceGroupName, String sqlServerInstanceName, @@ -129,7 +129,7 @@ SyncPoller, SqlServerInstanceInner> beginCrea * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -144,7 +144,7 @@ SqlServerInstanceInner create( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -163,27 +163,27 @@ SqlServerInstanceInner create( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) 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 sqlServerInstanceName 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String sqlServerInstanceName, Context context); @@ -191,7 +191,7 @@ SyncPoller, Void> beginDelete( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. @@ -203,7 +203,7 @@ SyncPoller, Void> beginDelete( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. @@ -216,7 +216,7 @@ SyncPoller, Void> beginDelete( * Updates a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName Name of sqlServerInstance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param parameters The 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. @@ -231,13 +231,13 @@ SqlServerInstanceInner update( * Updates a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName Name of sqlServerInstance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param parameters The 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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/ActiveDirectoryConnectorResourceInner.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/ActiveDirectoryConnectorResourceInner.java new file mode 100644 index 0000000000000..8f13ea908c09a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/ActiveDirectoryConnectorResourceInner.java @@ -0,0 +1,59 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Active directory connector resource. */ +@Fluent +public final class ActiveDirectoryConnectorResourceInner extends ProxyResource { + /* + * null + */ + @JsonProperty(value = "properties", required = true) + private ActiveDirectoryConnectorProperties properties; + + /** + * Get the properties property: null. + * + * @return the properties value. + */ + public ActiveDirectoryConnectorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: null. + * + * @param properties the properties value to set. + * @return the ActiveDirectoryConnectorResourceInner object itself. + */ + public ActiveDirectoryConnectorResourceInner withProperties(ActiveDirectoryConnectorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model ActiveDirectoryConnectorResourceInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryConnectorResourceInner.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/DataControllerResourceInner.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/DataControllerResourceInner.java index e3519feb731f6..861d6c31d79fe 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/DataControllerResourceInner.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/DataControllerResourceInner.java @@ -10,15 +10,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.models.DataControllerProperties; import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Data controller resource. */ @Fluent public final class DataControllerResourceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataControllerResourceInner.class); - /* * The extendedLocation of the resource. */ @@ -32,7 +29,8 @@ public final class DataControllerResourceInner extends Resource { private DataControllerProperties properties; /* - * Read only system data + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -78,7 +76,7 @@ public DataControllerResourceInner withProperties(DataControllerProperties prope } /** - * Get the systemData property: Read only system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -110,7 +108,7 @@ public void validate() { extendedLocation().validate(); } if (properties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property properties in model DataControllerResourceInner")); @@ -118,4 +116,6 @@ public void validate() { properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataControllerResourceInner.class); } 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 b57633882bc60..bb9c0089c34d6 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 @@ -8,7 +8,6 @@ import com.azure.core.util.logging.ClientLogger; 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; @@ -16,8 +15,6 @@ /** Azure Data Services on Azure Arc operation definition. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * The name of the operation being performed on this particular object. */ @@ -135,16 +132,18 @@ public Map properties() { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model OperationInner")); } if (display() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property display in model OperationInner")); } else { display().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(OperationInner.class); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/PostgresInstanceInner.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/PostgresInstanceInner.java new file mode 100644 index 0000000000000..e08979ed02330 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/PostgresInstanceInner.java @@ -0,0 +1,151 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A Postgres Instance. */ +@Fluent +public final class PostgresInstanceInner extends Resource { + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * null + */ + @JsonProperty(value = "properties", required = true) + private PostgresInstanceProperties properties; + + /* + * Resource sku. + */ + @JsonProperty(value = "sku") + private PostgresInstanceSku sku; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the PostgresInstanceInner object itself. + */ + public PostgresInstanceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the properties property: null. + * + * @return the properties value. + */ + public PostgresInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: null. + * + * @param properties the properties value to set. + * @return the PostgresInstanceInner object itself. + */ + public PostgresInstanceInner withProperties(PostgresInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Resource sku. + * + * @return the sku value. + */ + public PostgresInstanceSku sku() { + return this.sku; + } + + /** + * Set the sku property: Resource sku. + * + * @param sku the sku value to set. + * @return the PostgresInstanceInner object itself. + */ + public PostgresInstanceInner withSku(PostgresInstanceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public PostgresInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgresInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model PostgresInstanceInner")); + } else { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PostgresInstanceInner.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlManagedInstanceInner.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlManagedInstanceInner.java index 4a4b565009b30..36116af3e4f51 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlManagedInstanceInner.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlManagedInstanceInner.java @@ -6,20 +6,16 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceProperties; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceSku; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** A SqlManagedInstance. */ @Fluent public final class SqlManagedInstanceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceInner.class); - /* * null */ @@ -38,12 +34,6 @@ public final class SqlManagedInstanceInner extends Resource { @JsonProperty(value = "sku") private SqlManagedInstanceSku sku; - /* - * Read only system data - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /** * Get the properties property: null. * @@ -104,15 +94,6 @@ public SqlManagedInstanceInner withSku(SqlManagedInstanceSku sku) { return this; } - /** - * Get the systemData property: Read only system data. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - /** {@inheritDoc} */ @Override public SqlManagedInstanceInner withLocation(String location) { @@ -134,7 +115,7 @@ public SqlManagedInstanceInner withTags(Map tags) { */ public void validate() { if (properties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property properties in model SqlManagedInstanceInner")); @@ -148,4 +129,6 @@ public void validate() { sku().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(SqlManagedInstanceInner.class); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerInstanceInner.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerInstanceInner.java index 81543824dc99d..afce48f8bdbc3 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerInstanceInner.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerInstanceInner.java @@ -7,17 +7,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** A SqlServerInstance. */ @Fluent public final class SqlServerInstanceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerInstanceInner.class); - /* * null */ @@ -25,7 +21,8 @@ public final class SqlServerInstanceInner extends Resource { private SqlServerInstanceProperties properties; /* - * Read only system data + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -51,7 +48,7 @@ public SqlServerInstanceInner withProperties(SqlServerInstanceProperties propert } /** - * Get the systemData property: Read only system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorResourceImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorResourceImpl.java new file mode 100644 index 0000000000000..b926119fa898f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorResourceImpl.java @@ -0,0 +1,117 @@ +// 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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.fluent.models.ActiveDirectoryConnectorResourceInner; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorProperties; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorResource; + +public final class ActiveDirectoryConnectorResourceImpl + implements ActiveDirectoryConnectorResource, ActiveDirectoryConnectorResource.Definition { + private ActiveDirectoryConnectorResourceInner innerObject; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + ActiveDirectoryConnectorResourceImpl( + ActiveDirectoryConnectorResourceInner innerObject, + com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ActiveDirectoryConnectorProperties properties() { + return this.innerModel().properties(); + } + + public ActiveDirectoryConnectorResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataControllerName; + + private String activeDirectoryConnectorName; + + public ActiveDirectoryConnectorResourceImpl withExistingDataController( + String resourceGroupName, String dataControllerName) { + this.resourceGroupName = resourceGroupName; + this.dataControllerName = dataControllerName; + return this; + } + + public ActiveDirectoryConnectorResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getActiveDirectoryConnectors() + .create( + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + this.innerModel(), + Context.NONE); + return this; + } + + public ActiveDirectoryConnectorResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getActiveDirectoryConnectors() + .create( + resourceGroupName, dataControllerName, activeDirectoryConnectorName, this.innerModel(), context); + return this; + } + + ActiveDirectoryConnectorResourceImpl( + String name, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = new ActiveDirectoryConnectorResourceInner(); + this.serviceManager = serviceManager; + this.activeDirectoryConnectorName = name; + } + + public ActiveDirectoryConnectorResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getActiveDirectoryConnectors() + .getWithResponse(resourceGroupName, dataControllerName, activeDirectoryConnectorName, Context.NONE) + .getValue(); + return this; + } + + public ActiveDirectoryConnectorResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getActiveDirectoryConnectors() + .getWithResponse(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context) + .getValue(); + return this; + } + + public ActiveDirectoryConnectorResourceImpl withProperties(ActiveDirectoryConnectorProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsClientImpl.java new file mode 100644 index 0000000000000..6d0ce57e8b8b3 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsClientImpl.java @@ -0,0 +1,1210 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +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; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurearcdata.fluent.ActiveDirectoryConnectorsClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.ActiveDirectoryConnectorResourceInner; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ActiveDirectoryConnectorsClient. */ +public final class ActiveDirectoryConnectorsClientImpl implements ActiveDirectoryConnectorsClient { + /** The proxy service used to perform REST calls. */ + private final ActiveDirectoryConnectorsService service; + + /** The service client containing this operation class. */ + private final AzureArcDataManagementClientImpl client; + + /** + * Initializes an instance of ActiveDirectoryConnectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ActiveDirectoryConnectorsClientImpl(AzureArcDataManagementClientImpl client) { + this.service = + RestProxy + .create( + ActiveDirectoryConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureArcDataManagementClientActiveDirectoryConnectors to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureArcDataManageme") + private interface ActiveDirectoryConnectorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}/activeDirectoryConnectors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataControllerName") String dataControllerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataControllerName") String dataControllerName, + @PathParam("activeDirectoryConnectorName") String activeDirectoryConnectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataControllerName") String dataControllerName, + @PathParam("activeDirectoryConnectorName") String activeDirectoryConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataControllerName") String dataControllerName, + @PathParam("activeDirectoryConnectorName") String activeDirectoryConnectorName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String dataControllerName) { + 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + 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())); + } + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String dataControllerName, 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String dataControllerName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, dataControllerName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String dataControllerName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, dataControllerName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String dataControllerName) { + return new PagedIterable<>(listAsync(resourceGroupName, dataControllerName)); + } + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String dataControllerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, dataControllerName, context)); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource) { + 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + if (activeDirectoryConnectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorName is required and cannot be null.")); + } + if (activeDirectoryConnectorResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorResource is required and cannot be null.")); + } else { + activeDirectoryConnectorResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + this.client.getApiVersion(), + activeDirectoryConnectorResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + if (activeDirectoryConnectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorName is required and cannot be null.")); + } + if (activeDirectoryConnectorResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorResource is required and cannot be null.")); + } else { + activeDirectoryConnectorResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + this.client.getApiVersion(), + activeDirectoryConnectorResource, + accept, + context); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 {@link PollerFlux} for polling of active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ActiveDirectoryConnectorResourceInner> + beginCreateAsync( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, dataControllerName, activeDirectoryConnectorName, activeDirectoryConnectorResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ActiveDirectoryConnectorResourceInner.class, + ActiveDirectoryConnectorResourceInner.class, + this.client.getContext()); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 {@link PollerFlux} for polling of active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ActiveDirectoryConnectorResourceInner> + beginCreateAsync( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + activeDirectoryConnectorResource, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ActiveDirectoryConnectorResourceInner.class, + ActiveDirectoryConnectorResourceInner.class, + context); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 {@link SyncPoller} for polling of active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ActiveDirectoryConnectorResourceInner> + beginCreate( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource) { + return beginCreateAsync( + resourceGroupName, dataControllerName, activeDirectoryConnectorName, activeDirectoryConnectorResource) + .getSyncPoller(); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 {@link SyncPoller} for polling of active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ActiveDirectoryConnectorResourceInner> + beginCreate( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + Context context) { + return beginCreateAsync( + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + activeDirectoryConnectorResource, + context) + .getSyncPoller(); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource) { + return beginCreateAsync( + resourceGroupName, dataControllerName, activeDirectoryConnectorName, activeDirectoryConnectorResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + Context context) { + return beginCreateAsync( + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + activeDirectoryConnectorResource, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveDirectoryConnectorResourceInner create( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource) { + return createAsync( + resourceGroupName, dataControllerName, activeDirectoryConnectorName, activeDirectoryConnectorResource) + .block(); + } + + /** + * Creates or replaces an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector instance. + * @param activeDirectoryConnectorResource desc. + * @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 active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveDirectoryConnectorResourceInner create( + String resourceGroupName, + String dataControllerName, + String activeDirectoryConnectorName, + ActiveDirectoryConnectorResourceInner activeDirectoryConnectorResource, + Context context) { + return createAsync( + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + activeDirectoryConnectorResource, + context) + .block(); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + if (activeDirectoryConnectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + if (activeDirectoryConnectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + return beginDeleteAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName).getSyncPoller(); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context) { + return beginDeleteAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context) + .getSyncPoller(); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + return beginDeleteAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context) { + return beginDeleteAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + deleteAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName).block(); + } + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context) { + deleteAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context).block(); + } + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + if (activeDirectoryConnectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, 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 (dataControllerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataControllerName is required and cannot be null.")); + } + if (activeDirectoryConnectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDirectoryConnectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + activeDirectoryConnectorName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + return getWithResponseAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveDirectoryConnectorResourceInner get( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + return getAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName).block(); + } + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context) { + return getWithResponseAsync(resourceGroupName, dataControllerName, activeDirectoryConnectorName, 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 a list of active directory connectors along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 a list of active directory connectors along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + 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 + .listNext(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/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsImpl.java new file mode 100644 index 0000000000000..d626c520835ab --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsImpl.java @@ -0,0 +1,214 @@ +// 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.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; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurearcdata.fluent.ActiveDirectoryConnectorsClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.ActiveDirectoryConnectorResourceInner; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorResource; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectors; + +public final class ActiveDirectoryConnectorsImpl implements ActiveDirectoryConnectors { + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryConnectorsImpl.class); + + private final ActiveDirectoryConnectorsClient innerClient; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public ActiveDirectoryConnectorsImpl( + ActiveDirectoryConnectorsClient innerClient, + com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String dataControllerName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, dataControllerName); + return Utils.mapPage(inner, inner1 -> new ActiveDirectoryConnectorResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String dataControllerName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, dataControllerName, context); + return Utils.mapPage(inner, inner1 -> new ActiveDirectoryConnectorResourceImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + this.serviceClient().delete(resourceGroupName, dataControllerName, activeDirectoryConnectorName); + } + + public void delete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context) { + this.serviceClient().delete(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context); + } + + public ActiveDirectoryConnectorResource get( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName) { + ActiveDirectoryConnectorResourceInner inner = + this.serviceClient().get(resourceGroupName, dataControllerName, activeDirectoryConnectorName); + if (inner != null) { + return new ActiveDirectoryConnectorResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ActiveDirectoryConnectorResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ActiveDirectoryConnectorResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); + if (dataControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'dataControllers'.", id))); + } + String activeDirectoryConnectorName = Utils.getValueFromIdByName(id, "activeDirectoryConnectors"); + if (activeDirectoryConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'activeDirectoryConnectors'.", + id))); + } + return this + .getWithResponse(resourceGroupName, dataControllerName, activeDirectoryConnectorName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); + if (dataControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'dataControllers'.", id))); + } + String activeDirectoryConnectorName = Utils.getValueFromIdByName(id, "activeDirectoryConnectors"); + if (activeDirectoryConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'activeDirectoryConnectors'.", + id))); + } + return this.getWithResponse(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); + if (dataControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'dataControllers'.", id))); + } + String activeDirectoryConnectorName = Utils.getValueFromIdByName(id, "activeDirectoryConnectors"); + if (activeDirectoryConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'activeDirectoryConnectors'.", + id))); + } + this.delete(resourceGroupName, dataControllerName, activeDirectoryConnectorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); + if (dataControllerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'dataControllers'.", id))); + } + String activeDirectoryConnectorName = Utils.getValueFromIdByName(id, "activeDirectoryConnectors"); + if (activeDirectoryConnectorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'activeDirectoryConnectors'.", + id))); + } + this.delete(resourceGroupName, dataControllerName, activeDirectoryConnectorName, context); + } + + private ActiveDirectoryConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + public ActiveDirectoryConnectorResourceImpl define(String name) { + return new ActiveDirectoryConnectorResourceImpl(name, this.manager()); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientBuilder.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientBuilder.java index 142dec68b8efe..8d63eda2415dd 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientBuilder.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public AzureArcDataManagementClientBuilder environment(AzureEnvironment environm } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the AzureArcDataManagementClientBuilder. */ - public AzureArcDataManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public AzureArcDataManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the AzureArcDataManagementClientBuilder. */ - public AzureArcDataManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public AzureArcDataManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,21 +119,21 @@ public AzureArcDataManagementClientBuilder serializerAdapter(SerializerAdapter s * @return an instance of AzureArcDataManagementClientImpl. */ public AzureArcDataManagementClientImpl buildClient() { + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (endpoint == null) { this.endpoint = "https://management.azure.com"; } if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientImpl.java index 257e747d16b19..ffd07d49ca74a 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientImpl.java @@ -21,9 +21,11 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurearcdata.fluent.ActiveDirectoryConnectorsClient; import com.azure.resourcemanager.azurearcdata.fluent.AzureArcDataManagementClient; import com.azure.resourcemanager.azurearcdata.fluent.DataControllersClient; import com.azure.resourcemanager.azurearcdata.fluent.OperationsClient; +import com.azure.resourcemanager.azurearcdata.fluent.PostgresInstancesClient; import com.azure.resourcemanager.azurearcdata.fluent.SqlManagedInstancesClient; import com.azure.resourcemanager.azurearcdata.fluent.SqlServerInstancesClient; import java.io.IOException; @@ -39,8 +41,6 @@ /** Initializes a new instance of the AzureArcDataManagementClientImpl type. */ @ServiceClient(builder = AzureArcDataManagementClientBuilder.class) public final class AzureArcDataManagementClientImpl implements AzureArcDataManagementClient { - private final ClientLogger logger = new ClientLogger(AzureArcDataManagementClientImpl.class); - /** The ID of the Azure subscription. */ private final String subscriptionId; @@ -161,6 +161,30 @@ public DataControllersClient getDataControllers() { return this.dataControllers; } + /** The ActiveDirectoryConnectorsClient object to access its operations. */ + private final ActiveDirectoryConnectorsClient activeDirectoryConnectors; + + /** + * Gets the ActiveDirectoryConnectorsClient object to access its operations. + * + * @return the ActiveDirectoryConnectorsClient object. + */ + public ActiveDirectoryConnectorsClient getActiveDirectoryConnectors() { + return this.activeDirectoryConnectors; + } + + /** The PostgresInstancesClient object to access its operations. */ + private final PostgresInstancesClient postgresInstances; + + /** + * Gets the PostgresInstancesClient object to access its operations. + * + * @return the PostgresInstancesClient object. + */ + public PostgresInstancesClient getPostgresInstances() { + return this.postgresInstances; + } + /** * Initializes an instance of AzureArcDataManagementClient client. * @@ -183,11 +207,13 @@ public DataControllersClient getDataControllers() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-08-01"; + this.apiVersion = "2022-03-01-preview"; this.operations = new OperationsClientImpl(this); this.sqlManagedInstances = new SqlManagedInstancesClientImpl(this); this.sqlServerInstances = new SqlServerInstancesClientImpl(this); this.dataControllers = new DataControllersClientImpl(this); + this.activeDirectoryConnectors = new ActiveDirectoryConnectorsClientImpl(this); + this.postgresInstances = new PostgresInstancesClientImpl(this); } /** @@ -273,7 +299,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -332,4 +358,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureArcDataManagementClientImpl.class); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllerResourceImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllerResourceImpl.java index 03d9e156dc60b..bd6e995b8da9a 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllerResourceImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllerResourceImpl.java @@ -176,8 +176,13 @@ public DataControllerResourceImpl withRegion(String location) { } public DataControllerResourceImpl withProperties(DataControllerProperties properties) { - this.innerModel().withProperties(properties); - return this; + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateDataControllerResource.withProperties(properties); + return this; + } } public DataControllerResourceImpl withTags(Map tags) { 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 05c80f047bebb..816b2e9cc8922 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 @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.azurearcdata.fluent.DataControllersClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in DataControllersClient. */ public final class DataControllersClientImpl implements DataControllersClient { - private final ClientLogger logger = new ClientLogger(DataControllersClientImpl.class); - /** The proxy service used to perform REST calls. */ private final DataControllersService service; @@ -144,7 +141,7 @@ Mono> getByResourceGroup( @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + "/dataControllers/{dataControllerName}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> patchDataController( @HostParam("$host") String endpoint, @@ -182,7 +179,7 @@ Mono> listInGroupNext( * * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -228,7 +225,7 @@ private Mono> listSinglePageAsync() { * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -269,7 +266,7 @@ private Mono> listSinglePageAsync(Con * * @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. + * @return a list of data controllers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -284,7 +281,7 @@ private PagedFlux listAsync() { * @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. + * @return a list of data controllers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -297,7 +294,7 @@ private PagedFlux listAsync(Context context) { * * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -311,7 +308,7 @@ public PagedIterable list() { * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -325,7 +322,7 @@ public PagedIterable list(Context context) { * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -378,7 +375,7 @@ private Mono> listByResourceGroupSing * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -427,7 +424,7 @@ private Mono> listByResourceGroupSing * @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. + * @return a list of data controllers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -444,7 +441,7 @@ private PagedFlux listByResourceGroupAsync(String r * @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. + * @return a list of data controllers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -460,7 +457,7 @@ private PagedFlux listByResourceGroupAsync(String r * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -475,7 +472,7 @@ public PagedIterable listByResourceGroup(String res * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -486,12 +483,12 @@ public PagedIterable listByResourceGroup(String res * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return data controller resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> putDataControllerWithResponseAsync( @@ -544,13 +541,13 @@ private Mono>> putDataControllerWithResponseAsync( * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return data controller resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> putDataControllerWithResponseAsync( @@ -603,14 +600,14 @@ private Mono>> putDataControllerWithResponseAsync( * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return the {@link PollerFlux} for polling of data controller resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataControllerResourceInner> beginPutDataControllerAsync( String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource) { @@ -623,22 +620,22 @@ private Mono>> putDataControllerWithResponseAsync( this.client.getHttpPipeline(), DataControllerResourceInner.class, DataControllerResourceInner.class, - Context.NONE); + this.client.getContext()); } /** * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return the {@link PollerFlux} for polling of data controller resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataControllerResourceInner> beginPutDataControllerAsync( String resourceGroupName, @@ -662,14 +659,14 @@ private Mono>> putDataControllerWithResponseAsync( * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return the {@link SyncPoller} for polling of data controller resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataControllerResourceInner> beginPutDataController( String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource) { return beginPutDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource) @@ -680,15 +677,15 @@ public SyncPoller, DataControllerResourc * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return the {@link SyncPoller} for polling of data controller resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataControllerResourceInner> beginPutDataController( String resourceGroupName, String dataControllerName, @@ -702,12 +699,12 @@ public SyncPoller, DataControllerResourc * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return data controller resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono putDataControllerAsync( @@ -721,13 +718,13 @@ private Mono putDataControllerAsync( * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @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 data controller resource. + * @return data controller resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono putDataControllerAsync( @@ -744,7 +741,7 @@ private Mono putDataControllerAsync( * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -761,7 +758,7 @@ public DataControllerResourceInner putDataController( * Creates or replaces a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource desc. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -782,11 +779,11 @@ public DataControllerResourceInner putDataController( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -831,12 +828,12 @@ private Mono>> deleteWithResponseAsync( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -878,32 +875,33 @@ private Mono>> deleteWithResponseAsync( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) 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); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String dataControllerName, Context context) { context = this.client.mergeContext(context); @@ -917,13 +915,13 @@ private PollerFlux, Void> beginDeleteAsync( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String dataControllerName) { return beginDeleteAsync(resourceGroupName, dataControllerName).getSyncPoller(); } @@ -932,14 +930,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String dataControllerName, Context context) { return beginDeleteAsync(resourceGroupName, dataControllerName, context).getSyncPoller(); @@ -949,11 +947,11 @@ public SyncPoller, Void> beginDelete( * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String dataControllerName) { @@ -966,12 +964,12 @@ private Mono deleteAsync(String resourceGroupName, String dataControllerNa * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String dataControllerName, Context context) { @@ -984,7 +982,7 @@ private Mono deleteAsync(String resourceGroupName, String dataControllerNa * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -998,7 +996,7 @@ public void delete(String resourceGroupName, String dataControllerName) { * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -1013,11 +1011,11 @@ public void delete(String resourceGroupName, String dataControllerName, Context * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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 data controller resource. + * @return data controller resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1062,12 +1060,12 @@ private Mono> getByResourceGroupWithRespon * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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 data controller resource. + * @return data controller resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1109,11 +1107,11 @@ private Mono> getByResourceGroupWithRespon * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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 data controller resource. + * @return data controller resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( @@ -1133,7 +1131,7 @@ private Mono getByResourceGroupAsync( * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -1148,12 +1146,12 @@ public DataControllerResourceInner getByResourceGroup(String resourceGroupName, * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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 data controller resource. + * @return data controller resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -1165,12 +1163,12 @@ public Response getByResourceGroupWithResponse( * Updates a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource The update data controller resource. * @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 data controller resource. + * @return data controller resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchDataControllerWithResponseAsync( @@ -1223,13 +1221,13 @@ private Mono> patchDataControllerWithRespo * Updates a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource The update data controller resource. * @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 data controller resource. + * @return data controller resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchDataControllerWithResponseAsync( @@ -1282,12 +1280,12 @@ private Mono> patchDataControllerWithRespo * Updates a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource The update data controller resource. * @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 data controller resource. + * @return data controller resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono patchDataControllerAsync( @@ -1307,7 +1305,7 @@ private Mono patchDataControllerAsync( * Updates a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource The update data controller resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1324,13 +1322,13 @@ public DataControllerResourceInner patchDataController( * Updates a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @param dataControllerResource The update data controller resource. * @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 data controller resource. + * @return data controller resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response patchDataControllerWithResponse( @@ -1350,7 +1348,7 @@ public Response patchDataControllerWithResponse( * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInSubscriptionNextSinglePageAsync(String nextLink) { @@ -1387,7 +1385,7 @@ private Mono> listInSubscriptionNextS * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInSubscriptionNextSinglePageAsync( @@ -1423,7 +1421,7 @@ private Mono> listInSubscriptionNextS * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInGroupNextSinglePageAsync(String nextLink) { @@ -1459,7 +1457,7 @@ private Mono> listInGroupNextSinglePa * @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. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInGroupNextSinglePageAsync( 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 b184f2339c9c5..0632ec7472970 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.azurearcdata.fluent.models.DataControllerResourceInner; import com.azure.resourcemanager.azurearcdata.models.DataControllerResource; import com.azure.resourcemanager.azurearcdata.models.DataControllers; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class DataControllersImpl implements DataControllers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataControllersImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DataControllersImpl.class); private final DataControllersClient innerClient; @@ -85,7 +84,7 @@ public Response getByResourceGroupWithResponse( public DataControllerResource getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -93,7 +92,7 @@ public DataControllerResource getById(String id) { } String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); if (dataControllerName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -105,7 +104,7 @@ public DataControllerResource getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -113,7 +112,7 @@ public Response getByIdWithResponse(String id, Context c } String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); if (dataControllerName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -125,7 +124,7 @@ public Response getByIdWithResponse(String id, Context c public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -133,7 +132,7 @@ public void deleteById(String id) { } String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); if (dataControllerName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -145,7 +144,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -153,7 +152,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String dataControllerName = Utils.getValueFromIdByName(id, "dataControllers"); if (dataControllerName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsClientImpl.java index 44a32405b17e0..677deca7b2528 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsClientImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.fluent.OperationsClient; import com.azure.resourcemanager.azurearcdata.fluent.models.OperationInner; import com.azure.resourcemanager.azurearcdata.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +116,8 @@ private Mono> listSinglePageAsync() { * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,8 @@ private Mono> listSinglePageAsync(Context context) * * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +162,8 @@ private PagedFlux listAsync() { * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +176,8 @@ private PagedFlux listAsync(Context context) { * * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +191,8 @@ public PagedIterable list() { * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +206,8 @@ public PagedIterable list(Context context) { * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +243,8 @@ private Mono> listNextSinglePageAsync(String nextL * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsImpl.java index 6fcceee329a7b..c37fed4b74e2d 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.azurearcdata.fluent.models.OperationInner; import com.azure.resourcemanager.azurearcdata.models.Operation; import com.azure.resourcemanager.azurearcdata.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstanceImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstanceImpl.java new file mode 100644 index 0000000000000..a2acd77de17f7 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstanceImpl.java @@ -0,0 +1,213 @@ +// 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.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.fluent.models.PostgresInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstance; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceSku; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceUpdate; +import java.util.Collections; +import java.util.Map; + +public final class PostgresInstanceImpl + implements PostgresInstance, PostgresInstance.Definition, PostgresInstance.Update { + private PostgresInstanceInner innerObject; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public PostgresInstanceProperties properties() { + return this.innerModel().properties(); + } + + public PostgresInstanceSku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PostgresInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String postgresInstanceName; + + private PostgresInstanceUpdate updateParameters; + + public PostgresInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PostgresInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getPostgresInstances() + .create(resourceGroupName, postgresInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public PostgresInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPostgresInstances() + .create(resourceGroupName, postgresInstanceName, this.innerModel(), context); + return this; + } + + PostgresInstanceImpl(String name, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = new PostgresInstanceInner(); + this.serviceManager = serviceManager; + this.postgresInstanceName = name; + } + + public PostgresInstanceImpl update() { + this.updateParameters = new PostgresInstanceUpdate(); + return this; + } + + public PostgresInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPostgresInstances() + .updateWithResponse(resourceGroupName, postgresInstanceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public PostgresInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPostgresInstances() + .updateWithResponse(resourceGroupName, postgresInstanceName, updateParameters, context) + .getValue(); + return this; + } + + PostgresInstanceImpl( + PostgresInstanceInner innerObject, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.postgresInstanceName = Utils.getValueFromIdByName(innerObject.id(), "postgresInstances"); + } + + public PostgresInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPostgresInstances() + .getByResourceGroupWithResponse(resourceGroupName, postgresInstanceName, Context.NONE) + .getValue(); + return this; + } + + public PostgresInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPostgresInstances() + .getByResourceGroupWithResponse(resourceGroupName, postgresInstanceName, context) + .getValue(); + return this; + } + + public PostgresInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PostgresInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PostgresInstanceImpl withProperties(PostgresInstanceProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateParameters.withProperties(properties); + return this; + } + } + + public PostgresInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public PostgresInstanceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public PostgresInstanceImpl withSku(PostgresInstanceSku sku) { + this.innerModel().withSku(sku); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesClientImpl.java new file mode 100644 index 0000000000000..8699bbe58e224 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesClientImpl.java @@ -0,0 +1,1448 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +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; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurearcdata.fluent.PostgresInstancesClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.PostgresInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceListResult; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PostgresInstancesClient. */ +public final class PostgresInstancesClientImpl implements PostgresInstancesClient { + /** The proxy service used to perform REST calls. */ + private final PostgresInstancesService service; + + /** The service client containing this operation class. */ + private final AzureArcDataManagementClientImpl client; + + /** + * Initializes an instance of PostgresInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PostgresInstancesClientImpl(AzureArcDataManagementClientImpl client) { + this.service = + RestProxy.create(PostgresInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureArcDataManagementClientPostgresInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureArcDataManageme") + private interface PostgresInstancesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/postgresInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/postgresInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/postgresInstances/{postgresInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("postgresInstanceName") String postgresInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/postgresInstances/{postgresInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("postgresInstanceName") String postgresInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PostgresInstanceInner resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/postgresInstances/{postgresInstanceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("postgresInstanceName") String postgresInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/postgresInstances/{postgresInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("postgresInstanceName") String postgresInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PostgresInstanceUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + 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())); + } + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String postgresInstanceName) { + 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String postgresInstanceName, 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String postgresInstanceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, postgresInstanceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PostgresInstanceInner getByResourceGroup(String resourceGroupName, String postgresInstanceName) { + return getByResourceGroupAsync(resourceGroupName, postgresInstanceName).block(); + } + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String postgresInstanceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, postgresInstanceName, context).block(); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource) { + 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource, 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + resource, + accept, + context); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 {@link PollerFlux} for polling of a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PostgresInstanceInner> beginCreateAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, postgresInstanceName, resource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PostgresInstanceInner.class, + PostgresInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 {@link PollerFlux} for polling of a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PostgresInstanceInner> beginCreateAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, postgresInstanceName, resource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PostgresInstanceInner.class, PostgresInstanceInner.class, context); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 {@link SyncPoller} for polling of a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PostgresInstanceInner> beginCreate( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource) { + return beginCreateAsync(resourceGroupName, postgresInstanceName, resource).getSyncPoller(); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 {@link SyncPoller} for polling of a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PostgresInstanceInner> beginCreate( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource, Context context) { + return beginCreateAsync(resourceGroupName, postgresInstanceName, resource, context).getSyncPoller(); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource) { + return beginCreateAsync(resourceGroupName, postgresInstanceName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource, Context context) { + return beginCreateAsync(resourceGroupName, postgresInstanceName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PostgresInstanceInner create( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource) { + return createAsync(resourceGroupName, postgresInstanceName, resource).block(); + } + + /** + * Creates or replaces a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param resource The postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PostgresInstanceInner create( + String resourceGroupName, String postgresInstanceName, PostgresInstanceInner resource, Context context) { + return createAsync(resourceGroupName, postgresInstanceName, resource, context).block(); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String postgresInstanceName) { + 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String postgresInstanceName, 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String postgresInstanceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, postgresInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String postgresInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, postgresInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String postgresInstanceName) { + return beginDeleteAsync(resourceGroupName, postgresInstanceName).getSyncPoller(); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String postgresInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, postgresInstanceName, context).getSyncPoller(); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String postgresInstanceName) { + return beginDeleteAsync(resourceGroupName, postgresInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String postgresInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, postgresInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String postgresInstanceName) { + deleteAsync(resourceGroupName, postgresInstanceName).block(); + } + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String postgresInstanceName, Context context) { + deleteAsync(resourceGroupName, postgresInstanceName, context).block(); + } + + /** + * Updates a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param parameters The Postgres 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 a Postgres Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceUpdate parameters) { + 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param parameters The Postgres 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 a Postgres Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceUpdate parameters, 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 (postgresInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter postgresInstanceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + postgresInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param parameters The Postgres 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 a Postgres Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String postgresInstanceName, PostgresInstanceUpdate parameters) { + return updateWithResponseAsync(resourceGroupName, postgresInstanceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param parameters The Postgres 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 a Postgres Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PostgresInstanceInner update( + String resourceGroupName, String postgresInstanceName, PostgresInstanceUpdate parameters) { + return updateAsync(resourceGroupName, postgresInstanceName, parameters).block(); + } + + /** + * Updates a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres Instance. + * @param parameters The Postgres 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 a Postgres Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String postgresInstanceName, PostgresInstanceUpdate parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, postgresInstanceName, parameters, 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 a list of PostgresInstance along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 a list of PostgresInstance along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 a list of PostgresInstance along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(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 a list of PostgresInstance along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + 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 + .listByResourceGroupNext(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/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesImpl.java new file mode 100644 index 0000000000000..d59a2027f1414 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesImpl.java @@ -0,0 +1,179 @@ +// 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.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; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurearcdata.fluent.PostgresInstancesClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.PostgresInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstance; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstances; + +public final class PostgresInstancesImpl implements PostgresInstances { + private static final ClientLogger LOGGER = new ClientLogger(PostgresInstancesImpl.class); + + private final PostgresInstancesClient innerClient; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public PostgresInstancesImpl( + PostgresInstancesClient innerClient, + com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PostgresInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PostgresInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PostgresInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PostgresInstanceImpl(inner1, this.manager())); + } + + public PostgresInstance getByResourceGroup(String resourceGroupName, String postgresInstanceName) { + PostgresInstanceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, postgresInstanceName); + if (inner != null) { + return new PostgresInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String postgresInstanceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, postgresInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PostgresInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String postgresInstanceName) { + this.serviceClient().delete(resourceGroupName, postgresInstanceName); + } + + public void delete(String resourceGroupName, String postgresInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, postgresInstanceName, context); + } + + public PostgresInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String postgresInstanceName = Utils.getValueFromIdByName(id, "postgresInstances"); + if (postgresInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'postgresInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, postgresInstanceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String postgresInstanceName = Utils.getValueFromIdByName(id, "postgresInstances"); + if (postgresInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'postgresInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, postgresInstanceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String postgresInstanceName = Utils.getValueFromIdByName(id, "postgresInstances"); + if (postgresInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'postgresInstances'.", id))); + } + this.delete(resourceGroupName, postgresInstanceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String postgresInstanceName = Utils.getValueFromIdByName(id, "postgresInstances"); + if (postgresInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'postgresInstances'.", id))); + } + this.delete(resourceGroupName, postgresInstanceName, context); + } + + private PostgresInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + public PostgresInstanceImpl define(String name) { + return new PostgresInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstanceImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstanceImpl.java index 774e2e7809079..e1bfce2a7b28d 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstanceImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstanceImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurearcdata.implementation; import com.azure.core.management.Region; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurearcdata.fluent.models.SqlManagedInstanceInner; import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; @@ -59,10 +58,6 @@ public SqlManagedInstanceSku sku() { return this.innerModel().sku(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - public Region region() { return Region.fromName(this.regionName()); } 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 d882f8a11c026..730646072c66d 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 @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.azurearcdata.fluent.SqlManagedInstancesClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in SqlManagedInstancesClient. */ public final class SqlManagedInstancesClientImpl implements SqlManagedInstancesClient { - private final ClientLogger logger = new ClientLogger(SqlManagedInstancesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final SqlManagedInstancesService service; @@ -182,7 +179,7 @@ Mono> listByResourceGroupNext( * * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -228,7 +225,7 @@ private Mono> listSinglePageAsync() { * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -269,7 +266,7 @@ private Mono> listSinglePageAsync(Context * * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -283,7 +280,7 @@ private PagedFlux listAsync() { * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -296,7 +293,7 @@ private PagedFlux listAsync(Context context) { * * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -310,7 +307,7 @@ public PagedIterable list() { * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -324,7 +321,8 @@ public PagedIterable list(Context context) { * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -376,7 +374,8 @@ private Mono> listByResourceGroupSinglePa * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -425,7 +424,7 @@ private Mono> listByResourceGroupSinglePa * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -442,7 +441,7 @@ private PagedFlux listByResourceGroupAsync(String resou * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -458,7 +457,7 @@ private PagedFlux listByResourceGroupAsync(String resou * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -473,7 +472,7 @@ public PagedIterable listByResourceGroup(String resourc * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -488,7 +487,7 @@ public PagedIterable listByResourceGroup(String resourc * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -539,7 +538,7 @@ private Mono> getByResourceGroupWithResponseAs * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -586,7 +585,7 @@ private Mono> getByResourceGroupWithResponseAs * @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 a SqlManagedInstance. + * @return a SqlManagedInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( @@ -626,7 +625,7 @@ public SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, Stri * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -638,12 +637,12 @@ public Response getByResourceGroupWithResponse( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -696,13 +695,13 @@ private Mono>> createWithResponseAsync( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -755,14 +754,14 @@ private Mono>> createWithResponseAsync( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return the {@link PollerFlux} for polling of a SqlManagedInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SqlManagedInstanceInner> beginCreateAsync( String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance) { Mono>> mono = @@ -774,22 +773,22 @@ private PollerFlux, SqlManagedInstanceInner> this.client.getHttpPipeline(), SqlManagedInstanceInner.class, SqlManagedInstanceInner.class, - Context.NONE); + this.client.getContext()); } /** * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return the {@link PollerFlux} for polling of a SqlManagedInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SqlManagedInstanceInner> beginCreateAsync( String resourceGroupName, String sqlManagedInstanceName, @@ -812,14 +811,14 @@ private PollerFlux, SqlManagedInstanceInner> * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return the {@link SyncPoller} for polling of a SqlManagedInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SqlManagedInstanceInner> beginCreate( String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance) { return beginCreateAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance).getSyncPoller(); @@ -829,15 +828,15 @@ public SyncPoller, SqlManagedInstanceInner> * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return the {@link SyncPoller} for polling of a SqlManagedInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SqlManagedInstanceInner> beginCreate( String resourceGroupName, String sqlManagedInstanceName, @@ -850,12 +849,12 @@ public SyncPoller, SqlManagedInstanceInner> * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return a SqlManagedInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -869,13 +868,13 @@ private Mono createAsync( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @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 a SqlManagedInstance. + * @return a SqlManagedInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -892,7 +891,7 @@ private Mono createAsync( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -909,7 +908,7 @@ public SqlManagedInstanceInner create( * Creates or replaces a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of SQL Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param sqlManagedInstance The SQL Managed Instance to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -930,11 +929,11 @@ public SqlManagedInstanceInner create( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -980,12 +979,12 @@ private Mono>> deleteWithResponseAsync( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1028,33 +1027,34 @@ private Mono>> deleteWithResponseAsync( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) 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); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String sqlManagedInstanceName, Context context) { context = this.client.mergeContext(context); @@ -1069,13 +1069,13 @@ private PollerFlux, Void> beginDeleteAsync( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlManagedInstanceName) { return beginDeleteAsync(resourceGroupName, sqlManagedInstanceName).getSyncPoller(); } @@ -1084,14 +1084,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String sqlManagedInstanceName, Context context) { return beginDeleteAsync(resourceGroupName, sqlManagedInstanceName, context).getSyncPoller(); @@ -1101,11 +1101,11 @@ public SyncPoller, Void> beginDelete( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String sqlManagedInstanceName) { @@ -1118,12 +1118,12 @@ private Mono deleteAsync(String resourceGroupName, String sqlManagedInstan * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String sqlManagedInstanceName, Context context) { @@ -1136,7 +1136,7 @@ private Mono deleteAsync(String resourceGroupName, String sqlManagedInstan * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. @@ -1150,7 +1150,7 @@ public void delete(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 sqlManagedInstanceName Name of SQL Managed 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. @@ -1165,12 +1165,12 @@ public void delete(String resourceGroupName, String sqlManagedInstanceName, Cont * Updates a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param parameters The SQL Managed 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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1222,13 +1222,13 @@ private Mono> updateWithResponseAsync( * Updates a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param parameters The SQL Managed 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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1277,12 +1277,12 @@ private Mono> updateWithResponseAsync( * Updates a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param parameters The SQL Managed 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 a SqlManagedInstance. + * @return a SqlManagedInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1302,7 +1302,7 @@ private Mono updateAsync( * Updates a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param parameters The SQL Managed Instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1319,13 +1319,13 @@ public SqlManagedInstanceInner update( * Updates a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param sqlManagedInstanceName Name of SQL Managed Instance. * @param parameters The SQL Managed 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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1340,7 +1340,7 @@ public Response updateWithResponse( * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1376,7 +1376,7 @@ private Mono> listNextSinglePageAsync(Str * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1411,7 +1411,7 @@ private Mono> listNextSinglePageAsync(Str * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1448,7 +1448,7 @@ private Mono> listByResourceGroupNextSing * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( 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 92b5c3bcec081..28e1f146ca540 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.azurearcdata.fluent.models.SqlManagedInstanceInner; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstance; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstances; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class SqlManagedInstancesImpl implements SqlManagedInstances { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstancesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(SqlManagedInstancesImpl.class); private final SqlManagedInstancesClient innerClient; @@ -86,7 +85,7 @@ public void delete(String resourceGroupName, String sqlManagedInstanceName, Cont public SqlManagedInstance getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -94,7 +93,7 @@ public SqlManagedInstance getById(String id) { } String sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); if (sqlManagedInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -107,7 +106,7 @@ public SqlManagedInstance getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -115,7 +114,7 @@ public Response getByIdWithResponse(String id, Context conte } String sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); if (sqlManagedInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -128,7 +127,7 @@ public Response getByIdWithResponse(String id, Context conte public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -136,7 +135,7 @@ public void deleteById(String id) { } String sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); if (sqlManagedInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -149,7 +148,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -157,7 +156,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); if (sqlManagedInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String 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 011046a5acbf4..85edda7143aab 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 @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.azurearcdata.fluent.SqlServerInstancesClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in SqlServerInstancesClient. */ public final class SqlServerInstancesClientImpl implements SqlServerInstancesClient { - private final ClientLogger logger = new ClientLogger(SqlServerInstancesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final SqlServerInstancesService service; @@ -182,7 +179,7 @@ Mono> listByResourceGroupNext( * * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -228,7 +225,7 @@ private Mono> listSinglePageAsync() { * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -269,7 +266,7 @@ private Mono> listSinglePageAsync(Context * * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -283,7 +280,7 @@ private PagedFlux listAsync() { * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -296,7 +293,7 @@ private PagedFlux listAsync(Context context) { * * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -310,7 +307,7 @@ public PagedIterable list() { * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -324,7 +321,8 @@ public PagedIterable list(Context context) { * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -376,7 +374,8 @@ private Mono> listByResourceGroupSinglePag * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -425,7 +424,7 @@ private Mono> listByResourceGroupSinglePag * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -442,7 +441,7 @@ private PagedFlux listByResourceGroupAsync(String resour * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -458,7 +457,7 @@ private PagedFlux listByResourceGroupAsync(String resour * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -473,7 +472,7 @@ public PagedIterable listByResourceGroup(String resource * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -488,7 +487,7 @@ public PagedIterable listByResourceGroup(String resource * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -538,7 +537,7 @@ private Mono> getByResourceGroupWithResponseAsy * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -584,7 +583,7 @@ private Mono> getByResourceGroupWithResponseAsy * @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 a SqlServerInstance. + * @return a SqlServerInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( @@ -624,7 +623,7 @@ public SqlServerInstanceInner getByResourceGroup(String resourceGroupName, Strin * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -636,12 +635,12 @@ public Response getByResourceGroupWithResponse( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -693,13 +692,13 @@ private Mono>> createWithResponseAsync( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -751,14 +750,14 @@ private Mono>> createWithResponseAsync( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return the {@link PollerFlux} for polling of a SqlServerInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SqlServerInstanceInner> beginCreateAsync( String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance) { Mono>> mono = @@ -770,22 +769,22 @@ private PollerFlux, SqlServerInstanceInner> b this.client.getHttpPipeline(), SqlServerInstanceInner.class, SqlServerInstanceInner.class, - Context.NONE); + this.client.getContext()); } /** * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return the {@link PollerFlux} for polling of a SqlServerInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SqlServerInstanceInner> beginCreateAsync( String resourceGroupName, String sqlServerInstanceName, @@ -808,14 +807,14 @@ private PollerFlux, SqlServerInstanceInner> b * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return the {@link SyncPoller} for polling of a SqlServerInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SqlServerInstanceInner> beginCreate( String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance) { return beginCreateAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance).getSyncPoller(); @@ -825,15 +824,15 @@ public SyncPoller, SqlServerInstanceInner> be * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return the {@link SyncPoller} for polling of a SqlServerInstance. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SqlServerInstanceInner> beginCreate( String resourceGroupName, String sqlServerInstanceName, @@ -846,12 +845,12 @@ public SyncPoller, SqlServerInstanceInner> be * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return a SqlServerInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -865,13 +864,13 @@ private Mono createAsync( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @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 a SqlServerInstance. + * @return a SqlServerInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -888,7 +887,7 @@ private Mono createAsync( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -905,7 +904,7 @@ public SqlServerInstanceInner create( * Creates or replaces a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param sqlServerInstance The SQL Server Instance to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -926,11 +925,11 @@ public SqlServerInstanceInner create( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -975,12 +974,12 @@ private Mono>> deleteWithResponseAsync( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1022,33 +1021,34 @@ private Mono>> deleteWithResponseAsync( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) 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); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String sqlServerInstanceName, Context context) { context = this.client.mergeContext(context); @@ -1063,13 +1063,13 @@ private PollerFlux, Void> beginDeleteAsync( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlServerInstanceName) { return beginDeleteAsync(resourceGroupName, sqlServerInstanceName).getSyncPoller(); } @@ -1078,14 +1078,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String sqlServerInstanceName, Context context) { return beginDeleteAsync(resourceGroupName, sqlServerInstanceName, context).getSyncPoller(); @@ -1095,11 +1095,11 @@ public SyncPoller, Void> beginDelete( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String sqlServerInstanceName) { @@ -1112,12 +1112,12 @@ private Mono deleteAsync(String resourceGroupName, String sqlServerInstanc * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String sqlServerInstanceName, Context context) { @@ -1130,7 +1130,7 @@ private Mono deleteAsync(String resourceGroupName, String sqlServerInstanc * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. @@ -1144,7 +1144,7 @@ public void delete(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 sqlServerInstanceName 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. @@ -1159,12 +1159,12 @@ public void delete(String resourceGroupName, String sqlServerInstanceName, Conte * Updates a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName Name of sqlServerInstance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param parameters The 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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1215,13 +1215,13 @@ private Mono> updateWithResponseAsync( * Updates a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName Name of sqlServerInstance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param parameters The 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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1269,12 +1269,12 @@ private Mono> updateWithResponseAsync( * Updates a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName Name of sqlServerInstance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param parameters The 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 a SqlServerInstance. + * @return a SqlServerInstance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1294,7 +1294,7 @@ private Mono updateAsync( * Updates a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName Name of sqlServerInstance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param parameters The SQL Server Instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1311,13 +1311,13 @@ public SqlServerInstanceInner update( * Updates a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName Name of sqlServerInstance. + * @param sqlServerInstanceName Name of SQL Server Instance. * @param parameters The 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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1332,7 +1332,7 @@ public Response updateWithResponse( * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1368,7 +1368,7 @@ private Mono> listNextSinglePageAsync(Stri * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1403,7 +1403,7 @@ private Mono> listNextSinglePageAsync(Stri * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1440,7 +1440,7 @@ private Mono> listByResourceGroupNextSingl * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( 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 6aa95e680d2b7..8b3ea519614b4 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerInstanceInner; import com.azure.resourcemanager.azurearcdata.models.SqlServerInstance; import com.azure.resourcemanager.azurearcdata.models.SqlServerInstances; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class SqlServerInstancesImpl implements SqlServerInstances { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerInstancesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(SqlServerInstancesImpl.class); private final SqlServerInstancesClient innerClient; @@ -86,7 +85,7 @@ public void delete(String resourceGroupName, String sqlServerInstanceName, Conte public SqlServerInstance getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -94,7 +93,7 @@ public SqlServerInstance getById(String id) { } String sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); if (sqlServerInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -107,7 +106,7 @@ public SqlServerInstance getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -115,7 +114,7 @@ public Response getByIdWithResponse(String id, Context contex } String sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); if (sqlServerInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -128,7 +127,7 @@ public Response getByIdWithResponse(String id, Context contex public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -136,7 +135,7 @@ public void deleteById(String id) { } String sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); if (sqlServerInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -149,7 +148,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -157,7 +156,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); if (sqlServerInstanceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/AccountProvisioningMode.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/AccountProvisioningMode.java new file mode 100644 index 0000000000000..2ee216ed20054 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/AccountProvisioningMode.java @@ -0,0 +1,34 @@ +// 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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccountProvisioningMode. */ +public final class AccountProvisioningMode extends ExpandableStringEnum { + /** Static value automatic for AccountProvisioningMode. */ + public static final AccountProvisioningMode AUTOMATIC = fromString("automatic"); + + /** Static value manual for AccountProvisioningMode. */ + public static final AccountProvisioningMode MANUAL = fromString("manual"); + + /** + * Creates or finds a AccountProvisioningMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccountProvisioningMode. + */ + @JsonCreator + public static AccountProvisioningMode fromString(String name) { + return fromString(name, AccountProvisioningMode.class); + } + + /** @return known AccountProvisioningMode values. */ + public static Collection values() { + return values(AccountProvisioningMode.class); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDnsDetails.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDnsDetails.java new file mode 100644 index 0000000000000..b117aecf46ce4 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDnsDetails.java @@ -0,0 +1,140 @@ +// 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.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DNS server details. */ +@Fluent +public final class ActiveDirectoryConnectorDnsDetails { + /* + * DNS domain name for which DNS lookups should be forwarded to the Active + * Directory DNS servers. + */ + @JsonProperty(value = "domainName") + private String domainName; + + /* + * List of Active Directory DNS server IP addresses. + */ + @JsonProperty(value = "nameserverIPAddresses", required = true) + private List nameserverIpAddresses; + + /* + * Replica count for DNS proxy service. Default value is 1. + */ + @JsonProperty(value = "replicas") + private Long replicas; + + /* + * Flag indicating whether to prefer Kubernetes DNS server response over AD + * DNS server response for IP address lookups. + */ + @JsonProperty(value = "preferK8sDnsForPtrLookups") + private Boolean preferK8SDnsForPtrLookups; + + /** + * Get the domainName property: DNS domain name for which DNS lookups should be forwarded to the Active Directory + * DNS servers. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: DNS domain name for which DNS lookups should be forwarded to the Active Directory + * DNS servers. + * + * @param domainName the domainName value to set. + * @return the ActiveDirectoryConnectorDnsDetails object itself. + */ + public ActiveDirectoryConnectorDnsDetails withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the nameserverIpAddresses property: List of Active Directory DNS server IP addresses. + * + * @return the nameserverIpAddresses value. + */ + public List nameserverIpAddresses() { + return this.nameserverIpAddresses; + } + + /** + * Set the nameserverIpAddresses property: List of Active Directory DNS server IP addresses. + * + * @param nameserverIpAddresses the nameserverIpAddresses value to set. + * @return the ActiveDirectoryConnectorDnsDetails object itself. + */ + public ActiveDirectoryConnectorDnsDetails withNameserverIpAddresses(List nameserverIpAddresses) { + this.nameserverIpAddresses = nameserverIpAddresses; + return this; + } + + /** + * Get the replicas property: Replica count for DNS proxy service. Default value is 1. + * + * @return the replicas value. + */ + public Long replicas() { + return this.replicas; + } + + /** + * Set the replicas property: Replica count for DNS proxy service. Default value is 1. + * + * @param replicas the replicas value to set. + * @return the ActiveDirectoryConnectorDnsDetails object itself. + */ + public ActiveDirectoryConnectorDnsDetails withReplicas(Long replicas) { + this.replicas = replicas; + return this; + } + + /** + * Get the preferK8SDnsForPtrLookups property: Flag indicating whether to prefer Kubernetes DNS server response over + * AD DNS server response for IP address lookups. + * + * @return the preferK8SDnsForPtrLookups value. + */ + public Boolean preferK8SDnsForPtrLookups() { + return this.preferK8SDnsForPtrLookups; + } + + /** + * Set the preferK8SDnsForPtrLookups property: Flag indicating whether to prefer Kubernetes DNS server response over + * AD DNS server response for IP address lookups. + * + * @param preferK8SDnsForPtrLookups the preferK8SDnsForPtrLookups value to set. + * @return the ActiveDirectoryConnectorDnsDetails object itself. + */ + public ActiveDirectoryConnectorDnsDetails withPreferK8SDnsForPtrLookups(Boolean preferK8SDnsForPtrLookups) { + this.preferK8SDnsForPtrLookups = preferK8SDnsForPtrLookups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nameserverIpAddresses() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nameserverIpAddresses in model ActiveDirectoryConnectorDnsDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryConnectorDnsDetails.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDomainDetails.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDomainDetails.java new file mode 100644 index 0000000000000..2ec9fb742f4bf --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDomainDetails.java @@ -0,0 +1,175 @@ +// 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.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Active Directory domain details. */ +@Fluent +public final class ActiveDirectoryConnectorDomainDetails { + /* + * Name (uppercase) of the Active Directory domain that this AD connector + * will be associated with. + */ + @JsonProperty(value = "realm", required = true) + private String realm; + + /* + * NETBIOS name of the Active Directory domain. + */ + @JsonProperty(value = "netbiosDomainName") + private String netbiosDomainName; + + /* + * The service account provisioning mode for this Active Directory + * connector. + */ + @JsonProperty(value = "serviceAccountProvisioning") + private AccountProvisioningMode serviceAccountProvisioning; + + /* + * The distinguished name of the Active Directory Organizational Unit. + */ + @JsonProperty(value = "ouDistinguishedName") + private String ouDistinguishedName; + + /* + * null + */ + @JsonProperty(value = "domainControllers", required = true) + private ActiveDirectoryDomainControllers domainControllers; + + /** + * Get the realm property: Name (uppercase) of the Active Directory domain that this AD connector will be associated + * with. + * + * @return the realm value. + */ + public String realm() { + return this.realm; + } + + /** + * Set the realm property: Name (uppercase) of the Active Directory domain that this AD connector will be associated + * with. + * + * @param realm the realm value to set. + * @return the ActiveDirectoryConnectorDomainDetails object itself. + */ + public ActiveDirectoryConnectorDomainDetails withRealm(String realm) { + this.realm = realm; + return this; + } + + /** + * Get the netbiosDomainName property: NETBIOS name of the Active Directory domain. + * + * @return the netbiosDomainName value. + */ + public String netbiosDomainName() { + return this.netbiosDomainName; + } + + /** + * Set the netbiosDomainName property: NETBIOS name of the Active Directory domain. + * + * @param netbiosDomainName the netbiosDomainName value to set. + * @return the ActiveDirectoryConnectorDomainDetails object itself. + */ + public ActiveDirectoryConnectorDomainDetails withNetbiosDomainName(String netbiosDomainName) { + this.netbiosDomainName = netbiosDomainName; + return this; + } + + /** + * Get the serviceAccountProvisioning property: The service account provisioning mode for this Active Directory + * connector. + * + * @return the serviceAccountProvisioning value. + */ + public AccountProvisioningMode serviceAccountProvisioning() { + return this.serviceAccountProvisioning; + } + + /** + * Set the serviceAccountProvisioning property: The service account provisioning mode for this Active Directory + * connector. + * + * @param serviceAccountProvisioning the serviceAccountProvisioning value to set. + * @return the ActiveDirectoryConnectorDomainDetails object itself. + */ + public ActiveDirectoryConnectorDomainDetails withServiceAccountProvisioning( + AccountProvisioningMode serviceAccountProvisioning) { + this.serviceAccountProvisioning = serviceAccountProvisioning; + return this; + } + + /** + * Get the ouDistinguishedName property: The distinguished name of the Active Directory Organizational Unit. + * + * @return the ouDistinguishedName value. + */ + public String ouDistinguishedName() { + return this.ouDistinguishedName; + } + + /** + * Set the ouDistinguishedName property: The distinguished name of the Active Directory Organizational Unit. + * + * @param ouDistinguishedName the ouDistinguishedName value to set. + * @return the ActiveDirectoryConnectorDomainDetails object itself. + */ + public ActiveDirectoryConnectorDomainDetails withOuDistinguishedName(String ouDistinguishedName) { + this.ouDistinguishedName = ouDistinguishedName; + return this; + } + + /** + * Get the domainControllers property: null. + * + * @return the domainControllers value. + */ + public ActiveDirectoryDomainControllers domainControllers() { + return this.domainControllers; + } + + /** + * Set the domainControllers property: null. + * + * @param domainControllers the domainControllers value to set. + * @return the ActiveDirectoryConnectorDomainDetails object itself. + */ + public ActiveDirectoryConnectorDomainDetails withDomainControllers( + ActiveDirectoryDomainControllers domainControllers) { + this.domainControllers = domainControllers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (realm() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property realm in model ActiveDirectoryConnectorDomainDetails")); + } + if (domainControllers() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainControllers in model ActiveDirectoryConnectorDomainDetails")); + } else { + domainControllers().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryConnectorDomainDetails.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorListResult.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorListResult.java new file mode 100644 index 0000000000000..5ff1af7adbefa --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorListResult.java @@ -0,0 +1,55 @@ +// 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.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurearcdata.fluent.models.ActiveDirectoryConnectorResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of active directory connectors. */ +@Immutable +public final class ActiveDirectoryConnectorListResult { + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorProperties.java new file mode 100644 index 0000000000000..22e57f54f8b82 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorProperties.java @@ -0,0 +1,133 @@ +// 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.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an Active Directory connector resource. */ +@Fluent +public final class ActiveDirectoryConnectorProperties { + /* + * Username and password for domain service account authentication. + */ + @JsonProperty(value = "domainServiceAccountLoginInformation") + private BasicLoginInformation domainServiceAccountLoginInformation; + + /* + * The provisioning state of the Active Directory connector resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * null + */ + @JsonProperty(value = "spec", required = true) + private ActiveDirectoryConnectorSpec spec; + + /* + * null + */ + @JsonProperty(value = "status") + private ActiveDirectoryConnectorStatus status; + + /** + * Get the domainServiceAccountLoginInformation property: Username and password for domain service account + * authentication. + * + * @return the domainServiceAccountLoginInformation value. + */ + public BasicLoginInformation domainServiceAccountLoginInformation() { + return this.domainServiceAccountLoginInformation; + } + + /** + * Set the domainServiceAccountLoginInformation property: Username and password for domain service account + * authentication. + * + * @param domainServiceAccountLoginInformation the domainServiceAccountLoginInformation value to set. + * @return the ActiveDirectoryConnectorProperties object itself. + */ + public ActiveDirectoryConnectorProperties withDomainServiceAccountLoginInformation( + BasicLoginInformation domainServiceAccountLoginInformation) { + this.domainServiceAccountLoginInformation = domainServiceAccountLoginInformation; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Active Directory connector resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the spec property: null. + * + * @return the spec value. + */ + public ActiveDirectoryConnectorSpec spec() { + return this.spec; + } + + /** + * Set the spec property: null. + * + * @param spec the spec value to set. + * @return the ActiveDirectoryConnectorProperties object itself. + */ + public ActiveDirectoryConnectorProperties withSpec(ActiveDirectoryConnectorSpec spec) { + this.spec = spec; + return this; + } + + /** + * Get the status property: null. + * + * @return the status value. + */ + public ActiveDirectoryConnectorStatus status() { + return this.status; + } + + /** + * Set the status property: null. + * + * @param status the status value to set. + * @return the ActiveDirectoryConnectorProperties object itself. + */ + public ActiveDirectoryConnectorProperties withStatus(ActiveDirectoryConnectorStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainServiceAccountLoginInformation() != null) { + domainServiceAccountLoginInformation().validate(); + } + if (spec() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property spec in model ActiveDirectoryConnectorProperties")); + } else { + spec().validate(); + } + if (status() != null) { + status().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryConnectorProperties.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorResource.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorResource.java new file mode 100644 index 0000000000000..3e4b9f3a61d2f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorResource.java @@ -0,0 +1,115 @@ +// 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.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.fluent.models.ActiveDirectoryConnectorResourceInner; + +/** An immutable client-side representation of ActiveDirectoryConnectorResource. */ +public interface ActiveDirectoryConnectorResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: null. + * + * @return the properties value. + */ + ActiveDirectoryConnectorProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.ActiveDirectoryConnectorResourceInner object. + * + * @return the inner object. + */ + ActiveDirectoryConnectorResourceInner innerModel(); + + /** The entirety of the ActiveDirectoryConnectorResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The ActiveDirectoryConnectorResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ActiveDirectoryConnectorResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ActiveDirectoryConnectorResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, dataControllerName. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @return the next definition stage. + */ + WithProperties withExistingDataController(String resourceGroupName, String dataControllerName); + } + /** The stage of the ActiveDirectoryConnectorResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: null. + * + * @param properties null. + * @return the next definition stage. + */ + WithCreate withProperties(ActiveDirectoryConnectorProperties properties); + } + /** + * The stage of the ActiveDirectoryConnectorResource definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + ActiveDirectoryConnectorResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ActiveDirectoryConnectorResource create(Context context); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ActiveDirectoryConnectorResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ActiveDirectoryConnectorResource refresh(Context context); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorSpec.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorSpec.java new file mode 100644 index 0000000000000..8b962a29c58b5 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorSpec.java @@ -0,0 +1,91 @@ +// 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.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The specifications of the AD Kubernetes resource. */ +@Fluent +public final class ActiveDirectoryConnectorSpec { + /* + * null + */ + @JsonProperty(value = "activeDirectory", required = true) + private ActiveDirectoryConnectorDomainDetails activeDirectory; + + /* + * null + */ + @JsonProperty(value = "dns", required = true) + private ActiveDirectoryConnectorDnsDetails dns; + + /** + * Get the activeDirectory property: null. + * + * @return the activeDirectory value. + */ + public ActiveDirectoryConnectorDomainDetails activeDirectory() { + return this.activeDirectory; + } + + /** + * Set the activeDirectory property: null. + * + * @param activeDirectory the activeDirectory value to set. + * @return the ActiveDirectoryConnectorSpec object itself. + */ + public ActiveDirectoryConnectorSpec withActiveDirectory(ActiveDirectoryConnectorDomainDetails activeDirectory) { + this.activeDirectory = activeDirectory; + return this; + } + + /** + * Get the dns property: null. + * + * @return the dns value. + */ + public ActiveDirectoryConnectorDnsDetails dns() { + return this.dns; + } + + /** + * Set the dns property: null. + * + * @param dns the dns value to set. + * @return the ActiveDirectoryConnectorSpec object itself. + */ + public ActiveDirectoryConnectorSpec withDns(ActiveDirectoryConnectorDnsDetails dns) { + this.dns = dns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (activeDirectory() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property activeDirectory in model ActiveDirectoryConnectorSpec")); + } else { + activeDirectory().validate(); + } + if (dns() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dns in model ActiveDirectoryConnectorSpec")); + } else { + dns().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryConnectorSpec.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorStatus.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorStatus.java new file mode 100644 index 0000000000000..a68ee406245de --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorStatus.java @@ -0,0 +1,140 @@ +// 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.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** The status of the Kubernetes custom resource. */ +@Fluent +public final class ActiveDirectoryConnectorStatus { + /* + * The time that the custom resource was last updated. + */ + @JsonProperty(value = "lastUpdateTime") + private String lastUpdateTime; + + /* + * The version of the replicaSet associated with the AD connector custom + * resource. + */ + @JsonProperty(value = "observedGeneration") + private Long observedGeneration; + + /* + * The state of the AD connector custom resource. + */ + @JsonProperty(value = "state") + private String state; + + /* + * The status of the Kubernetes custom resource. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the lastUpdateTime property: The time that the custom resource was last updated. + * + * @return the lastUpdateTime value. + */ + public String lastUpdateTime() { + return this.lastUpdateTime; + } + + /** + * Set the lastUpdateTime property: The time that the custom resource was last updated. + * + * @param lastUpdateTime the lastUpdateTime value to set. + * @return the ActiveDirectoryConnectorStatus object itself. + */ + public ActiveDirectoryConnectorStatus withLastUpdateTime(String lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + return this; + } + + /** + * Get the observedGeneration property: The version of the replicaSet associated with the AD connector custom + * resource. + * + * @return the observedGeneration value. + */ + public Long observedGeneration() { + return this.observedGeneration; + } + + /** + * Set the observedGeneration property: The version of the replicaSet associated with the AD connector custom + * resource. + * + * @param observedGeneration the observedGeneration value to set. + * @return the ActiveDirectoryConnectorStatus object itself. + */ + public ActiveDirectoryConnectorStatus withObservedGeneration(Long observedGeneration) { + this.observedGeneration = observedGeneration; + return this; + } + + /** + * Get the state property: The state of the AD connector custom resource. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The state of the AD connector custom resource. + * + * @param state the state value to set. + * @return the ActiveDirectoryConnectorStatus object itself. + */ + public ActiveDirectoryConnectorStatus withState(String state) { + this.state = state; + return this; + } + + /** + * Get the additionalProperties property: The status of the Kubernetes custom resource. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The status of the Kubernetes custom resource. + * + * @param additionalProperties the additionalProperties value to set. + * @return the ActiveDirectoryConnectorStatus object itself. + */ + public ActiveDirectoryConnectorStatus withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectors.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectors.java new file mode 100644 index 0000000000000..97a30e85500bc --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectors.java @@ -0,0 +1,145 @@ +// 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.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ActiveDirectoryConnectors. */ +public interface ActiveDirectoryConnectors { + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String dataControllerName); + + /** + * List the active directory connectors associated with the given data controller. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @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 a list of active directory connectors as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String dataControllerName, Context context); + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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. + */ + void delete(String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName); + + /** + * Deletes an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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. + */ + void delete( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context); + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource. + */ + ActiveDirectoryConnectorResource get( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName); + + /** + * Retrieves an Active Directory connector resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The name of the data controller. + * @param activeDirectoryConnectorName The name of the Active Directory connector 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 active directory connector resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String dataControllerName, String activeDirectoryConnectorName, Context context); + + /** + * Retrieves an Active Directory connector resource. + * + * @param id the resource ID. + * @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 active directory connector resource along with {@link Response}. + */ + ActiveDirectoryConnectorResource getById(String id); + + /** + * Retrieves an Active Directory connector resource. + * + * @param id the resource ID. + * @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 active directory connector resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Active Directory connector resource. + * + * @param id the resource ID. + * @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. + */ + void deleteById(String id); + + /** + * Deletes an Active Directory connector resource. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ActiveDirectoryConnectorResource resource. + * + * @param name resource name. + * @return the first stage of the new ActiveDirectoryConnectorResource definition. + */ + ActiveDirectoryConnectorResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainController.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainController.java new file mode 100644 index 0000000000000..de84b26724da1 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainController.java @@ -0,0 +1,55 @@ +// 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.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information about a domain controller in the AD domain. */ +@Fluent +public final class ActiveDirectoryDomainController { + /* + * Fully-qualified domain name of a domain controller in the AD domain. + */ + @JsonProperty(value = "hostname", required = true) + private String hostname; + + /** + * Get the hostname property: Fully-qualified domain name of a domain controller in the AD domain. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Fully-qualified domain name of a domain controller in the AD domain. + * + * @param hostname the hostname value to set. + * @return the ActiveDirectoryDomainController object itself. + */ + public ActiveDirectoryDomainController withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostname() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hostname in model ActiveDirectoryDomainController")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryDomainController.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainControllers.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainControllers.java new file mode 100644 index 0000000000000..0adfa3248b836 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainControllers.java @@ -0,0 +1,81 @@ +// 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.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details about the Active Directory domain controllers associated with this AD connector instance. */ +@Fluent +public final class ActiveDirectoryDomainControllers { + /* + * Information about the Primary Domain Controller (PDC) in the AD domain. + */ + @JsonProperty(value = "primaryDomainController") + private ActiveDirectoryDomainController primaryDomainController; + + /* + * null + */ + @JsonProperty(value = "secondaryDomainControllers") + private List secondaryDomainControllers; + + /** + * Get the primaryDomainController property: Information about the Primary Domain Controller (PDC) in the AD domain. + * + * @return the primaryDomainController value. + */ + public ActiveDirectoryDomainController primaryDomainController() { + return this.primaryDomainController; + } + + /** + * Set the primaryDomainController property: Information about the Primary Domain Controller (PDC) in the AD domain. + * + * @param primaryDomainController the primaryDomainController value to set. + * @return the ActiveDirectoryDomainControllers object itself. + */ + public ActiveDirectoryDomainControllers withPrimaryDomainController( + ActiveDirectoryDomainController primaryDomainController) { + this.primaryDomainController = primaryDomainController; + return this; + } + + /** + * Get the secondaryDomainControllers property: null. + * + * @return the secondaryDomainControllers value. + */ + public List secondaryDomainControllers() { + return this.secondaryDomainControllers; + } + + /** + * Set the secondaryDomainControllers property: null. + * + * @param secondaryDomainControllers the secondaryDomainControllers value to set. + * @return the ActiveDirectoryDomainControllers object itself. + */ + public ActiveDirectoryDomainControllers withSecondaryDomainControllers( + List secondaryDomainControllers) { + this.secondaryDomainControllers = secondaryDomainControllers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primaryDomainController() != null) { + primaryDomainController().validate(); + } + if (secondaryDomainControllers() != null) { + secondaryDomainControllers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryInformation.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryInformation.java new file mode 100644 index 0000000000000..eb0d9a8bb9f04 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryInformation.java @@ -0,0 +1,52 @@ +// 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.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Active Directory information that related to the resource. */ +@Fluent +public final class ActiveDirectoryInformation { + /* + * Keytab information that is used for the Sql Managed Instance when Active + * Directory authentication is used. + */ + @JsonProperty(value = "keytabInformation") + private KeytabInformation keytabInformation; + + /** + * Get the keytabInformation property: Keytab information that is used for the Sql Managed Instance when Active + * Directory authentication is used. + * + * @return the keytabInformation value. + */ + public KeytabInformation keytabInformation() { + return this.keytabInformation; + } + + /** + * Set the keytabInformation property: Keytab information that is used for the Sql Managed Instance when Active + * Directory authentication is used. + * + * @param keytabInformation the keytabInformation value to set. + * @return the ActiveDirectoryInformation object itself. + */ + public ActiveDirectoryInformation withKeytabInformation(KeytabInformation keytabInformation) { + this.keytabInformation = keytabInformation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keytabInformation() != null) { + keytabInformation().validate(); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlManagedInstanceLicenseType.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlManagedInstanceLicenseType.java index 1925e9d25024c..9b438a6c0e189 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlManagedInstanceLicenseType.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlManagedInstanceLicenseType.java @@ -4,44 +4,34 @@ package com.azure.resourcemanager.azurearcdata.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for ArcSqlManagedInstanceLicenseType. */ -public enum ArcSqlManagedInstanceLicenseType { - /** Enum value BasePrice. */ - BASE_PRICE("BasePrice"), +public final class ArcSqlManagedInstanceLicenseType extends ExpandableStringEnum { + /** Static value BasePrice for ArcSqlManagedInstanceLicenseType. */ + public static final ArcSqlManagedInstanceLicenseType BASE_PRICE = fromString("BasePrice"); - /** Enum value LicenseIncluded. */ - LICENSE_INCLUDED("LicenseIncluded"); + /** Static value LicenseIncluded for ArcSqlManagedInstanceLicenseType. */ + public static final ArcSqlManagedInstanceLicenseType LICENSE_INCLUDED = fromString("LicenseIncluded"); - /** The actual serialized value for a ArcSqlManagedInstanceLicenseType instance. */ - private final String value; - - ArcSqlManagedInstanceLicenseType(String value) { - this.value = value; - } + /** Static value DisasterRecovery for ArcSqlManagedInstanceLicenseType. */ + public static final ArcSqlManagedInstanceLicenseType DISASTER_RECOVERY = fromString("DisasterRecovery"); /** - * Parses a serialized value to a ArcSqlManagedInstanceLicenseType instance. + * Creates or finds a ArcSqlManagedInstanceLicenseType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ArcSqlManagedInstanceLicenseType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ArcSqlManagedInstanceLicenseType. */ @JsonCreator - public static ArcSqlManagedInstanceLicenseType fromString(String value) { - ArcSqlManagedInstanceLicenseType[] items = ArcSqlManagedInstanceLicenseType.values(); - for (ArcSqlManagedInstanceLicenseType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ArcSqlManagedInstanceLicenseType fromString(String name) { + return fromString(name, ArcSqlManagedInstanceLicenseType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known ArcSqlManagedInstanceLicenseType values. */ + public static Collection values() { + return values(ArcSqlManagedInstanceLicenseType.class); } } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/BasicLoginInformation.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/BasicLoginInformation.java index 271f94b853f10..35f7f1b120343 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/BasicLoginInformation.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/BasicLoginInformation.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Username and password for basic login authentication. */ @Fluent public final class BasicLoginInformation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BasicLoginInformation.class); - /* * Login username. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/CommonSku.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/CommonSku.java new file mode 100644 index 0000000000000..994e9aacf5e52 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/CommonSku.java @@ -0,0 +1,170 @@ +// 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.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource model definition representing SKU for ARM resources. */ +@Fluent +public class CommonSku { + /* + * The name of the SKU. It is typically a letter+number code + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Whether dev/test is enabled. When the dev field is set to true, the + * resource is used for dev/test purpose. + */ + @JsonProperty(value = "dev") + private Boolean dev; + + /* + * The SKU size. When the name field is the combination of tier and some + * other value, this would be the standalone code. + */ + @JsonProperty(value = "size") + private String size; + + /* + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /* + * If the SKU supports scale out/in then the capacity integer should be + * included. If scale out/in is not possible for the resource this may be + * omitted. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: The name of the SKU. It is typically a letter+number code. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. It is typically a letter+number code. + * + * @param name the name value to set. + * @return the CommonSku object itself. + */ + public CommonSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the dev property: Whether dev/test is enabled. When the dev field is set to true, the resource is used for + * dev/test purpose. + * + * @return the dev value. + */ + public Boolean dev() { + return this.dev; + } + + /** + * Set the dev property: Whether dev/test is enabled. When the dev field is set to true, the resource is used for + * dev/test purpose. + * + * @param dev the dev value to set. + * @return the CommonSku object itself. + */ + public CommonSku withDev(Boolean dev) { + this.dev = dev; + return this; + } + + /** + * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this + * would be the standalone code. + * + * @param size the size value to set. + * @return the CommonSku object itself. + */ + public CommonSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be + * captured here. + * + * @param family the family value to set. + * @return the CommonSku object itself. + */ + public CommonSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the CommonSku object itself. + */ + public CommonSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model CommonSku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommonSku.class); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ConnectionStatus.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ConnectionStatus.java index a21bff9dbae55..37588034078de 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ConnectionStatus.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ConnectionStatus.java @@ -16,6 +16,9 @@ public final class ConnectionStatus extends ExpandableStringEnum tags); } + /** The stage of the DataControllerResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The data controller's properties. + * + * @param properties The data controller's properties. + * @return the next definition stage. + */ + Update withProperties(DataControllerProperties properties); + } } /** * Refreshes the resource to sync with Azure. 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 40c162932c27f..a77971a2cc89a 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 @@ -5,8 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; 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; @@ -14,8 +12,6 @@ /** Used for updating a data controller resource. */ @Fluent public final class DataControllerUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataControllerUpdate.class); - /* * Resource tags */ @@ -23,6 +19,12 @@ public final class DataControllerUpdate { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * The data controller's properties + */ + @JsonProperty(value = "properties") + private DataControllerProperties properties; + /** * Get the tags property: Resource tags. * @@ -43,11 +45,34 @@ public DataControllerUpdate withTags(Map tags) { return this; } + /** + * Get the properties property: The data controller's properties. + * + * @return the properties value. + */ + public DataControllerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The data controller's properties. + * + * @param properties the properties value to set. + * @return the DataControllerUpdate object itself. + */ + public DataControllerUpdate withProperties(DataControllerProperties properties) { + this.properties = properties; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (properties() != null) { + properties().validate(); + } } } 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 579daa945c480..0392342b4fda3 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 @@ -15,7 +15,7 @@ public interface DataControllers { * * @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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ 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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +37,7 @@ 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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +49,7 @@ 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. + * @return a list of data controllers as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -57,7 +57,7 @@ public interface DataControllers { * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -68,7 +68,7 @@ public interface DataControllers { * Deletes a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -80,7 +80,7 @@ public interface DataControllers { * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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. @@ -92,12 +92,12 @@ public interface DataControllers { * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. + * @param dataControllerName The name of the data controller. * @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 data controller resource. + * @return data controller resource along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String dataControllerName, Context context); @@ -109,7 +109,7 @@ 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 data controller resource. + * @return data controller resource along with {@link Response}. */ DataControllerResource getById(String id); @@ -121,7 +121,7 @@ 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 data controller resource. + * @return data controller resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocation.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocation.java index cddf67c1c4afc..07c277b005a2e 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocation.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocation.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The complex type of the extended location. */ @Fluent public final class ExtendedLocation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocation.class); - /* * The name of the extended location. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/HostType.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/HostType.java new file mode 100644 index 0000000000000..cf4e225c4d6ee --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/HostType.java @@ -0,0 +1,43 @@ +// 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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HostType. */ +public final class HostType extends ExpandableStringEnum { + /** Static value Virtual Machine for HostType. */ + public static final HostType VIRTUAL_MACHINE = fromString("Virtual Machine"); + + /** Static value Physical Server for HostType. */ + public static final HostType PHYSICAL_SERVER = fromString("Physical Server"); + + /** Static value AWS Virtual Machine for HostType. */ + public static final HostType AWS_VIRTUAL_MACHINE = fromString("AWS Virtual Machine"); + + /** Static value GCP Virtual Machine for HostType. */ + public static final HostType GCP_VIRTUAL_MACHINE = fromString("GCP Virtual Machine"); + + /** Static value Other for HostType. */ + public static final HostType OTHER = fromString("Other"); + + /** + * Creates or finds a HostType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostType. + */ + @JsonCreator + public static HostType fromString(String name) { + return fromString(name, HostType.class); + } + + /** @return known HostType values. */ + public static Collection values() { + return values(HostType.class); + } +} 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 c39a6e3fa9928..41ca7a2146715 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -17,8 +16,6 @@ /** The kubernetes resource limits and requests used to restrict or reserve resource usage. */ @Fluent public final class K8SResourceRequirements { - @JsonIgnore private final ClientLogger logger = new ClientLogger(K8SResourceRequirements.class); - /* * Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' * request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SScheduling.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SScheduling.java index 44acafd387b91..c0c19a0386e0c 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SScheduling.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SScheduling.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -16,8 +15,6 @@ /** The kubernetes scheduling information. */ @Fluent public final class K8SScheduling { - @JsonIgnore private final ClientLogger logger = new ClientLogger(K8SScheduling.class); - /* * The kubernetes scheduling options. It describes restrictions used to * help Kubernetes select appropriate nodes to host the database service diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SSchedulingOptions.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SSchedulingOptions.java index 8fe21837d997f..fe5f837cb661d 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SSchedulingOptions.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SSchedulingOptions.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -19,8 +18,6 @@ */ @Fluent public final class K8SSchedulingOptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(K8SSchedulingOptions.class); - /* * The kubernetes resource limits and requests used to restrict or reserve * resource usage. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/KeytabInformation.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/KeytabInformation.java new file mode 100644 index 0000000000000..3d0bb66b5dd4a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/KeytabInformation.java @@ -0,0 +1,46 @@ +// 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.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Keytab used for authenticate with Active Directory. */ +@Fluent +public final class KeytabInformation { + /* + * A base64-encoded keytab. + */ + @JsonProperty(value = "keytab") + private String keytab; + + /** + * Get the keytab property: A base64-encoded keytab. + * + * @return the keytab value. + */ + public String keytab() { + return this.keytab; + } + + /** + * Set the keytab property: A base64-encoded keytab. + * + * @param keytab the keytab value to set. + * @return the KeytabInformation object itself. + */ + public KeytabInformation withKeytab(String keytab) { + this.keytab = keytab; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/LogAnalyticsWorkspaceConfig.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/LogAnalyticsWorkspaceConfig.java index 52f6ba78ccafd..77b482b0a6d92 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/LogAnalyticsWorkspaceConfig.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/LogAnalyticsWorkspaceConfig.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; /** Log analytics workspace id and primary key. */ @Fluent public final class LogAnalyticsWorkspaceConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsWorkspaceConfig.class); - /* * Azure Log Analytics workspace ID */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ODataError.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ODataError.java deleted file mode 100644 index 750a06ada079a..0000000000000 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ODataError.java +++ /dev/null @@ -1,133 +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.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information about an error. */ -@Fluent -public final class ODataError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ODataError.class); - - /* - * A language-independent error name. - */ - @JsonProperty(value = "code") - private String code; - - /* - * The error message. - */ - @JsonProperty(value = "message") - private String message; - - /* - * The target of the error (for example, the name of the property in - * error). - */ - @JsonProperty(value = "target") - private String target; - - /* - * The error details. - */ - @JsonProperty(value = "details") - private List details; - - /** - * Get the code property: A language-independent error name. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: A language-independent error name. - * - * @param code the code value to set. - * @return the ODataError object itself. - */ - public ODataError withCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: The error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The error message. - * - * @param message the message value to set. - * @return the ODataError object itself. - */ - public ODataError withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the target property: The target of the error (for example, the name of the property in error). - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: The target of the error (for example, the name of the property in error). - * - * @param target the target value to set. - * @return the ODataError object itself. - */ - public ODataError withTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the details property: The error details. - * - * @return the details value. - */ - public List details() { - return this.details; - } - - /** - * Set the details property: The error details. - * - * @param details the details value to set. - * @return the ODataError object itself. - */ - public ODataError withDetails(List details) { - this.details = details; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (details() != null) { - details().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OnPremiseProperty.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OnPremiseProperty.java index 8073a44675bb4..add9a4a808ac7 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OnPremiseProperty.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OnPremiseProperty.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; /** Properties from the Kubernetes data controller. */ @Fluent public final class OnPremiseProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OnPremiseProperty.class); - /* * A globally unique ID identifying the associated Kubernetes cluster */ @@ -106,15 +103,17 @@ public OnPremiseProperty withSigningCertificateThumbprint(String signingCertific */ public void validate() { if (id() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property id in model OnPremiseProperty")); } if (publicSigningKey() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property publicSigningKey in model OnPremiseProperty")); } } + + private static final ClientLogger LOGGER = new ClientLogger(OnPremiseProperty.class); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationDisplay.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationDisplay.java index 900ac0a42440d..47254c08fe2c5 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationDisplay.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationDisplay.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Display metadata associated with the operation. */ @Fluent public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * The localized friendly form of the resource provider name. */ @@ -126,24 +123,26 @@ public OperationDisplay withDescription(String description) { */ public void validate() { if (provider() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property provider in model OperationDisplay")); } if (resource() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property resource in model OperationDisplay")); } if (operation() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property operation in model OperationDisplay")); } if (description() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property description in model OperationDisplay")); } } + + private static final ClientLogger LOGGER = new ClientLogger(OperationDisplay.class); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationListResult.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationListResult.java index 79077e77c3214..51f211673a409 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationListResult.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of the request to list Azure Data Services on Azure Arc operations. */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * Array of results. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operations.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operations.java index 83a59ffdfc079..c93a1a532c356 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operations.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operations.java @@ -14,7 +14,8 @@ public interface Operations { * * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +26,8 @@ public interface Operations { * @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 result of the request to list Azure Data Services on Azure Arc operations. + * @return result of the request to list Azure Data Services on Azure Arc operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PageOfDataControllerResource.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PageOfDataControllerResource.java index 444b1b8bf1937..57bc73ba15e6b 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PageOfDataControllerResource.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PageOfDataControllerResource.java @@ -5,19 +5,15 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.fluent.models.DataControllerResourceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The PageOfDataControllerResource model. */ +/** A list of data controllers. */ @Fluent public final class PageOfDataControllerResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PageOfDataControllerResource.class); - /* - * The value property. + * Array of results. */ @JsonProperty(value = "value") private List value; @@ -29,7 +25,7 @@ public final class PageOfDataControllerResource { private String nextLink; /** - * Get the value property: The value property. + * Get the value property: Array of results. * * @return the value value. */ @@ -38,7 +34,7 @@ public List value() { } /** - * Set the value property: The value property. + * Set the value property: Array of results. * * @param value the value value to set. * @return the PageOfDataControllerResource object itself. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstance.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstance.java new file mode 100644 index 0000000000000..88f89d9b77090 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstance.java @@ -0,0 +1,263 @@ +// 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.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.fluent.models.PostgresInstanceInner; +import java.util.Map; + +/** An immutable client-side representation of PostgresInstance. */ +public interface PostgresInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the properties property: null. + * + * @return the properties value. + */ + PostgresInstanceProperties properties(); + + /** + * Gets the sku property: Resource sku. + * + * @return the sku value. + */ + PostgresInstanceSku sku(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.PostgresInstanceInner object. + * + * @return the inner object. + */ + PostgresInstanceInner innerModel(); + + /** The entirety of the PostgresInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The PostgresInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the PostgresInstance definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PostgresInstance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PostgresInstance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the Azure resource group. + * @return the next definition stage. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the PostgresInstance definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: null. + * + * @param properties null. + * @return the next definition stage. + */ + WithCreate withProperties(PostgresInstanceProperties properties); + } + /** + * The stage of the PostgresInstance definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithExtendedLocation, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + PostgresInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PostgresInstance create(Context context); + } + /** The stage of the PostgresInstance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PostgresInstance definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extendedLocation of the resource.. + * + * @param extendedLocation The extendedLocation of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the PostgresInstance definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Resource sku.. + * + * @param sku Resource sku. + * @return the next definition stage. + */ + WithCreate withSku(PostgresInstanceSku sku); + } + } + /** + * Begins update for the PostgresInstance resource. + * + * @return the stage of resource update. + */ + PostgresInstance.Update update(); + + /** The template for PostgresInstance update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PostgresInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PostgresInstance apply(Context context); + } + /** The PostgresInstance update stages. */ + interface UpdateStages { + /** The stage of the PostgresInstance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PostgresInstance update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Postgres Instance properties.. + * + * @param properties Postgres Instance properties. + * @return the next definition stage. + */ + Update withProperties(PostgresInstanceProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PostgresInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PostgresInstance refresh(Context context); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceListResult.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceListResult.java new file mode 100644 index 0000000000000..344421e93ec0f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceListResult.java @@ -0,0 +1,55 @@ +// 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.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurearcdata.fluent.models.PostgresInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of PostgresInstance. */ +@Immutable +public final class PostgresInstanceListResult { + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceProperties.java new file mode 100644 index 0000000000000..6733214d6527f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceProperties.java @@ -0,0 +1,170 @@ +// 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.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Postgres Instance properties. */ +@Fluent +public final class PostgresInstanceProperties { + /* + * The data controller id + */ + @JsonProperty(value = "dataControllerId") + private String dataControllerId; + + /* + * The instance admin + */ + @JsonProperty(value = "admin") + private String admin; + + /* + * Username and password for basic authentication. + */ + @JsonProperty(value = "basicLoginInformation") + private BasicLoginInformation basicLoginInformation; + + /* + * The raw kubernetes information + */ + @JsonProperty(value = "k8sRaw") + private Object k8SRaw; + + /* + * Last uploaded date from Kubernetes cluster. Defaults to current date + * time + */ + @JsonProperty(value = "lastUploadedDate") + private OffsetDateTime lastUploadedDate; + + /* + * The provisioning state of the Azure Arc-enabled PostgreSQL instance. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the dataControllerId property: The data controller id. + * + * @return the dataControllerId value. + */ + public String dataControllerId() { + return this.dataControllerId; + } + + /** + * Set the dataControllerId property: The data controller id. + * + * @param dataControllerId the dataControllerId value to set. + * @return the PostgresInstanceProperties object itself. + */ + public PostgresInstanceProperties withDataControllerId(String dataControllerId) { + this.dataControllerId = dataControllerId; + return this; + } + + /** + * Get the admin property: The instance admin. + * + * @return the admin value. + */ + public String admin() { + return this.admin; + } + + /** + * Set the admin property: The instance admin. + * + * @param admin the admin value to set. + * @return the PostgresInstanceProperties object itself. + */ + public PostgresInstanceProperties withAdmin(String admin) { + this.admin = admin; + return this; + } + + /** + * Get the basicLoginInformation property: Username and password for basic authentication. + * + * @return the basicLoginInformation value. + */ + public BasicLoginInformation basicLoginInformation() { + return this.basicLoginInformation; + } + + /** + * Set the basicLoginInformation property: Username and password for basic authentication. + * + * @param basicLoginInformation the basicLoginInformation value to set. + * @return the PostgresInstanceProperties object itself. + */ + public PostgresInstanceProperties withBasicLoginInformation(BasicLoginInformation basicLoginInformation) { + this.basicLoginInformation = basicLoginInformation; + return this; + } + + /** + * Get the k8SRaw property: The raw kubernetes information. + * + * @return the k8SRaw value. + */ + public Object k8SRaw() { + return this.k8SRaw; + } + + /** + * Set the k8SRaw property: The raw kubernetes information. + * + * @param k8SRaw the k8SRaw value to set. + * @return the PostgresInstanceProperties object itself. + */ + public PostgresInstanceProperties withK8SRaw(Object k8SRaw) { + this.k8SRaw = k8SRaw; + return this; + } + + /** + * Get the lastUploadedDate property: Last uploaded date from Kubernetes cluster. Defaults to current date time. + * + * @return the lastUploadedDate value. + */ + public OffsetDateTime lastUploadedDate() { + return this.lastUploadedDate; + } + + /** + * Set the lastUploadedDate property: Last uploaded date from Kubernetes cluster. Defaults to current date time. + * + * @param lastUploadedDate the lastUploadedDate value to set. + * @return the PostgresInstanceProperties object itself. + */ + public PostgresInstanceProperties withLastUploadedDate(OffsetDateTime lastUploadedDate) { + this.lastUploadedDate = lastUploadedDate; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Azure Arc-enabled PostgreSQL instance. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (basicLoginInformation() != null) { + basicLoginInformation().validate(); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSku.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSku.java new file mode 100644 index 0000000000000..a79f0a624ea05 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSku.java @@ -0,0 +1,86 @@ +// 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.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc. */ +@Fluent +public final class PostgresInstanceSku extends CommonSku { + /* + * This field is required to be implemented by the Resource Provider if the + * service has more than one tier. + */ + @JsonProperty(value = "tier") + private PostgresInstanceSkuTier tier; + + /** + * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier. + * + * @return the tier value. + */ + public PostgresInstanceSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more + * than one tier. + * + * @param tier the tier value to set. + * @return the PostgresInstanceSku object itself. + */ + public PostgresInstanceSku withTier(PostgresInstanceSkuTier tier) { + this.tier = tier; + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgresInstanceSku withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgresInstanceSku withDev(Boolean dev) { + super.withDev(dev); + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgresInstanceSku withSize(String size) { + super.withSize(size); + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgresInstanceSku withFamily(String family) { + super.withFamily(family); + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgresInstanceSku withCapacity(Integer capacity) { + super.withCapacity(capacity); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSkuTier.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSkuTier.java new file mode 100644 index 0000000000000..9fa3abf4a7490 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSkuTier.java @@ -0,0 +1,44 @@ +// 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 PostgresInstanceSkuTier. */ +public enum PostgresInstanceSkuTier { + /** Enum value Hyperscale. */ + HYPERSCALE("Hyperscale"); + + /** The actual serialized value for a PostgresInstanceSkuTier instance. */ + private final String value; + + PostgresInstanceSkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PostgresInstanceSkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed PostgresInstanceSkuTier object, or null if unable to parse. + */ + @JsonCreator + public static PostgresInstanceSkuTier fromString(String value) { + PostgresInstanceSkuTier[] items = PostgresInstanceSkuTier.values(); + for (PostgresInstanceSkuTier 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/PostgresInstanceUpdate.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceUpdate.java new file mode 100644 index 0000000000000..26fca211d4976 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceUpdate.java @@ -0,0 +1,78 @@ +// 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.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An update to a Postgres Instance. */ +@Fluent +public final class PostgresInstanceUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Postgres Instance properties. + */ + @JsonProperty(value = "properties") + private PostgresInstanceProperties properties; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PostgresInstanceUpdate object itself. + */ + public PostgresInstanceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: Postgres Instance properties. + * + * @return the properties value. + */ + public PostgresInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Postgres Instance properties. + * + * @param properties the properties value to set. + * @return the PostgresInstanceUpdate object itself. + */ + public PostgresInstanceUpdate withProperties(PostgresInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstances.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstances.java new file mode 100644 index 0000000000000..f096931079d16 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstances.java @@ -0,0 +1,156 @@ +// 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.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PostgresInstances. */ +public interface PostgresInstances { + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List postgres Instance resources in the subscription. + * + * @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 a list of PostgresInstance as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a postgres Instances list by Resource group name. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a postgres Instances list by Resource group name as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance. + */ + PostgresInstance getByResourceGroup(String resourceGroupName, String postgresInstanceName); + + /** + * Retrieves a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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 a Postgres Instance along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String postgresInstanceName, Context context); + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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. + */ + void deleteByResourceGroup(String resourceGroupName, String postgresInstanceName); + + /** + * Deletes a postgres Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param postgresInstanceName Name of Postgres 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. + */ + void delete(String resourceGroupName, String postgresInstanceName, Context context); + + /** + * Retrieves a postgres Instance resource. + * + * @param id the resource ID. + * @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 a Postgres Instance along with {@link Response}. + */ + PostgresInstance getById(String id); + + /** + * Retrieves a postgres Instance resource. + * + * @param id the resource ID. + * @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 a Postgres Instance along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a postgres Instance resource. + * + * @param id the resource ID. + * @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. + */ + void deleteById(String id); + + /** + * Deletes a postgres Instance resource. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PostgresInstance resource. + * + * @param name resource name. + * @return the first stage of the new PostgresInstance definition. + */ + PostgresInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java index fc3534446c6e8..ed2809b49afc9 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.management.Region; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurearcdata.fluent.models.SqlManagedInstanceInner; import java.util.Map; @@ -68,13 +67,6 @@ public interface SqlManagedInstance { */ SqlManagedInstanceSku sku(); - /** - * Gets the systemData property: Read only system data. - * - * @return the systemData value. - */ - SystemData systemData(); - /** * Gets the region of the resource. * diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SRaw.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SRaw.java index ea188cdfcb7c4..b94a662fc97c6 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SRaw.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SRaw.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -16,8 +15,6 @@ /** The raw kubernetes information. */ @Fluent public final class SqlManagedInstanceK8SRaw { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceK8SRaw.class); - /* * The kubernetes spec information. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SSpec.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SSpec.java index b51d71b843f5f..edbb6a99da132 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SSpec.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SSpec.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -16,8 +15,6 @@ /** The kubernetes spec information. */ @Fluent public final class SqlManagedInstanceK8SSpec { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceK8SSpec.class); - /* * The kubernetes scheduling information. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceListResult.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceListResult.java index 8e45487f24d7b..2dce0476f5204 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceListResult.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.fluent.models.SqlManagedInstanceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of SqlManagedInstance. */ @Immutable public final class SqlManagedInstanceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceListResult.class); - /* * Array of results. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java index e4151ce5bcee4..e8a8dd2262d2d 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Properties of sqlManagedInstance. */ @Fluent public final class SqlManagedInstanceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceProperties.class); - /* * null */ @@ -59,11 +55,17 @@ public final class SqlManagedInstanceProperties { private OffsetDateTime lastUploadedDate; /* - * The provisioningState property. + * The provisioning state of the Arc-enabled SQL Managed Instance resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; + /* + * Active Directory information related to this SQL Managed Instance. + */ + @JsonProperty(value = "activeDirectoryInformation") + private ActiveDirectoryInformation activeDirectoryInformation; + /* * The license type to apply for this managed instance. */ @@ -225,7 +227,7 @@ public SqlManagedInstanceProperties withLastUploadedDate(OffsetDateTime lastUplo } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: The provisioning state of the Arc-enabled SQL Managed Instance resource. * * @return the provisioningState value. */ @@ -233,6 +235,27 @@ public String provisioningState() { return this.provisioningState; } + /** + * Get the activeDirectoryInformation property: Active Directory information related to this SQL Managed Instance. + * + * @return the activeDirectoryInformation value. + */ + public ActiveDirectoryInformation activeDirectoryInformation() { + return this.activeDirectoryInformation; + } + + /** + * Set the activeDirectoryInformation property: Active Directory information related to this SQL Managed Instance. + * + * @param activeDirectoryInformation the activeDirectoryInformation value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withActiveDirectoryInformation( + ActiveDirectoryInformation activeDirectoryInformation) { + this.activeDirectoryInformation = activeDirectoryInformation; + return this; + } + /** * Get the licenseType property: The license type to apply for this managed instance. * @@ -309,5 +332,8 @@ public void validate() { if (basicLoginInformation() != null) { basicLoginInformation().validate(); } + if (activeDirectoryInformation() != null) { + activeDirectoryInformation().validate(); + } } } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSku.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSku.java index b3de6cf37336c..3c06a0139c610 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSku.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSku.java @@ -5,20 +5,16 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The resource model definition representing SKU for Azure Managed Instance - Azure Arc. */ @Fluent public final class SqlManagedInstanceSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceSku.class); - /* * The name of the SKU. */ @JsonProperty(value = "name", required = true) - private String name; + private String name = "vCore"; /* * The pricing tier for the instance. @@ -41,13 +37,13 @@ public final class SqlManagedInstanceSku { private String size; /* - * The family property. + * The SKU family */ @JsonProperty(value = "family") private String family; /* - * The capacity property. + * The SKU capacity */ @JsonProperty(value = "capacity") private Integer capacity; @@ -142,7 +138,7 @@ public SqlManagedInstanceSku withSize(String size) { } /** - * Get the family property: The family property. + * Get the family property: The SKU family. * * @return the family value. */ @@ -151,7 +147,7 @@ public String family() { } /** - * Set the family property: The family property. + * Set the family property: The SKU family. * * @param family the family value to set. * @return the SqlManagedInstanceSku object itself. @@ -162,7 +158,7 @@ public SqlManagedInstanceSku withFamily(String family) { } /** - * Get the capacity property: The capacity property. + * Get the capacity property: The SKU capacity. * * @return the capacity value. */ @@ -171,7 +167,7 @@ public Integer capacity() { } /** - * Set the capacity property: The capacity property. + * Set the capacity property: The SKU capacity. * * @param capacity the capacity value to set. * @return the SqlManagedInstanceSku object itself. 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 f5dd0d8e9a473..dc2bd5aa4ec4d 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 @@ -5,8 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; 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; @@ -14,8 +12,6 @@ /** An update to a SQL Managed Instance. */ @Fluent public final class SqlManagedInstanceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceUpdate.class); - /* * Resource 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 3c2fae966dede..d0ae5e57a8556 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 @@ -15,7 +15,7 @@ public interface SqlManagedInstances { * * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ public interface SqlManagedInstances { * @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 a list of SqlManagedInstance. + * @return a list of SqlManagedInstance as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +37,7 @@ public interface SqlManagedInstances { * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +49,7 @@ public interface SqlManagedInstances { * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -74,7 +74,7 @@ public interface SqlManagedInstances { * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String sqlManagedInstanceName, Context context); @@ -83,7 +83,7 @@ Response getByResourceGroupWithResponse( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. @@ -94,7 +94,7 @@ Response getByResourceGroupWithResponse( * Deletes a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param sqlManagedInstanceName Name of SQL Managed 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. @@ -109,7 +109,7 @@ 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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ SqlManagedInstance getById(String id); @@ -121,7 +121,7 @@ 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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstance.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstance.java index 6420ef9d0071f..d0b421e8976b9 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstance.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstance.java @@ -55,7 +55,7 @@ public interface SqlServerInstance { SqlServerInstanceProperties properties(); /** - * Gets the systemData property: Read only system data. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceListResult.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceListResult.java index 71586691fdf66..e3a63e8dfce0c 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceListResult.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerInstanceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of SqlServerInstance. */ @Immutable public final class SqlServerInstanceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerInstanceListResult.class); - /* * Array of results. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java index 723a53f8a3e32..b05bded3241e6 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Properties of SqlServerInstance. */ @Fluent public final class SqlServerInstanceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerInstanceProperties.class); - /* * SQL Server version. */ @@ -112,11 +109,17 @@ public final class SqlServerInstanceProperties { private DefenderStatus azureDefenderStatus; /* - * The provisioningState property. + * The provisioning state of the Arc-enabled SQL Server resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; + /* + * Type of host for Azure Arc SQL Server + */ + @JsonProperty(value = "hostType") + private HostType hostType; + /** * Get the version property: SQL Server version. * @@ -428,7 +431,7 @@ public SqlServerInstanceProperties withAzureDefenderStatus(DefenderStatus azureD } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: The provisioning state of the Arc-enabled SQL Server resource. * * @return the provisioningState value. */ @@ -436,6 +439,26 @@ public String provisioningState() { return this.provisioningState; } + /** + * Get the hostType property: Type of host for Azure Arc SQL Server. + * + * @return the hostType value. + */ + public HostType hostType() { + return this.hostType; + } + + /** + * Set the hostType property: Type of host for Azure Arc SQL Server. + * + * @param hostType the hostType value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withHostType(HostType hostType) { + this.hostType = hostType; + return this; + } + /** * Validates the instance. * @@ -443,16 +466,18 @@ public String provisioningState() { */ public void validate() { if (containerResourceId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property containerResourceId in model SqlServerInstanceProperties")); } if (status() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property status in model SqlServerInstanceProperties")); } } + + private static final ClientLogger LOGGER = new ClientLogger(SqlServerInstanceProperties.class); } 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 9263855be4a76..77bd4ca078a77 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 @@ -5,8 +5,6 @@ package com.azure.resourcemanager.azurearcdata.models; 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; @@ -14,8 +12,6 @@ /** An update to a SQL Server Instance. */ @Fluent public final class SqlServerInstanceUpdate { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerInstanceUpdate.class); - /* * Resource 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 3f47165c53e00..fe7cdc0c2bb11 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 @@ -15,7 +15,7 @@ public interface SqlServerInstances { * * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ public interface SqlServerInstances { * @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 a list of SqlServerInstance. + * @return a list of SqlServerInstance as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +37,7 @@ public interface SqlServerInstances { * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +49,7 @@ public interface SqlServerInstances { * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -74,7 +74,7 @@ public interface SqlServerInstances { * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String sqlServerInstanceName, Context context); @@ -83,7 +83,7 @@ Response getByResourceGroupWithResponse( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. @@ -94,7 +94,7 @@ Response getByResourceGroupWithResponse( * Deletes a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. - * @param sqlServerInstanceName The name of SQL Server Instance. + * @param sqlServerInstanceName 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. @@ -109,7 +109,7 @@ 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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ SqlServerInstance getById(String id); @@ -121,7 +121,7 @@ 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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlVersion.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlVersion.java index b51c30bc05bd7..e8c1ca6324d2a 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlVersion.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlVersion.java @@ -10,15 +10,27 @@ /** Defines values for SqlVersion. */ public final class SqlVersion extends ExpandableStringEnum { - /** Static value SQL Server 2019 for SqlVersion. */ - public static final SqlVersion SQL_SERVER_2019 = fromString("SQL Server 2019"); + /** Static value SQL Server 2012 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2012 = fromString("SQL Server 2012"); - /** Static value SQL Server 2017 for SqlVersion. */ - public static final SqlVersion SQL_SERVER_2017 = fromString("SQL Server 2017"); + /** Static value SQL Server 2014 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2014 = fromString("SQL Server 2014"); /** Static value SQL Server 2016 for SqlVersion. */ public static final SqlVersion SQL_SERVER_2016 = fromString("SQL Server 2016"); + /** Static value SQL Server 2017 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2017 = fromString("SQL Server 2017"); + + /** Static value SQL Server 2019 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2019 = fromString("SQL Server 2019"); + + /** Static value SQL Server 2022 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2022 = fromString("SQL Server 2022"); + + /** Static value Unknown for SqlVersion. */ + public static final SqlVersion UNKNOWN = fromString("Unknown"); + /** * Creates or finds a SqlVersion from its string representation. * diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadServicePrincipal.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadServicePrincipal.java index f1f8511ca0e05..febc55c0fed9b 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadServicePrincipal.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadServicePrincipal.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; /** Service principal for uploading billing, metrics and logs. */ @Fluent public final class UploadServicePrincipal { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadServicePrincipal.class); - /* * Client ID of the service principal for uploading data. */ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadWatermark.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadWatermark.java index 1fee37441a72b..e709a5070b14f 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadWatermark.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadWatermark.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.azurearcdata.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Properties on upload watermark. Mostly timestamp for each upload data type. */ @Fluent public final class UploadWatermark { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadWatermark.class); - /* * Last uploaded date for metrics from kubernetes cluster. Defaults to * current date time diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsCreateSamples.java new file mode 100644 index 0000000000000..75bf536f89a7e --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsCreateSamples.java @@ -0,0 +1,58 @@ +// 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.generated; + +import com.azure.resourcemanager.azurearcdata.models.AccountProvisioningMode; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorDnsDetails; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorDomainDetails; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorProperties; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectorSpec; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryDomainController; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryDomainControllers; +import java.util.Arrays; + +/** Samples for ActiveDirectoryConnectors Create. */ +public final class ActiveDirectoryConnectorsCreateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateActiveDirectoryConnector.json + */ + /** + * Sample code: Create or update an Active Directory connector instance. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void createOrUpdateAnActiveDirectoryConnectorInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager + .activeDirectoryConnectors() + .define("testADConnector") + .withExistingDataController("testrg", "testdataController") + .withProperties( + new ActiveDirectoryConnectorProperties() + .withSpec( + new ActiveDirectoryConnectorSpec() + .withActiveDirectory( + new ActiveDirectoryConnectorDomainDetails() + .withRealm("CONTOSO.LOCAL") + .withServiceAccountProvisioning(AccountProvisioningMode.MANUAL) + .withDomainControllers( + new ActiveDirectoryDomainControllers() + .withPrimaryDomainController( + new ActiveDirectoryDomainController().withHostname("dc1.contoso.local")) + .withSecondaryDomainControllers( + Arrays + .asList( + new ActiveDirectoryDomainController() + .withHostname("dc2.contoso.local"), + new ActiveDirectoryDomainController() + .withHostname("dc3.contoso.local"))))) + .withDns( + new ActiveDirectoryConnectorDnsDetails() + .withNameserverIpAddresses(Arrays.asList("11.11.111.111", "22.22.222.222")) + .withReplicas(1L) + .withPreferK8SDnsForPtrLookups(false)))) + .create(); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsDeleteSamples.java new file mode 100644 index 0000000000000..f833172aaaa54 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ActiveDirectoryConnectors Delete. */ +public final class ActiveDirectoryConnectorsDeleteSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteActiveDirectoryConnector.json + */ + /** + * Sample code: Deletes an Active Directory connector instance. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void deletesAnActiveDirectoryConnectorInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.activeDirectoryConnectors().delete("testrg", "testdataController", "testADConnector", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsGetSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsGetSamples.java new file mode 100644 index 0000000000000..82a34258c271c --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ActiveDirectoryConnectors Get. */ +public final class ActiveDirectoryConnectorsGetSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetActiveDirectoryConnector.json + */ + /** + * Sample code: Retrieves an Active Directory connector resource. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void retrievesAnActiveDirectoryConnectorResource( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager + .activeDirectoryConnectors() + .getWithResponse("testrg", "testdataController", "testADConnector", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsListSamples.java new file mode 100644 index 0000000000000..f7ea64df065fa --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/ActiveDirectoryConnectorsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ActiveDirectoryConnectors List. */ +public final class ActiveDirectoryConnectorsListSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByDataControllerActiveDirectoryConnector.json + */ + /** + * Sample code: Gets all Active Directory connectors associated with a data controller. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllActiveDirectoryConnectorsAssociatedWithADataController( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.activeDirectoryConnectors().list("testrg", "testdataController", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersDeleteSamples.java index 2a4b3e7105031..419832033172a 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersDeleteSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for DataControllers Delete. */ public final class DataControllersDeleteSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/DeleteDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteDataController.json */ /** * Sample code: Delete a dataController. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersGetByResourceGroupSamples.java index 7e3e73475110a..37609103b150e 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersGetByResourceGroupSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for DataControllers GetByResourceGroup. */ public final class DataControllersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/GetDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetDataController.json */ /** * Sample code: Get a data controller. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListByResourceGroupSamples.java index e9a29c0afd433..2a1a6c20b9341 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListByResourceGroupSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for DataControllers ListByResourceGroup. */ public final class DataControllersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListByResourceGroupDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupDataController.json */ /** * Sample code: Gets all dataControllers in a resource group. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListSamples.java index 050a703e2e755..e730f1ec9f4fa 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersListSamples.java @@ -9,7 +9,7 @@ /** Samples for DataControllers List. */ public final class DataControllersListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListSubscriptionDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionDataController.json */ /** * Sample code: Gets all dataControllers in a subscription. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPatchDataControllerSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPatchDataControllerSamples.java index dc30e9bf6cad9..67780321c80e5 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPatchDataControllerSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPatchDataControllerSamples.java @@ -12,7 +12,7 @@ /** Samples for DataControllers PatchDataController. */ public final class DataControllersPatchDataControllerSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/UpdateDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateDataController.json */ /** * Sample code: Updates a dataController tags. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPutDataControllerSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPutDataControllerSamples.java index b0988321b1afa..af9edc4bfe013 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPutDataControllerSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/DataControllersPutDataControllerSamples.java @@ -21,7 +21,7 @@ /** Samples for DataControllers PutDataController. */ public final class DataControllersPutDataControllerSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/CreateOrUpdateDataController.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateDataController.json */ /** * Sample code: Create or update a Data Controller. @@ -49,6 +49,10 @@ public static void createOrUpdateADataController( .withUsages(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z"))) .withBasicLoginInformation( new BasicLoginInformation().withUsername("username").withPassword("********")) + .withMetricsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("********")) + .withLogsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("********")) .withLogAnalyticsWorkspaceConfig( new LogAnalyticsWorkspaceConfig() .withWorkspaceId(UUID.fromString("00000000-1111-2222-3333-444444444444")) diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/OperationsListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/OperationsListSamples.java index b4aa2230963ee..b0c320733adab 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/OperationsListSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListOperation.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListOperation.json */ /** * Sample code: Lists all of the available Azure Data Services on Azure Arc API operations. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesCreateSamples.java new file mode 100644 index 0000000000000..e8e98d7e82608 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesCreateSamples.java @@ -0,0 +1,59 @@ +// 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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +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.PostgresInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceSku; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstanceSkuTier; +import java.io.IOException; + +/** Samples for PostgresInstances Create. */ +public final class PostgresInstancesCreateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdatePostgresInstance.json + */ + /** + * Sample code: Create or update a Postgres Instance. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void createOrUpdateAPostgresInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) throws IOException { + manager + .postgresInstances() + .define("testpostgresInstance") + .withRegion("eastus") + .withExistingResourceGroup("testrg") + .withProperties( + new PostgresInstanceProperties() + .withDataControllerId("dataControllerId") + .withAdmin("admin") + .withBasicLoginInformation( + new BasicLoginInformation().withUsername("username").withPassword("********")) + .withK8SRaw( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"apiVersion\":\"apiVersion\",\"kind\":\"postgresql-12\",\"metadata\":{\"name\":\"pg1\",\"creationTimestamp\":\"2020-08-25T14:55:10Z\",\"generation\":1,\"namespace\":\"test\",\"resourceVersion\":\"527780\",\"selfLink\":\"/apis/arcdata.microsoft.com/v1alpha1/namespaces/test/postgresql-12s/pg1\",\"uid\":\"1111aaaa-ffff-ffff-ffff-99999aaaaaaa\"},\"spec\":{\"backups\":{\"deltaMinutes\":3,\"fullMinutes\":10,\"tiers\":[{\"retention\":{\"maximums\":[\"6\",\"512MB\"],\"minimums\":[\"3\"]},\"storage\":{\"volumeSize\":\"1Gi\"}}]},\"engine\":{\"extensions\":[{\"name\":\"citus\"}]},\"scale\":{\"shards\":3},\"scheduling\":{\"default\":{\"resources\":{\"requests\":{\"memory\":\"256Mi\"}}}},\"service\":{\"type\":\"NodePort\"},\"storage\":{\"data\":{\"className\":\"local-storage\",\"size\":\"5Gi\"},\"logs\":{\"className\":\"local-storage\",\"size\":\"5Gi\"}}},\"status\":{\"externalEndpoint\":null,\"readyPods\":\"4/4\",\"state\":\"Ready\"}}", + Object.class, + SerializerEncoding.JSON))) + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withSku( + new PostgresInstanceSku() + .withName("default") + .withDev(true) + .withTier(PostgresInstanceSkuTier.HYPERSCALE)) + .create(); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesDeleteSamples.java new file mode 100644 index 0000000000000..eba779403a810 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PostgresInstances Delete. */ +public final class PostgresInstancesDeleteSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeletePostgresInstance.json + */ + /** + * Sample code: Deletes a PostgresInstances. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void deletesAPostgresInstances(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().delete("testrg", "testpostgresInstance", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..322177561240b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PostgresInstances GetByResourceGroup. */ +public final class PostgresInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetPostgresInstance.json + */ + /** + * Sample code: Gets a postgres Instances. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAPostgresInstances(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().getByResourceGroupWithResponse("testrg", "testpostgresInstances", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..9564fe9fb0a76 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PostgresInstances ListByResourceGroup. */ +public final class PostgresInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupPostgresInstance.json + */ + /** + * Sample code: Gets all postgres Instances in a resource group. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllPostgresInstancesInAResourceGroup( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().listByResourceGroup("testrg", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListSamples.java new file mode 100644 index 0000000000000..12404b94f58eb --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PostgresInstances List. */ +public final class PostgresInstancesListSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionPostgresInstance.json + */ + /** + * Sample code: Gets all Postgres Instance in a subscription. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllPostgresInstanceInASubscription( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.postgresInstances().list(Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesUpdateSamples.java new file mode 100644 index 0000000000000..45f4ee0668b47 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/PostgresInstancesUpdateSamples.java @@ -0,0 +1,42 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.models.PostgresInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PostgresInstances Update. */ +public final class PostgresInstancesUpdateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdatePostgresInstance.json + */ + /** + * Sample code: Updates a postgres Instances tags. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void updatesAPostgresInstancesTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + PostgresInstance resource = + manager + .postgresInstances() + .getByResourceGroupWithResponse("testrg", "testpostgresInstance", 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/generated/SqlManagedInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesCreateSamples.java index da8f0118446ca..f2ed85f6a051a 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesCreateSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesCreateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.azurearcdata.generated; +import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryInformation; import com.azure.resourcemanager.azurearcdata.models.ArcSqlManagedInstanceLicenseType; import com.azure.resourcemanager.azurearcdata.models.BasicLoginInformation; import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; @@ -11,6 +12,7 @@ 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.KeytabInformation; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SRaw; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SSpec; import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceProperties; @@ -22,7 +24,7 @@ /** Samples for SqlManagedInstances Create. */ public final class SqlManagedInstancesCreateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/CreateOrUpdateSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateSqlManagedInstance.json */ /** * Sample code: Create or update a SQL Managed Instance. @@ -75,6 +77,9 @@ public static void createOrUpdateASQLManagedInstance( .withAdditionalProperties(mapOf("additionalProperty", 1234))) .withBasicLoginInformation( new BasicLoginInformation().withUsername("username").withPassword("********")) + .withActiveDirectoryInformation( + new ActiveDirectoryInformation() + .withKeytabInformation(new KeytabInformation().withKeytab("********"))) .withLicenseType(ArcSqlManagedInstanceLicenseType.LICENSE_INCLUDED) .withClusterId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesDeleteSamples.java index 09e98c6c837e8..9381742248935 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesDeleteSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlManagedInstances Delete. */ public final class SqlManagedInstancesDeleteSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/DeleteSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteSqlManagedInstance.json */ /** * Sample code: Delete a SQL Instance. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesGetByResourceGroupSamples.java index eb77f8f121ad8..dae4449a9c6f1 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesGetByResourceGroupSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlManagedInstances GetByResourceGroup. */ public final class SqlManagedInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/GetSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetSqlManagedInstance.json */ /** * Sample code: Updates a SQL Instance tags. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListByResourceGroupSamples.java index eb2792e434048..20cbabcad625a 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListByResourceGroupSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlManagedInstances ListByResourceGroup. */ public final class SqlManagedInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListByResourceGroupSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupSqlManagedInstance.json */ /** * Sample code: Gets all SQL Instance in a resource group. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListSamples.java index 35cb9065802cd..565dc0a5ca3f3 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesListSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlManagedInstances List. */ public final class SqlManagedInstancesListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListSubscriptionSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionSqlManagedInstance.json */ /** * Sample code: Gets all SQL Instance in a subscription. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesUpdateSamples.java index d4d6daf18f1b4..6443290179cd0 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesUpdateSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlManagedInstancesUpdateSamples.java @@ -12,7 +12,7 @@ /** Samples for SqlManagedInstances Update. */ public final class SqlManagedInstancesUpdateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/UpdateSqlManagedInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateSqlManagedInstance.json */ /** * Sample code: Updates a sql Instance tags. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesCreateSamples.java index c00d97d070a87..1f53a76084afa 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesCreateSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesCreateSamples.java @@ -8,6 +8,7 @@ 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.HostType; import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceProperties; import com.azure.resourcemanager.azurearcdata.models.SqlVersion; import java.time.OffsetDateTime; @@ -17,7 +18,7 @@ /** Samples for SqlServerInstances Create. */ public final class SqlServerInstancesCreateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/CreateOrUpdateSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. @@ -34,21 +35,22 @@ public static void updatesASQLServerInstanceTags( .withTags(mapOf("mytag", "myval")) .withProperties( new SqlServerInstanceProperties() - .withVersion(SqlVersion.SQL_SERVER_2017) + .withVersion(SqlVersion.SQL_SERVER_2012) .withEdition(EditionType.DEVELOPER) - .withContainerResourceId("Arc Machine Name") + .withContainerResourceId("Resource id of hosting Arc Machine") .withVCore("4") - .withStatus(ConnectionStatus.CONNECTED) + .withStatus(ConnectionStatus.REGISTERED) .withPatchLevel("patchlevel") .withCollation("collation") - .withCurrentVersion("2008 R2") + .withCurrentVersion("2012") .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)) + .withAzureDefenderStatus(DefenderStatus.PROTECTED) + .withHostType(HostType.PHYSICAL_SERVER)) .create(); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesDeleteSamples.java index 8142f5c64df38..cd7c116f7f87d 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesDeleteSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlServerInstances Delete. */ public final class SqlServerInstancesDeleteSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/DeleteSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteSqlServerInstance.json */ /** * Sample code: Delete a SQL Server Instance. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesGetByResourceGroupSamples.java index 37d5005540c49..18b2f36b43b58 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesGetByResourceGroupSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlServerInstances GetByResourceGroup. */ public final class SqlServerInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/GetSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListByResourceGroupSamples.java index 8a4730bc50801..e748f7bcae4ee 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListByResourceGroupSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlServerInstances ListByResourceGroup. */ public final class SqlServerInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListByResourceGroupSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupSqlServerInstance.json */ /** * Sample code: Gets all SQL Server Instance in a resource group. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListSamples.java index 80ee6a6b3e971..93e9905c17600 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesListSamples.java @@ -9,7 +9,7 @@ /** Samples for SqlServerInstances List. */ public final class SqlServerInstancesListSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/ListSubscriptionSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionSqlServerInstance.json */ /** * Sample code: Gets all SQL Server Instance in a subscription. diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesUpdateSamples.java index f361ca3b034df..e1101208743ad 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesUpdateSamples.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesUpdateSamples.java @@ -12,7 +12,7 @@ /** Samples for SqlServerInstances Update. */ public final class SqlServerInstancesUpdateSamples { /* - * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/stable/2021-08-01/examples/UpdateSqlServerInstance.json + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags.