diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md index ff68a1770306..0dc9b395d703 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-12-12) + +- 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-06. 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 05139906ee43..5cd30ae7d820 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-06. 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}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md index c3d5163fe497..9b82c2a8d029 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) @@ -23,6 +39,14 @@ - [ListByResourceGroup](#sqlmanagedinstances_listbyresourcegroup) - [Update](#sqlmanagedinstances_update) +## SqlServerDatabases + +- [Create](#sqlserverdatabases_create) +- [Delete](#sqlserverdatabases_delete) +- [Get](#sqlserverdatabases_get) +- [List](#sqlserverdatabases_list) +- [Update](#sqlserverdatabases_update) + ## SqlServerInstances - [Create](#sqlserverinstances_create) @@ -31,6 +55,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-06-15-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-06-15-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-06-15-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-06-15-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 +188,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-06-15-preview/examples/DeleteDataController.json */ /** * Sample code: Delete a dataController. @@ -60,7 +209,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-06-15-preview/examples/GetDataController.json */ /** * Sample code: Get a data controller. @@ -81,7 +230,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-06-15-preview/examples/ListSubscriptionDataController.json */ /** * Sample code: Gets all dataControllers in a subscription. @@ -103,7 +252,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-06-15-preview/examples/ListByResourceGroupDataController.json */ /** * Sample code: Gets all dataControllers in a resource group. @@ -128,7 +277,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-06-15-preview/examples/UpdateDataController.json */ /** * Sample code: Updates a dataController tags. @@ -177,7 +326,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-06-15-preview/examples/CreateOrUpdateDataController.json */ /** * Sample code: Create or update a Data Controller. @@ -197,24 +346,28 @@ public final class DataControllersPutDataControllerSamples { .withOnPremiseProperty( new OnPremiseProperty() .withId(UUID.fromString("12345678-1234-1234-ab12-1a2b3c4d5e6f")) - .withPublicSigningKey("publicOnPremSigningKey")) + .withPublicSigningKey("fakeTokenPlaceholder")) .withUploadWatermark( new UploadWatermark() .withMetrics(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) .withLogs(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) .withUsages(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z"))) .withBasicLoginInformation( - new BasicLoginInformation().withUsername("username").withPassword("********")) + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) + .withMetricsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) + .withLogsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) .withLogAnalyticsWorkspaceConfig( new LogAnalyticsWorkspaceConfig() .withWorkspaceId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withPrimaryKey("********")) + .withPrimaryKey("fakeTokenPlaceholder")) .withUploadServicePrincipal( new UploadServicePrincipal() .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444")) .withAuthority("https://login.microsoftonline.com/") - .withClientSecret("********")) + .withClientSecret("fakeTokenPlaceholder")) .withClusterId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") .withExtensionId( @@ -249,7 +402,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-06-15-preview/examples/ListOperation.json */ /** * Sample code: Lists all of the available Azure Data Services on Azure Arc API operations. @@ -263,9 +416,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-06-15-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("fakeTokenPlaceholder")) + .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-06-15-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-06-15-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-06-15-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-06-15-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-06-15-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 +612,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 +624,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-06-15-preview/examples/CreateOrUpdateSqlManagedInstance.json */ /** * Sample code: Create or update a SQL Managed Instance. @@ -336,7 +676,10 @@ public final class SqlManagedInstancesCreateSamples { .withAdditionalProperties(mapOf())) .withAdditionalProperties(mapOf("additionalProperty", 1234))) .withBasicLoginInformation( - new BasicLoginInformation().withUsername("username").withPassword("********")) + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) + .withActiveDirectoryInformation( + new ActiveDirectoryInformation() + .withKeytabInformation(new KeytabInformation().withKeytab("fakeTokenPlaceholder"))) .withLicenseType(ArcSqlManagedInstanceLicenseType.LICENSE_INCLUDED) .withClusterId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") @@ -373,7 +716,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-06-15-preview/examples/DeleteSqlManagedInstance.json */ /** * Sample code: Delete a SQL Instance. @@ -394,7 +737,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-06-15-preview/examples/GetSqlManagedInstance.json */ /** * Sample code: Updates a SQL Instance tags. @@ -415,7 +758,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-06-15-preview/examples/ListSubscriptionSqlManagedInstance.json */ /** * Sample code: Gets all SQL Instance in a subscription. @@ -437,7 +780,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-06-15-preview/examples/ListByResourceGroupSqlManagedInstance.json */ /** * Sample code: Gets all SQL Instance in a resource group. @@ -462,7 +805,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-06-15-preview/examples/UpdateSqlManagedInstance.json */ /** * Sample code: Updates a sql Instance tags. @@ -491,6 +834,180 @@ public final class SqlManagedInstancesUpdateSamples { } ``` +### SqlServerDatabases_Create + +```java +import com.azure.resourcemanager.azurearcdata.models.DatabaseState; +import com.azure.resourcemanager.azurearcdata.models.RecoveryMode; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResourceProperties; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResourcePropertiesBackupInformation; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResourcePropertiesDatabaseOptions; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlServerDatabases Create. */ +public final class SqlServerDatabasesCreateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/CreateOrUpdateArcSqlServerDatabase.json + */ + /** + * Sample code: Create a Arc Sql Server database. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void createAArcSqlServerDatabase(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager + .sqlServerDatabases() + .define("testdb") + .withRegion("southeastasia") + .withExistingSqlServerInstance("testrg", "testSqlServerInstance") + .withProperties( + new SqlServerDatabaseResourceProperties() + .withCollationName("SQL_Latin1_General_CP1_CI_AS") + .withDatabaseCreationDate(OffsetDateTime.parse("2022-04-05T16:26:33.883Z")) + .withCompatibilityLevel(150) + .withSizeMB(150.0F) + .withSpaceAvailableMB(100.0F) + .withState(DatabaseState.ONLINE) + .withIsReadOnly(true) + .withRecoveryMode(RecoveryMode.FULL) + .withDatabaseOptions( + new SqlServerDatabaseResourcePropertiesDatabaseOptions() + .withIsAutoCloseOn(true) + .withIsAutoShrinkOn(true) + .withIsAutoCreateStatsOn(true) + .withIsAutoUpdateStatsOn(true) + .withIsRemoteDataArchiveEnabled(true) + .withIsMemoryOptimizationEnabled(true) + .withIsEncrypted(true) + .withIsTrustworthyOn(true)) + .withBackupInformation( + new SqlServerDatabaseResourcePropertiesBackupInformation() + .withLastFullBackup(OffsetDateTime.parse("2022-05-05T16:26:33.883Z")) + .withLastLogBackup(OffsetDateTime.parse("2022-05-10T16:26:33.883Z")))) + .withTags(mapOf("mytag", "myval")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SqlServerDatabases_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SqlServerDatabases Delete. */ +public final class SqlServerDatabasesDeleteSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/DeleteArcSqlServerDatabase.json + */ + /** + * Sample code: Deletes a database resource. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void deletesADatabaseResource(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.sqlServerDatabases().deleteWithResponse("testrg", "testsqlManagedInstance", "testdb", Context.NONE); + } +} +``` + +### SqlServerDatabases_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SqlServerDatabases Get. */ +public final class SqlServerDatabasesGetSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/GetArcSqlServerDatabase.json + */ + /** + * Sample code: Retrieves an Arc Sql Server database resource. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void retrievesAnArcSqlServerDatabaseResource( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.sqlServerDatabases().getWithResponse("testrg", "testSqlServerInstance", "testdb", Context.NONE); + } +} +``` + +### SqlServerDatabases_List + +```java +import com.azure.core.util.Context; + +/** Samples for SqlServerDatabases List. */ +public final class SqlServerDatabasesListSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/ListBySqlServerInstanceDatabase.json + */ + /** + * Sample code: Gets all databases associated with an Arc Enabled Sql server. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllDatabasesAssociatedWithAnArcEnabledSqlServer( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.sqlServerDatabases().list("testrg", "testSqlServerInstance", Context.NONE); + } +} +``` + +### SqlServerDatabases_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlServerDatabases Update. */ +public final class SqlServerDatabasesUpdateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/UpdateSqlServerDatabase.json + */ + /** + * Sample code: Update a database. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void updateADatabase(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + SqlServerDatabaseResource resource = + manager + .sqlServerDatabases() + .getWithResponse("testrg", "testsqlManagedInstance", "testdb", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval1")).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; + } +} +``` + ### SqlServerInstances_Create ```java @@ -498,6 +1015,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 +1025,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-06-15-preview/examples/CreateOrUpdateSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. @@ -524,21 +1042,23 @@ 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) + .withCores("4") + .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 +1083,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-06-15-preview/examples/DeleteSqlServerInstance.json */ /** * Sample code: Delete a SQL Server Instance. @@ -584,7 +1104,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-06-15-preview/examples/GetSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. @@ -606,7 +1126,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-06-15-preview/examples/ListSubscriptionSqlServerInstance.json */ /** * Sample code: Gets all SQL Server Instance in a subscription. @@ -628,7 +1148,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-06-15-preview/examples/ListByResourceGroupSqlServerInstance.json */ /** * Sample code: Gets all SQL Server Instance in a resource group. @@ -653,7 +1173,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-06-15-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 ae20e9fb76ca..0b49a003baa7 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-06. 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 24cc1eb8a59e..216d2189fd4b 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,20 +24,27 @@ 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.SqlServerDatabasesImpl; 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.SqlServerDatabases; import com.azure.resourcemanager.azurearcdata.models.SqlServerInstances; import java.time.Duration; import java.time.temporal.ChronoUnit; 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 +59,12 @@ public final class AzureArcDataManager { private DataControllers dataControllers; + private ActiveDirectoryConnectors activeDirectoryConnectors; + + private PostgresInstances postgresInstances; + + private SqlServerDatabases sqlServerDatabases; + private final AzureArcDataManagementClient clientObject; private AzureArcDataManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -76,6 +92,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 +116,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 +184,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 +204,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 +230,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 +248,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 = @@ -224,7 +287,11 @@ public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile } } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -232,7 +299,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of SqlManagedInstances. */ + /** + * Gets the resource collection API of SqlManagedInstances. It manages SqlManagedInstance. + * + * @return Resource collection API of SqlManagedInstances. + */ public SqlManagedInstances sqlManagedInstances() { if (this.sqlManagedInstances == null) { this.sqlManagedInstances = new SqlManagedInstancesImpl(clientObject.getSqlManagedInstances(), this); @@ -240,7 +311,11 @@ public SqlManagedInstances sqlManagedInstances() { return sqlManagedInstances; } - /** @return Resource collection API of SqlServerInstances. */ + /** + * Gets the resource collection API of SqlServerInstances. It manages SqlServerInstance. + * + * @return Resource collection API of SqlServerInstances. + */ public SqlServerInstances sqlServerInstances() { if (this.sqlServerInstances == null) { this.sqlServerInstances = new SqlServerInstancesImpl(clientObject.getSqlServerInstances(), this); @@ -248,7 +323,11 @@ public SqlServerInstances sqlServerInstances() { return sqlServerInstances; } - /** @return Resource collection API of DataControllers. */ + /** + * Gets the resource collection API of DataControllers. It manages DataControllerResource. + * + * @return Resource collection API of DataControllers. + */ public DataControllers dataControllers() { if (this.dataControllers == null) { this.dataControllers = new DataControllersImpl(clientObject.getDataControllers(), this); @@ -256,6 +335,43 @@ public DataControllers dataControllers() { return dataControllers; } + /** + * Gets the resource collection API of ActiveDirectoryConnectors. It manages ActiveDirectoryConnectorResource. + * + * @return Resource collection API of ActiveDirectoryConnectors. + */ + public ActiveDirectoryConnectors activeDirectoryConnectors() { + if (this.activeDirectoryConnectors == null) { + this.activeDirectoryConnectors = + new ActiveDirectoryConnectorsImpl(clientObject.getActiveDirectoryConnectors(), this); + } + return activeDirectoryConnectors; + } + + /** + * Gets the resource collection API of PostgresInstances. It manages PostgresInstance. + * + * @return Resource collection API of PostgresInstances. + */ + public PostgresInstances postgresInstances() { + if (this.postgresInstances == null) { + this.postgresInstances = new PostgresInstancesImpl(clientObject.getPostgresInstances(), this); + } + return postgresInstances; + } + + /** + * Gets the resource collection API of SqlServerDatabases. It manages SqlServerDatabaseResource. + * + * @return Resource collection API of SqlServerDatabases. + */ + public SqlServerDatabases sqlServerDatabases() { + if (this.sqlServerDatabases == null) { + this.sqlServerDatabases = new SqlServerDatabasesImpl(clientObject.getSqlServerDatabases(), this); + } + return sqlServerDatabases; + } + /** * @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 000000000000..9ff9ecf9e920 --- /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. + * @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); + + /** + * 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); +} 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 da11f09fe2a9..64c6fc8c919f 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,25 @@ 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(); + + /** + * Gets the SqlServerDatabasesClient object to access its operations. + * + * @return the SqlServerDatabasesClient object. + */ + SqlServerDatabasesClient getSqlServerDatabases(); } 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 d8c03b698926..dcbaee8c705b 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,35 +188,69 @@ 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) - DataControllerResourceInner getByResourceGroup(String resourceGroupName, String dataControllerName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String dataControllerName, Context context); /** * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. - * @param context The context to associate with this operation. + * @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 data controller resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String dataControllerName, Context context); + DataControllerResourceInner getByResourceGroup(String resourceGroupName, String dataControllerName); + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of data controller resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataControllerResourceInner> beginPatchDataController( + String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource); /** * 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 the {@link SyncPoller} for polling of data controller resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataControllerResourceInner> beginPatchDataController( + String resourceGroupName, + String dataControllerName, + DataControllerUpdate dataControllerResource, + Context context); + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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,7 +265,7 @@ 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. @@ -240,7 +274,7 @@ DataControllerResourceInner patchDataController( * @return data controller resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response patchDataControllerWithResponse( + DataControllerResourceInner patchDataController( String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource, 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 41bea71529e2..532d935f2205 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 000000000000..238a96a36109 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/PostgresInstancesClient.java @@ -0,0 +1,242 @@ +// 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); + + /** + * List postgres Instance resources in the resource group + * + *

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); + + /** + * List postgres Instance resources in the resource group + * + *

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. + * @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); + + /** + * 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); + + /** + * 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. + * @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); + + /** + * 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); +} 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 6cb84258c3bb..ef7de143d658 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,32 +33,36 @@ 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); /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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); /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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); @@ -68,41 +72,41 @@ public interface SqlManagedInstancesClient { * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlManagedInstanceName, Context context); /** * Retrieves a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlManagedInstance. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlManagedInstanceName, Context context); + SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName); /** * 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 +114,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 +133,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 +148,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 +167,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 +195,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 +207,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,30 +220,30 @@ 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. + * @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) - SqlManagedInstanceInner update( - String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters); + Response updateWithResponse( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters, Context context); /** * 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters, Context context); + SqlManagedInstanceInner update( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerDatabasesClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerDatabasesClient.java new file mode 100644 index 000000000000..75c5aae7591d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerDatabasesClient.java @@ -0,0 +1,183 @@ +// 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.util.Context; +import com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerDatabaseResourceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseUpdate; + +/** An instance of this class provides access to all the operations defined in SqlServerDatabasesClient. */ +public interface SqlServerDatabasesClient { + /** + * Creates or replaces an Arc Sql Server Database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseResource The request body for database 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 arc Sql Server database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseResourceInner sqlServerDatabaseResource, + Context context); + + /** + * Creates or replaces an Arc Sql Server Database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseResource The request body for database resource. + * @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 arc Sql Server database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlServerDatabaseResourceInner create( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseResourceInner sqlServerDatabaseResource); + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context); + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 sqlServerInstanceName, String databaseName); + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context); + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlServerDatabaseResourceInner get(String resourceGroupName, String sqlServerInstanceName, String databaseName); + + /** + * Updates an existing database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseUpdate The requested database resource state. + * @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 arc Sql Server database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseUpdate sqlServerDatabaseUpdate, + Context context); + + /** + * Updates an existing database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseUpdate The requested database resource state. + * @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 arc Sql Server database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlServerDatabaseResourceInner update( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseUpdate sqlServerDatabaseUpdate); + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sqlServerInstanceName); + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String sqlServerInstanceName, Context context); +} 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 6e362cf1ec4a..961c481412a4 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,32 +33,36 @@ 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); /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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); /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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); @@ -68,41 +72,41 @@ public interface SqlServerInstancesClient { * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SqlServerInstanceInner getByResourceGroup(String resourceGroupName, String sqlServerInstanceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlServerInstanceName, Context context); /** * Retrieves a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlServerInstance. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlServerInstanceName, Context context); + SqlServerInstanceInner getByResourceGroup(String resourceGroupName, String sqlServerInstanceName); /** * 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 +114,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 +133,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 +148,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 +167,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 +195,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 +207,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,30 +220,30 @@ 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. + * @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) - SqlServerInstanceInner update( - String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters); + Response updateWithResponse( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters, Context context); /** * 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters, Context context); + SqlServerInstanceInner update( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters); } 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 000000000000..040f024a5515 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/ActiveDirectoryConnectorResourceInner.java @@ -0,0 +1,79 @@ +// 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.management.SystemData; +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; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ActiveDirectoryConnectorResourceInner class. */ + public ActiveDirectoryConnectorResourceInner() { + } + + /** + * 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; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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 e3519feb731f..17b7eedbd88c 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,11 +29,15 @@ 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; + /** Creates an instance of DataControllerResourceInner class. */ + public DataControllerResourceInner() { + } + /** * Get the extendedLocation property: The extendedLocation of the resource. * @@ -78,7 +79,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 +111,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 +119,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 b57633882bc6..7671b9e3e146 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. */ @@ -25,8 +22,7 @@ public final class OperationInner { private String name; /* - * The localized display information for this particular operation / - * action. + * The localized display information for this particular operation / action. */ @JsonProperty(value = "display", required = true) private OperationDisplay display; @@ -50,6 +46,10 @@ public final class OperationInner { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: The name of the operation being performed on this particular object. * @@ -135,16 +135,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 000000000000..20211e35ae36 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/PostgresInstanceInner.java @@ -0,0 +1,154 @@ +// 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; + + /** Creates an instance of PostgresInstanceInner class. */ + public PostgresInstanceInner() { + } + + /** + * 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 4a4b565009b3..8a61124095f7 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 @@ -11,15 +11,12 @@ 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 */ @@ -39,11 +36,15 @@ public final class SqlManagedInstanceInner extends Resource { private SqlManagedInstanceSku sku; /* - * Read only system data + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of SqlManagedInstanceInner class. */ + public SqlManagedInstanceInner() { + } + /** * Get the properties property: null. * @@ -105,7 +106,7 @@ public SqlManagedInstanceInner withSku(SqlManagedInstanceSku sku) { } /** - * 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. */ @@ -134,7 +135,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 +149,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/SqlServerDatabaseResourceInner.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerDatabaseResourceInner.java new file mode 100644 index 000000000000..454f43305d47 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerDatabaseResourceInner.java @@ -0,0 +1,94 @@ +// 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.SqlServerDatabaseResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Arc Sql Server database. */ +@Fluent +public final class SqlServerDatabaseResourceInner extends Resource { + /* + * Properties of Arc Sql Server database + */ + @JsonProperty(value = "properties", required = true) + private SqlServerDatabaseResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SqlServerDatabaseResourceInner class. */ + public SqlServerDatabaseResourceInner() { + } + + /** + * Get the properties property: Properties of Arc Sql Server database. + * + * @return the properties value. + */ + public SqlServerDatabaseResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Arc Sql Server database. + * + * @param properties the properties value to set. + * @return the SqlServerDatabaseResourceInner object itself. + */ + public SqlServerDatabaseResourceInner withProperties(SqlServerDatabaseResourceProperties properties) { + this.properties = properties; + 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 SqlServerDatabaseResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlServerDatabaseResourceInner withTags(Map tags) { + super.withTags(tags); + 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 SqlServerDatabaseResourceInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqlServerDatabaseResourceInner.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 81543824dc99..58e589c096ca 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,11 +21,15 @@ 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; + /** Creates an instance of SqlServerInstanceInner class. */ + public SqlServerInstanceInner() { + } + /** * Get the properties property: null. * @@ -51,7 +51,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 000000000000..7aa76cbf5726 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorResourceImpl.java @@ -0,0 +1,122 @@ +// 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.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 000000000000..6958128e4304 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/ActiveDirectoryConnectorsClientImpl.java @@ -0,0 +1,1206 @@ +// 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") + public 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 getWithResponse(resourceGroupName, dataControllerName, activeDirectoryConnectorName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 URL to get the next list of items + *

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 000000000000..2fe937c8e39d --- /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 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 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 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 142dec68b8ef..e3b215d7bf7c 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,27 +119,26 @@ public AzureArcDataManagementClientBuilder serializerAdapter(SerializerAdapter s * @return an instance of AzureArcDataManagementClientImpl. */ public AzureArcDataManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - 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(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureArcDataManagementClientImpl client = new AzureArcDataManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } 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 257e747d16b1..3ba7a7bdb1b4 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 @@ -15,16 +15,20 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; 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.SqlServerDatabasesClient; import com.azure.resourcemanager.azurearcdata.fluent.SqlServerInstancesClient; import java.io.IOException; import java.lang.reflect.Type; @@ -32,15 +36,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** 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 +162,42 @@ 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; + } + + /** The SqlServerDatabasesClient object to access its operations. */ + private final SqlServerDatabasesClient sqlServerDatabases; + + /** + * Gets the SqlServerDatabasesClient object to access its operations. + * + * @return the SqlServerDatabasesClient object. + */ + public SqlServerDatabasesClient getSqlServerDatabases() { + return this.sqlServerDatabases; + } + /** * Initializes an instance of AzureArcDataManagementClient client. * @@ -183,11 +220,14 @@ public DataControllersClient getDataControllers() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-08-01"; + this.apiVersion = "2022-06-15-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); + this.sqlServerDatabases = new SqlServerDatabasesClientImpl(this); } /** @@ -206,10 +246,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -273,7 +310,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -332,4 +369,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 03d9e156dc60..3c4b20abbc5c 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 @@ -66,6 +66,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public DataControllerResourceInner innerModel() { return this.innerObject; } @@ -119,9 +123,7 @@ public DataControllerResource apply() { serviceManager .serviceClient() .getDataControllers() - .patchDataControllerWithResponse( - resourceGroupName, dataControllerName, updateDataControllerResource, Context.NONE) - .getValue(); + .patchDataController(resourceGroupName, dataControllerName, updateDataControllerResource, Context.NONE); return this; } @@ -130,9 +132,7 @@ public DataControllerResource apply(Context context) { serviceManager .serviceClient() .getDataControllers() - .patchDataControllerWithResponse( - resourceGroupName, dataControllerName, updateDataControllerResource, context) - .getValue(); + .patchDataController(resourceGroupName, dataControllerName, updateDataControllerResource, context); return this; } @@ -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 05c80f047beb..7dad1e062abb 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; @@ -68,7 +65,7 @@ public final class DataControllersClientImpl implements DataControllersClient { */ @Host("{$host}") @ServiceInterface(name = "AzureArcDataManageme") - private interface DataControllersService { + public interface DataControllersService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers") @ExpectedResponses({200}) @@ -144,9 +141,9 @@ Mono> getByResourceGroup( @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + "/dataControllers/{dataControllerName}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> patchDataController( + Mono>> patchDataController( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -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,71 +1107,64 @@ 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( String resourceGroupName, String dataControllerName) { return getByResourceGroupWithResponseAsync(resourceGroupName, dataControllerName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 DataControllerResourceInner getByResourceGroup(String resourceGroupName, String dataControllerName) { - return getByResourceGroupAsync(resourceGroupName, dataControllerName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String dataControllerName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataControllerName, context).block(); } /** * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. - * @param context The context to associate with this operation. + * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String dataControllerName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, dataControllerName, context).block(); + public DataControllerResourceInner getByResourceGroup(String resourceGroupName, String dataControllerName) { + return getByResourceGroupWithResponse(resourceGroupName, dataControllerName, Context.NONE).getValue(); } /** * 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( + private Mono>> patchDataControllerWithResponseAsync( String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource) { if (this.client.getEndpoint() == null) { return Mono @@ -1223,16 +1214,16 @@ 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( + private Mono>> patchDataControllerWithResponseAsync( String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource, @@ -1282,32 +1273,149 @@ 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 the {@link PollerFlux} for polling of data controller resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataControllerResourceInner> + beginPatchDataControllerAsync( + String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource) { + Mono>> mono = + patchDataControllerWithResponseAsync(resourceGroupName, dataControllerName, dataControllerResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataControllerResourceInner.class, + DataControllerResourceInner.class, + this.client.getContext()); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 the {@link PollerFlux} for polling of data controller resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataControllerResourceInner> + beginPatchDataControllerAsync( + String resourceGroupName, + String dataControllerName, + DataControllerUpdate dataControllerResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + patchDataControllerWithResponseAsync( + resourceGroupName, dataControllerName, dataControllerResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataControllerResourceInner.class, + DataControllerResourceInner.class, + context); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 the {@link SyncPoller} for polling of data controller resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataControllerResourceInner> beginPatchDataController( + String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource) { + return beginPatchDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource) + .getSyncPoller(); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 the {@link SyncPoller} for polling of data controller resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataControllerResourceInner> beginPatchDataController( + String resourceGroupName, + String dataControllerName, + DataControllerUpdate dataControllerResource, + Context context) { + return beginPatchDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource, context) + .getSyncPoller(); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono patchDataControllerAsync( String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource) { - return patchDataControllerWithResponseAsync(resourceGroupName, dataControllerName, dataControllerResource) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return beginPatchDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** * 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchDataControllerAsync( + String resourceGroupName, + String dataControllerName, + DataControllerUpdate dataControllerResource, + Context context) { + return beginPatchDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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,7 +1432,7 @@ 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. @@ -1333,24 +1441,23 @@ public DataControllerResourceInner patchDataController( * @return data controller resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchDataControllerWithResponse( + public DataControllerResourceInner patchDataController( String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource, Context context) { - return patchDataControllerWithResponseAsync( - resourceGroupName, dataControllerName, dataControllerResource, context) - .block(); + return patchDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource, context).block(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the 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) { @@ -1382,12 +1489,13 @@ private Mono> listInSubscriptionNextS /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return a list of data controllers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInSubscriptionNextSinglePageAsync( @@ -1419,11 +1527,12 @@ private Mono> listInSubscriptionNextS /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the 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) { @@ -1454,12 +1563,13 @@ private Mono> listInGroupNextSinglePa /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the 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 b184f2339c9c..cb0764a70e7f 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; @@ -57,16 +56,6 @@ public void delete(String resourceGroupName, String dataControllerName, Context this.serviceClient().delete(resourceGroupName, dataControllerName, context); } - public DataControllerResource getByResourceGroup(String resourceGroupName, String dataControllerName) { - DataControllerResourceInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, dataControllerName); - if (inner != null) { - return new DataControllerResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String dataControllerName, Context context) { Response inner = @@ -82,10 +71,20 @@ public Response getByResourceGroupWithResponse( } } + public DataControllerResource getByResourceGroup(String resourceGroupName, String dataControllerName) { + DataControllerResourceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, dataControllerName); + if (inner != null) { + return new DataControllerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + 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 44a32405b17e..e9fe84874dee 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; @@ -58,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureArcDataManageme") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.AzureArcData/operations") @ExpectedResponses({200}) @@ -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) { @@ -199,11 +202,13 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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) { @@ -234,12 +239,14 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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 6fcceee329a7..c37fed4b74e2 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 000000000000..9bba9cfb508a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstanceImpl.java @@ -0,0 +1,217 @@ +// 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 000000000000..bed3c6709c0a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/PostgresInstancesClientImpl.java @@ -0,0 +1,1450 @@ +// 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") + public 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)); + } + + /** + * List postgres Instance resources in the resource group + * + *

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())); + } + + /** + * List postgres Instance resources in the resource group + * + *

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)); + } + + /** + * List postgres Instance resources in the resource group + * + *

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)); + } + + /** + * List postgres Instance resources in the resource group + * + *

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)); + } + + /** + * List postgres Instance resources in the resource group + * + *

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)); + } + + /** + * List postgres Instance resources in the resource group + * + *

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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, postgresInstanceName, Context.NONE).getValue(); + } + + /** + * 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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 updateWithResponse(resourceGroupName, postgresInstanceName, parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 URL to get the next list of items + *

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 URL to get the next list of items + *

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 URL to get the next list of items + *

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 000000000000..d2a6f908ce67 --- /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 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 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 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 774e2e780907..43d8e92454e2 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 @@ -71,6 +71,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public SqlManagedInstanceInner innerModel() { return this.innerObject; } 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 d882f8a11c02..1bcfa5fcafb8 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; @@ -68,7 +65,7 @@ public final class SqlManagedInstancesClientImpl implements SqlManagedInstancesC */ @Host("{$host}") @ServiceInterface(name = "AzureArcDataManageme") - private interface SqlManagedInstancesService { + public interface SqlManagedInstancesService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances") @ExpectedResponses({200}) @@ -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) { @@ -318,13 +315,16 @@ public PagedIterable list(Context context) { } /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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) { @@ -369,14 +369,17 @@ private Mono> listByResourceGroupSinglePa } /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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( @@ -419,13 +422,15 @@ private Mono> listByResourceGroupSinglePa } /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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) { @@ -435,14 +440,16 @@ private PagedFlux listByResourceGroupAsync(String resou } /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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) { @@ -452,13 +459,15 @@ private PagedFlux listByResourceGroupAsync(String resou } /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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) { @@ -466,14 +475,16 @@ public PagedIterable listByResourceGroup(String resourc } /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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 +499,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 +550,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,20 +597,13 @@ 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( String resourceGroupName, String sqlManagedInstanceName) { return getByResourceGroupWithResponseAsync(resourceGroupName, sqlManagedInstanceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -607,14 +611,16 @@ private Mono getByResourceGroupAsync( * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName) { - return getByResourceGroupAsync(resourceGroupName, sqlManagedInstanceName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlManagedInstanceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlManagedInstanceName, context).block(); } /** @@ -622,28 +628,26 @@ public SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, Stri * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlManagedInstance. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlManagedInstanceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, sqlManagedInstanceName, context).block(); + public SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName) { + return getByResourceGroupWithResponse(resourceGroupName, sqlManagedInstanceName, Context.NONE).getValue(); } /** * 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 +700,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 +759,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 +778,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 +816,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 +833,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 +854,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 +873,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 +896,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 +913,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 +934,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 +984,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 +1032,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 +1074,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 +1089,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 +1106,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 +1123,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 +1141,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 +1155,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 +1170,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 +1227,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,70 +1282,64 @@ 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( String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters) { return updateWithResponseAsync(resourceGroupName, sqlManagedInstanceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 SqlManagedInstanceInner update( - String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters) { - return updateAsync(resourceGroupName, sqlManagedInstanceName, parameters).block(); + public Response updateWithResponse( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, sqlManagedInstanceName, parameters, context).block(); } /** * 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, sqlManagedInstanceName, parameters, context).block(); + public SqlManagedInstanceInner update( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters) { + return updateWithResponse(resourceGroupName, sqlManagedInstanceName, parameters, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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) { @@ -1371,12 +1370,13 @@ private Mono> listNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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) { @@ -1407,11 +1407,12 @@ private Mono> listNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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) { @@ -1443,12 +1444,13 @@ private Mono> listByResourceGroupNextSing /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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 92b5c3bcec08..306c892930e6 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; @@ -50,16 +49,6 @@ public PagedIterable listByResourceGroup(String resourceGrou return Utils.mapPage(inner, inner1 -> new SqlManagedInstanceImpl(inner1, this.manager())); } - public SqlManagedInstance getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName) { - SqlManagedInstanceInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, sqlManagedInstanceName); - if (inner != null) { - return new SqlManagedInstanceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String sqlManagedInstanceName, Context context) { Response inner = @@ -75,6 +64,16 @@ public Response getByResourceGroupWithResponse( } } + public SqlManagedInstance getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName) { + SqlManagedInstanceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, sqlManagedInstanceName); + if (inner != null) { + return new SqlManagedInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String sqlManagedInstanceName) { this.serviceClient().delete(resourceGroupName, sqlManagedInstanceName); } @@ -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/SqlServerDatabaseResourceImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerDatabaseResourceImpl.java new file mode 100644 index 000000000000..7eb75fdf65ab --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerDatabaseResourceImpl.java @@ -0,0 +1,209 @@ +// 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.SqlServerDatabaseResourceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResource; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResourceProperties; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SqlServerDatabaseResourceImpl + implements SqlServerDatabaseResource, SqlServerDatabaseResource.Definition, SqlServerDatabaseResource.Update { + private SqlServerDatabaseResourceInner 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 SqlServerDatabaseResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SqlServerDatabaseResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlServerInstanceName; + + private String databaseName; + + private SqlServerDatabaseUpdate updateSqlServerDatabaseUpdate; + + public SqlServerDatabaseResourceImpl withExistingSqlServerInstance( + String resourceGroupName, String sqlServerInstanceName) { + this.resourceGroupName = resourceGroupName; + this.sqlServerInstanceName = sqlServerInstanceName; + return this; + } + + public SqlServerDatabaseResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerDatabases() + .createWithResponse( + resourceGroupName, sqlServerInstanceName, databaseName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SqlServerDatabaseResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerDatabases() + .createWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, this.innerModel(), context) + .getValue(); + return this; + } + + SqlServerDatabaseResourceImpl( + String name, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = new SqlServerDatabaseResourceInner(); + this.serviceManager = serviceManager; + this.databaseName = name; + } + + public SqlServerDatabaseResourceImpl update() { + this.updateSqlServerDatabaseUpdate = new SqlServerDatabaseUpdate(); + return this; + } + + public SqlServerDatabaseResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerDatabases() + .updateWithResponse( + resourceGroupName, sqlServerInstanceName, databaseName, updateSqlServerDatabaseUpdate, Context.NONE) + .getValue(); + return this; + } + + public SqlServerDatabaseResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerDatabases() + .updateWithResponse( + resourceGroupName, sqlServerInstanceName, databaseName, updateSqlServerDatabaseUpdate, context) + .getValue(); + return this; + } + + SqlServerDatabaseResourceImpl( + SqlServerDatabaseResourceInner innerObject, + com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlServerInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sqlServerInstances"); + this.databaseName = Utils.getValueFromIdByName(innerObject.id(), "databases"); + } + + public SqlServerDatabaseResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerDatabases() + .getWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, Context.NONE) + .getValue(); + return this; + } + + public SqlServerDatabaseResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerDatabases() + .getWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, context) + .getValue(); + return this; + } + + public SqlServerDatabaseResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SqlServerDatabaseResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SqlServerDatabaseResourceImpl withProperties(SqlServerDatabaseResourceProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateSqlServerDatabaseUpdate.withProperties(properties); + return this; + } + } + + public SqlServerDatabaseResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSqlServerDatabaseUpdate.withTags(tags); + 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/SqlServerDatabasesClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerDatabasesClientImpl.java new file mode 100644 index 000000000000..486d32ab090b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerDatabasesClientImpl.java @@ -0,0 +1,1136 @@ +// 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.azurearcdata.fluent.SqlServerDatabasesClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerDatabaseResourceInner; +import com.azure.resourcemanager.azurearcdata.models.ArcSqlServerDatabaseListResult; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseUpdate; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlServerDatabasesClient. */ +public final class SqlServerDatabasesClientImpl implements SqlServerDatabasesClient { + /** The proxy service used to perform REST calls. */ + private final SqlServerDatabasesService service; + + /** The service client containing this operation class. */ + private final AzureArcDataManagementClientImpl client; + + /** + * Initializes an instance of SqlServerDatabasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlServerDatabasesClientImpl(AzureArcDataManagementClientImpl client) { + this.service = + RestProxy.create(SqlServerDatabasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureArcDataManagementClientSqlServerDatabases to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureArcDataManageme") + public interface SqlServerDatabasesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlServerInstanceName") String sqlServerInstanceName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlServerDatabaseResourceInner sqlServerDatabaseResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlServerInstanceName") String sqlServerInstanceName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlServerInstanceName") String sqlServerInstanceName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlServerInstanceName") String sqlServerInstanceName, + @PathParam("databaseName") String databaseName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlServerDatabaseUpdate sqlServerDatabaseUpdate, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}/databases") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlServerInstanceName") String sqlServerInstanceName, + @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); + } + + /** + * Creates or replaces an Arc Sql Server Database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseResource The request body for database 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 arc Sql Server database along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseResourceInner sqlServerDatabaseResource) { + 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (sqlServerDatabaseResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sqlServerDatabaseResource is required and cannot be null.")); + } else { + sqlServerDatabaseResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + sqlServerDatabaseResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or replaces an Arc Sql Server Database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseResource The request body for database 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 arc Sql Server database along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseResourceInner sqlServerDatabaseResource, + 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (sqlServerDatabaseResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sqlServerDatabaseResource is required and cannot be null.")); + } else { + sqlServerDatabaseResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + sqlServerDatabaseResource, + accept, + context); + } + + /** + * Creates or replaces an Arc Sql Server Database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseResource The request body for database 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 arc Sql Server database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseResourceInner sqlServerDatabaseResource) { + return createWithResponseAsync( + resourceGroupName, sqlServerInstanceName, databaseName, sqlServerDatabaseResource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or replaces an Arc Sql Server Database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseResource The request body for database 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 arc Sql Server database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseResourceInner sqlServerDatabaseResource, + Context context) { + return createWithResponseAsync( + resourceGroupName, sqlServerInstanceName, databaseName, sqlServerDatabaseResource, context) + .block(); + } + + /** + * Creates or replaces an Arc Sql Server Database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseResource The request body for database 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 arc Sql Server database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlServerDatabaseResourceInner create( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseResourceInner sqlServerDatabaseResource) { + return createWithResponse( + resourceGroupName, sqlServerInstanceName, databaseName, sqlServerDatabaseResource, Context.NONE) + .getValue(); + } + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 sqlServerInstanceName, String databaseName) { + 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 sqlServerInstanceName, String databaseName, 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 sqlServerInstanceName, String databaseName) { + return deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName, databaseName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context) { + return deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName, databaseName, context).block(); + } + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 sqlServerInstanceName, String databaseName) { + deleteWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, Context.NONE); + } + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sqlServerInstanceName, String databaseName) { + 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sqlServerInstanceName, String databaseName, 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName 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, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sqlServerInstanceName, String databaseName) { + return getWithResponseAsync(resourceGroupName, sqlServerInstanceName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context) { + return getWithResponseAsync(resourceGroupName, sqlServerInstanceName, databaseName, context).block(); + } + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlServerDatabaseResourceInner get( + String resourceGroupName, String sqlServerInstanceName, String databaseName) { + return getWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, Context.NONE).getValue(); + } + + /** + * Updates an existing database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseUpdate The requested database resource state. + * @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 arc Sql Server database along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseUpdate sqlServerDatabaseUpdate) { + 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (sqlServerDatabaseUpdate == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlServerDatabaseUpdate is required and cannot be null.")); + } else { + sqlServerDatabaseUpdate.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + sqlServerDatabaseUpdate, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseUpdate The requested database resource state. + * @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 arc Sql Server database along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseUpdate sqlServerDatabaseUpdate, + 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (sqlServerDatabaseUpdate == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlServerDatabaseUpdate is required and cannot be null.")); + } else { + sqlServerDatabaseUpdate.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + databaseName, + this.client.getApiVersion(), + sqlServerDatabaseUpdate, + accept, + context); + } + + /** + * Updates an existing database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseUpdate The requested database resource state. + * @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 arc Sql Server database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseUpdate sqlServerDatabaseUpdate) { + return updateWithResponseAsync(resourceGroupName, sqlServerInstanceName, databaseName, sqlServerDatabaseUpdate) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an existing database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseUpdate The requested database resource state. + * @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 arc Sql Server database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseUpdate sqlServerDatabaseUpdate, + Context context) { + return updateWithResponseAsync( + resourceGroupName, sqlServerInstanceName, databaseName, sqlServerDatabaseUpdate, context) + .block(); + } + + /** + * Updates an existing database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @param sqlServerDatabaseUpdate The requested database resource state. + * @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 arc Sql Server database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlServerDatabaseResourceInner update( + String resourceGroupName, + String sqlServerInstanceName, + String databaseName, + SqlServerDatabaseUpdate sqlServerDatabaseUpdate) { + return updateWithResponse( + resourceGroupName, sqlServerInstanceName, databaseName, sqlServerDatabaseUpdate, Context.NONE) + .getValue(); + } + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sqlServerInstanceName) { + 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + 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 databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sqlServerInstanceName, 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName 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, + sqlServerInstanceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sqlServerInstanceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sqlServerInstanceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sqlServerInstanceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sqlServerInstanceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sqlServerInstanceName) { + return new PagedIterable<>(listAsync(resourceGroupName, sqlServerInstanceName)); + } + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sqlServerInstanceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sqlServerInstanceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 Arc Sql Server database 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 URL to get the next list of items + *

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 Arc Sql Server database 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/SqlServerDatabasesImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerDatabasesImpl.java new file mode 100644 index 000000000000..0b8988ececb0 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerDatabasesImpl.java @@ -0,0 +1,201 @@ +// 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.SqlServerDatabasesClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerDatabaseResourceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResource; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabases; + +public final class SqlServerDatabasesImpl implements SqlServerDatabases { + private static final ClientLogger LOGGER = new ClientLogger(SqlServerDatabasesImpl.class); + + private final SqlServerDatabasesClient innerClient; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public SqlServerDatabasesImpl( + SqlServerDatabasesClient innerClient, + com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, context); + } + + public void delete(String resourceGroupName, String sqlServerInstanceName, String databaseName) { + this.serviceClient().delete(resourceGroupName, sqlServerInstanceName, databaseName); + } + + public Response getWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlServerDatabaseResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqlServerDatabaseResource get(String resourceGroupName, String sqlServerInstanceName, String databaseName) { + SqlServerDatabaseResourceInner inner = + this.serviceClient().get(resourceGroupName, sqlServerInstanceName, databaseName); + if (inner != null) { + return new SqlServerDatabaseResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String sqlServerInstanceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sqlServerInstanceName); + return Utils.mapPage(inner, inner1 -> new SqlServerDatabaseResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String sqlServerInstanceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sqlServerInstanceName, context); + return Utils.mapPage(inner, inner1 -> new SqlServerDatabaseResourceImpl(inner1, this.manager())); + } + + public SqlServerDatabaseResource 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 sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); + if (sqlServerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlServerInstances'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + return this.getWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, 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 sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); + if (sqlServerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlServerInstances'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + return this.getWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, 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 sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); + if (sqlServerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlServerInstances'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + this.deleteWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, Context.NONE); + } + + public Response 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 sqlServerInstanceName = Utils.getValueFromIdByName(id, "sqlServerInstances"); + if (sqlServerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlServerInstances'.", id))); + } + String databaseName = Utils.getValueFromIdByName(id, "databases"); + if (databaseName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databases'.", id))); + } + return this.deleteWithResponse(resourceGroupName, sqlServerInstanceName, databaseName, context); + } + + private SqlServerDatabasesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + public SqlServerDatabaseResourceImpl define(String name) { + return new SqlServerDatabaseResourceImpl(name, this.manager()); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstanceImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstanceImpl.java index 5711b394ba3d..31698446e570 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstanceImpl.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstanceImpl.java @@ -61,6 +61,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public SqlServerInstanceInner innerModel() { return this.innerObject; } 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 011046a5acbf..aea2a0de26ef 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; @@ -68,7 +65,7 @@ public final class SqlServerInstancesClientImpl implements SqlServerInstancesCli */ @Host("{$host}") @ServiceInterface(name = "AzureArcDataManageme") - private interface SqlServerInstancesService { + public interface SqlServerInstancesService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances") @ExpectedResponses({200}) @@ -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) { @@ -318,13 +315,16 @@ public PagedIterable list(Context context) { } /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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) { @@ -369,14 +369,17 @@ private Mono> listByResourceGroupSinglePag } /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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( @@ -419,13 +422,15 @@ private Mono> listByResourceGroupSinglePag } /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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) { @@ -435,14 +440,16 @@ private PagedFlux listByResourceGroupAsync(String resour } /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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) { @@ -452,13 +459,15 @@ private PagedFlux listByResourceGroupAsync(String resour } /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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) { @@ -466,14 +475,16 @@ public PagedIterable listByResourceGroup(String resource } /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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 +499,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 +549,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,20 +595,13 @@ 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( String resourceGroupName, String sqlServerInstanceName) { return getByResourceGroupWithResponseAsync(resourceGroupName, sqlServerInstanceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -605,14 +609,16 @@ private Mono getByResourceGroupAsync( * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlServerInstanceInner getByResourceGroup(String resourceGroupName, String sqlServerInstanceName) { - return getByResourceGroupAsync(resourceGroupName, sqlServerInstanceName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlServerInstanceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlServerInstanceName, context).block(); } /** @@ -620,28 +626,26 @@ public SqlServerInstanceInner getByResourceGroup(String resourceGroupName, Strin * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlServerInstance. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlServerInstanceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, sqlServerInstanceName, context).block(); + public SqlServerInstanceInner getByResourceGroup(String resourceGroupName, String sqlServerInstanceName) { + return getByResourceGroupWithResponse(resourceGroupName, sqlServerInstanceName, Context.NONE).getValue(); } /** * 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 +697,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 +755,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 +774,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 +812,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 +829,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 +850,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 +869,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 +892,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 +909,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 +930,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 +979,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 +1026,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 +1068,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 +1083,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 +1100,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 +1117,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 +1135,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 +1149,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 +1164,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 +1220,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,70 +1274,64 @@ 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( String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters) { return updateWithResponseAsync(resourceGroupName, sqlServerInstanceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 SqlServerInstanceInner update( - String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters) { - return updateAsync(resourceGroupName, sqlServerInstanceName, parameters).block(); + public Response updateWithResponse( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, sqlServerInstanceName, parameters, context).block(); } /** * 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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, sqlServerInstanceName, parameters, context).block(); + public SqlServerInstanceInner update( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters) { + return updateWithResponse(resourceGroupName, sqlServerInstanceName, parameters, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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) { @@ -1363,12 +1362,13 @@ private Mono> listNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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) { @@ -1399,11 +1399,12 @@ private Mono> listNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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) { @@ -1435,12 +1436,13 @@ private Mono> listByResourceGroupNextSingl /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

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 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 6aa95e680d2b..03f743c3e5f4 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; @@ -50,16 +49,6 @@ public PagedIterable listByResourceGroup(String resourceGroup return Utils.mapPage(inner, inner1 -> new SqlServerInstanceImpl(inner1, this.manager())); } - public SqlServerInstance getByResourceGroup(String resourceGroupName, String sqlServerInstanceName) { - SqlServerInstanceInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, sqlServerInstanceName); - if (inner != null) { - return new SqlServerInstanceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String sqlServerInstanceName, Context context) { Response inner = @@ -75,6 +64,16 @@ public Response getByResourceGroupWithResponse( } } + public SqlServerInstance getByResourceGroup(String resourceGroupName, String sqlServerInstanceName) { + SqlServerInstanceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, sqlServerInstanceName); + if (inner != null) { + return new SqlServerInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String sqlServerInstanceName) { this.serviceClient().delete(resourceGroupName, sqlServerInstanceName); } @@ -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 000000000000..688202544089 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/AccountProvisioningMode.java @@ -0,0 +1,38 @@ +// 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; + +/** The service account provisioning mode for this Active Directory connector. */ +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); + } + + /** + * Gets known AccountProvisioningMode values. + * + * @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 000000000000..d65217ffc9c7 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDnsDetails.java @@ -0,0 +1,143 @@ +// 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; + + /** Creates an instance of ActiveDirectoryConnectorDnsDetails class. */ + public ActiveDirectoryConnectorDnsDetails() { + } + + /** + * 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 000000000000..cafb2ba7ae51 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorDomainDetails.java @@ -0,0 +1,172 @@ +// 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") + private ActiveDirectoryDomainControllers domainControllers; + + /** Creates an instance of ActiveDirectoryConnectorDomainDetails class. */ + public ActiveDirectoryConnectorDomainDetails() { + } + + /** + * 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) { + 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 000000000000..17b8e175b009 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorListResult.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.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; + + /** Creates an instance of ActiveDirectoryConnectorListResult class. */ + public ActiveDirectoryConnectorListResult() { + } + + /** + * 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 000000000000..166e995ab20c --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorProperties.java @@ -0,0 +1,137 @@ +// 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; + + /** Creates an instance of ActiveDirectoryConnectorProperties class. */ + public ActiveDirectoryConnectorProperties() { + } + + /** + * 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 000000000000..c57003e90a4c --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorResource.java @@ -0,0 +1,123 @@ +// 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.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 000000000000..0664f57dd512 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorSpec.java @@ -0,0 +1,95 @@ +// 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; + + /** Creates an instance of ActiveDirectoryConnectorSpec class. */ + public ActiveDirectoryConnectorSpec() { + } + + /** + * 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 000000000000..1cfb32dabdb4 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryConnectorStatus.java @@ -0,0 +1,143 @@ +// 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; + + /** Creates an instance of ActiveDirectoryConnectorStatus class. */ + public ActiveDirectoryConnectorStatus() { + } + + /** + * 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 000000000000..c8b70e4a3661 --- /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. + * @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 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 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 000000000000..08600edda0a2 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainController.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.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; + + /** Creates an instance of ActiveDirectoryDomainController class. */ + public ActiveDirectoryDomainController() { + } + + /** + * 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 000000000000..bff848a0e61b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryDomainControllers.java @@ -0,0 +1,85 @@ +// 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; + + /** Creates an instance of ActiveDirectoryDomainControllers class. */ + public ActiveDirectoryDomainControllers() { + } + + /** + * 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 000000000000..e8781c586f87 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ActiveDirectoryInformation.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.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; + + /** Creates an instance of ActiveDirectoryInformation class. */ + public ActiveDirectoryInformation() { + } + + /** + * 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 1925e9d25024..fd189b88dd23 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,38 @@ 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"), +/** The license type to apply for this managed instance. */ +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; + /** + * Gets known ArcSqlManagedInstanceLicenseType values. + * + * @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/ArcSqlServerDatabaseListResult.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerDatabaseListResult.java new file mode 100644 index 000000000000..30588805804c --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerDatabaseListResult.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerDatabaseResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Arc Sql Server database. */ +@Immutable +public final class ArcSqlServerDatabaseListResult { + /* + * Array of Arc Sql Server database. + */ + @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; + + /** Creates an instance of ArcSqlServerDatabaseListResult class. */ + public ArcSqlServerDatabaseListResult() { + } + + /** + * Get the value property: Array of Arc Sql Server database. + * + * @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/ArcSqlServerLicenseType.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerLicenseType.java index 3c751f3fa80d..7ceb5bd3ecb6 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerLicenseType.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerLicenseType.java @@ -8,10 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ArcSqlServerLicenseType. */ +/** SQL Server license type. */ public final class ArcSqlServerLicenseType extends ExpandableStringEnum { - /** Static value Paid for ArcSqlServerLicenseType. */ - public static final ArcSqlServerLicenseType PAID = fromString("Paid"); + /** Static value Undefined for ArcSqlServerLicenseType. */ + public static final ArcSqlServerLicenseType UNDEFINED = fromString("Undefined"); /** Static value Free for ArcSqlServerLicenseType. */ public static final ArcSqlServerLicenseType FREE = fromString("Free"); @@ -19,8 +19,17 @@ public final class ArcSqlServerLicenseType extends ExpandableStringEnum values() { return values(ArcSqlServerLicenseType.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 271f94b853f1..232339f4a46d 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. */ @@ -26,6 +22,10 @@ public final class BasicLoginInformation { @JsonProperty(value = "password") private String password; + /** Creates an instance of BasicLoginInformation class. */ + public BasicLoginInformation() { + } + /** * Get the username property: 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 000000000000..9cf2b729cad8 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/CommonSku.java @@ -0,0 +1,171 @@ +// 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; + + /** Creates an instance of CommonSku class. */ + public CommonSku() { + } + + /** + * 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 a21bff9dbae5..7b917b4e1b5a 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ConnectionStatus. */ +/** The cloud connectivity status. */ public final class ConnectionStatus extends ExpandableStringEnum { /** Static value Connected for ConnectionStatus. */ public static final ConnectionStatus CONNECTED = fromString("Connected"); @@ -16,6 +16,9 @@ public final class ConnectionStatus extends ExpandableStringEnum values() { return values(ConnectionStatus.class); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerProperties.java index b4f99641c2a8..24c70ec0da5b 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerProperties.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerProperties.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; /** The data controller properties. */ @Fluent public final class DataControllerProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataControllerProperties.class); - /* * The infrastructure the data controller is running on. */ @@ -34,25 +30,36 @@ public final class DataControllerProperties { private Object k8SRaw; /* - * Properties on upload watermark. Mostly timestamp for each upload data - * type + * Properties on upload watermark. Mostly timestamp for each upload data type */ @JsonProperty(value = "uploadWatermark") private UploadWatermark uploadWatermark; /* - * Last uploaded date from Kubernetes cluster. Defaults to current date - * time + * Last uploaded date from Kubernetes cluster. Defaults to current date time */ @JsonProperty(value = "lastUploadedDate") private OffsetDateTime lastUploadedDate; /* - * Username and password for basic login authentication. + * Deprecated. Azure Arc Data Services data controller no longer expose any endpoint. All traffic are exposed + * through Kubernetes native API. */ @JsonProperty(value = "basicLoginInformation") private BasicLoginInformation basicLoginInformation; + /* + * Login credential for metrics dashboard on the Kubernetes cluster. + */ + @JsonProperty(value = "metricsDashboardCredential") + private BasicLoginInformation metricsDashboardCredential; + + /* + * Login credential for logs dashboard on the Kubernetes cluster. + */ + @JsonProperty(value = "logsDashboardCredential") + private BasicLoginInformation logsDashboardCredential; + /* * Log analytics workspace id and primary key */ @@ -60,31 +67,34 @@ public final class DataControllerProperties { private LogAnalyticsWorkspaceConfig logAnalyticsWorkspaceConfig; /* - * Service principal for uploading billing, metrics and logs. + * Deprecated. Service principal is deprecated in favor of Arc Kubernetes service extension managed identity. */ @JsonProperty(value = "uploadServicePrincipal") private UploadServicePrincipal uploadServicePrincipal; /* - * The provisioningState property. + * The provisioning state of the Arc Data Controller resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; /* - * If a CustomLocation is provided, this contains the ARM id of the - * connected cluster the custom location belongs to. + * If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs + * to. */ @JsonProperty(value = "clusterId") private String clusterId; /* - * If a CustomLocation is provided, this contains the ARM id of the - * extension the custom location belongs to. + * If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to. */ @JsonProperty(value = "extensionId") private String extensionId; + /** Creates an instance of DataControllerProperties class. */ + public DataControllerProperties() { + } + /** * Get the infrastructure property: The infrastructure the data controller is running on. * @@ -186,7 +196,8 @@ public DataControllerProperties withLastUploadedDate(OffsetDateTime lastUploaded } /** - * Get the basicLoginInformation property: Username and password for basic login authentication. + * Get the basicLoginInformation property: Deprecated. Azure Arc Data Services data controller no longer expose any + * endpoint. All traffic are exposed through Kubernetes native API. * * @return the basicLoginInformation value. */ @@ -195,7 +206,8 @@ public BasicLoginInformation basicLoginInformation() { } /** - * Set the basicLoginInformation property: Username and password for basic login authentication. + * Set the basicLoginInformation property: Deprecated. Azure Arc Data Services data controller no longer expose any + * endpoint. All traffic are exposed through Kubernetes native API. * * @param basicLoginInformation the basicLoginInformation value to set. * @return the DataControllerProperties object itself. @@ -205,6 +217,46 @@ public DataControllerProperties withBasicLoginInformation(BasicLoginInformation return this; } + /** + * Get the metricsDashboardCredential property: Login credential for metrics dashboard on the Kubernetes cluster. + * + * @return the metricsDashboardCredential value. + */ + public BasicLoginInformation metricsDashboardCredential() { + return this.metricsDashboardCredential; + } + + /** + * Set the metricsDashboardCredential property: Login credential for metrics dashboard on the Kubernetes cluster. + * + * @param metricsDashboardCredential the metricsDashboardCredential value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withMetricsDashboardCredential(BasicLoginInformation metricsDashboardCredential) { + this.metricsDashboardCredential = metricsDashboardCredential; + return this; + } + + /** + * Get the logsDashboardCredential property: Login credential for logs dashboard on the Kubernetes cluster. + * + * @return the logsDashboardCredential value. + */ + public BasicLoginInformation logsDashboardCredential() { + return this.logsDashboardCredential; + } + + /** + * Set the logsDashboardCredential property: Login credential for logs dashboard on the Kubernetes cluster. + * + * @param logsDashboardCredential the logsDashboardCredential value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withLogsDashboardCredential(BasicLoginInformation logsDashboardCredential) { + this.logsDashboardCredential = logsDashboardCredential; + return this; + } + /** * Get the logAnalyticsWorkspaceConfig property: Log analytics workspace id and primary key. * @@ -227,7 +279,8 @@ public DataControllerProperties withLogAnalyticsWorkspaceConfig( } /** - * Get the uploadServicePrincipal property: Service principal for uploading billing, metrics and logs. + * Get the uploadServicePrincipal property: Deprecated. Service principal is deprecated in favor of Arc Kubernetes + * service extension managed identity. * * @return the uploadServicePrincipal value. */ @@ -236,7 +289,8 @@ public UploadServicePrincipal uploadServicePrincipal() { } /** - * Set the uploadServicePrincipal property: Service principal for uploading billing, metrics and logs. + * Set the uploadServicePrincipal property: Deprecated. Service principal is deprecated in favor of Arc Kubernetes + * service extension managed identity. * * @param uploadServicePrincipal the uploadServicePrincipal value to set. * @return the DataControllerProperties object itself. @@ -247,7 +301,7 @@ public DataControllerProperties withUploadServicePrincipal(UploadServicePrincipa } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: The provisioning state of the Arc Data Controller resource. * * @return the provisioningState value. */ @@ -314,6 +368,12 @@ public void validate() { if (basicLoginInformation() != null) { basicLoginInformation().validate(); } + if (metricsDashboardCredential() != null) { + metricsDashboardCredential().validate(); + } + if (logsDashboardCredential() != null) { + logsDashboardCredential().validate(); + } if (logAnalyticsWorkspaceConfig() != null) { logAnalyticsWorkspaceConfig().validate(); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerResource.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerResource.java index 139216842e72..b86d3a8a6ee9 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerResource.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerResource.java @@ -62,7 +62,7 @@ public interface DataControllerResource { DataControllerProperties 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. */ @@ -82,6 +82,13 @@ public interface DataControllerResource { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.DataControllerResourceInner object. * @@ -189,7 +196,7 @@ interface WithExtendedLocation { DataControllerResource.Update update(); /** The template for DataControllerResource update. */ - interface Update extends UpdateStages.WithTags { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -217,6 +224,16 @@ interface WithTags { */ Update withTags(Map 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 40c162932c27..867519ef9b1f 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,16 @@ 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; + + /** Creates an instance of DataControllerUpdate class. */ + public DataControllerUpdate() { + } + /** * Get the tags property: Resource tags. * @@ -43,11 +49,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 579daa945c48..ffea161bb378 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,27 +80,27 @@ 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}. */ - DataControllerResource getByResourceGroup(String resourceGroupName, String dataControllerName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String dataControllerName, Context context); /** * Retrieves a dataController resource. * * @param resourceGroupName The name of the Azure resource group. - * @param dataControllerName The dataControllerName parameter. - * @param context The context to associate with this operation. + * @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 data controller resource. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String dataControllerName, Context context); + DataControllerResource getByResourceGroup(String resourceGroupName, String dataControllerName); /** * Retrieves a dataController resource. @@ -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/DatabaseState.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DatabaseState.java new file mode 100644 index 000000000000..4beb735785af --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DatabaseState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the database. */ +public final class DatabaseState extends ExpandableStringEnum { + /** Static value Online for DatabaseState. */ + public static final DatabaseState ONLINE = fromString("Online"); + + /** Static value Restoring for DatabaseState. */ + public static final DatabaseState RESTORING = fromString("Restoring"); + + /** Static value Recovering for DatabaseState. */ + public static final DatabaseState RECOVERING = fromString("Recovering"); + + /** Static value RecoveryPending for DatabaseState. */ + public static final DatabaseState RECOVERY_PENDING = fromString("RecoveryPending"); + + /** Static value Suspect for DatabaseState. */ + public static final DatabaseState SUSPECT = fromString("Suspect"); + + /** Static value Emergency for DatabaseState. */ + public static final DatabaseState EMERGENCY = fromString("Emergency"); + + /** Static value Offline for DatabaseState. */ + public static final DatabaseState OFFLINE = fromString("Offline"); + + /** Static value Copying for DatabaseState. */ + public static final DatabaseState COPYING = fromString("Copying"); + + /** Static value OfflineSecondary for DatabaseState. */ + public static final DatabaseState OFFLINE_SECONDARY = fromString("OfflineSecondary"); + + /** + * Creates or finds a DatabaseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabaseState. + */ + @JsonCreator + public static DatabaseState fromString(String name) { + return fromString(name, DatabaseState.class); + } + + /** + * Gets known DatabaseState values. + * + * @return known DatabaseState values. + */ + public static Collection values() { + return values(DatabaseState.class); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DefenderStatus.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DefenderStatus.java index 7ff84b64165d..a20fbdb9a154 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DefenderStatus.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DefenderStatus.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DefenderStatus. */ +/** Status of Azure Defender. */ public final class DefenderStatus extends ExpandableStringEnum { /** Static value Protected for DefenderStatus. */ public static final DefenderStatus PROTECTED = fromString("Protected"); @@ -30,7 +30,11 @@ public static DefenderStatus fromString(String name) { return fromString(name, DefenderStatus.class); } - /** @return known DefenderStatus values. */ + /** + * Gets known DefenderStatus values. + * + * @return known DefenderStatus values. + */ public static Collection values() { return values(DefenderStatus.class); } diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/EditionType.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/EditionType.java index 25c796eb8f33..e8147b2eeb85 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/EditionType.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/EditionType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for EditionType. */ +/** SQL Server edition. */ public final class EditionType extends ExpandableStringEnum { /** Static value Evaluation for EditionType. */ public static final EditionType EVALUATION = fromString("Evaluation"); @@ -39,7 +39,11 @@ public static EditionType fromString(String name) { return fromString(name, EditionType.class); } - /** @return known EditionType values. */ + /** + * Gets known EditionType values. + * + * @return known EditionType values. + */ public static Collection values() { return values(EditionType.class); } 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 cddf67c1c4af..273f847667e9 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. */ @@ -26,6 +22,10 @@ public final class ExtendedLocation { @JsonProperty(value = "type") private ExtendedLocationTypes type; + /** Creates an instance of ExtendedLocation class. */ + public ExtendedLocation() { + } + /** * Get the name property: The name of the extended location. * diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocationTypes.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocationTypes.java index a1b6c00434fc..7b5332a0b7ca 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocationTypes.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocationTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ExtendedLocationTypes. */ +/** The type of extendedLocation. */ public final class ExtendedLocationTypes extends ExpandableStringEnum { /** Static value CustomLocation for ExtendedLocationTypes. */ public static final ExtendedLocationTypes CUSTOM_LOCATION = fromString("CustomLocation"); @@ -24,7 +24,11 @@ public static ExtendedLocationTypes fromString(String name) { return fromString(name, ExtendedLocationTypes.class); } - /** @return known ExtendedLocationTypes values. */ + /** + * Gets known ExtendedLocationTypes values. + * + * @return known ExtendedLocationTypes values. + */ public static Collection values() { return values(ExtendedLocationTypes.class); } 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 000000000000..cf2eca078e70 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/HostType.java @@ -0,0 +1,71 @@ +// 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; + +/** Type of host for Azure Arc SQL Server. */ +public final class HostType extends ExpandableStringEnum { + /** Static value Azure Virtual Machine for HostType. */ + public static final HostType AZURE_VIRTUAL_MACHINE = fromString("Azure Virtual Machine"); + + /** Static value Azure VMWare Virtual Machine for HostType. */ + public static final HostType AZURE_VMWARE_VIRTUAL_MACHINE = fromString("Azure VMWare Virtual Machine"); + + /** Static value Azure Kubernetes Service for HostType. */ + public static final HostType AZURE_KUBERNETES_SERVICE = fromString("Azure Kubernetes Service"); + + /** Static value AWS VMWare Virtual Machine for HostType. */ + public static final HostType AWS_VMWARE_VIRTUAL_MACHINE = fromString("AWS VMWare Virtual Machine"); + + /** Static value AWS Kubernetes Service for HostType. */ + public static final HostType AWS_KUBERNETES_SERVICE = fromString("AWS Kubernetes Service"); + + /** Static value GCP VMWare Virtual Machine for HostType. */ + public static final HostType GCP_VMWARE_VIRTUAL_MACHINE = fromString("GCP VMWare Virtual Machine"); + + /** Static value GCP Kubernetes Service for HostType. */ + public static final HostType GCP_KUBERNETES_SERVICE = fromString("GCP Kubernetes Service"); + + /** Static value Container for HostType. */ + public static final HostType CONTAINER = fromString("Container"); + + /** 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); + } + + /** + * Gets known HostType values. + * + * @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/Infrastructure.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Infrastructure.java index b5cabc082160..802e09aee7b7 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Infrastructure.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Infrastructure.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for Infrastructure. */ +/** The infrastructure the data controller is running on. */ public enum Infrastructure { /** Enum value azure. */ AZURE("azure"), @@ -42,6 +42,9 @@ public enum Infrastructure { */ @JsonCreator public static Infrastructure fromString(String value) { + if (value == null) { + return null; + } Infrastructure[] items = Infrastructure.values(); for (Infrastructure item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -51,6 +54,7 @@ public static Infrastructure fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 c39a6e3fa992..591b8dd608d8 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,12 +16,9 @@ /** 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, - * minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is + * 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, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ @JsonProperty(value = "requests") @@ -30,9 +26,8 @@ public final class K8SResourceRequirements { private Map requests; /* - * Limits 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, - * minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is + * Limits 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, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. */ @JsonProperty(value = "limits") @@ -40,11 +35,14 @@ public final class K8SResourceRequirements { private Map limits; /* - * The kubernetes resource limits and requests used to restrict or reserve - * resource usage. + * The kubernetes resource limits and requests used to restrict or reserve resource usage. */ @JsonIgnore private Map additionalProperties; + /** Creates an instance of K8SResourceRequirements class. */ + public K8SResourceRequirements() { + } + /** * Get the requests property: 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, minimum is 1. Default 'memory' is '4Gi', minimum is 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 44acafd387b9..dadc09db3502 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,11 +15,9 @@ /** 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 + * The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to + * host the database service */ @JsonProperty(value = "default") private K8SSchedulingOptions defaultProperty; @@ -30,6 +27,10 @@ public final class K8SScheduling { */ @JsonIgnore private Map additionalProperties; + /** Creates an instance of K8SScheduling class. */ + public K8SScheduling() { + } + /** * Get the defaultProperty property: 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 8fe21837d997..e8ad00b02966 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,21 +18,22 @@ */ @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. + * The kubernetes resource limits and requests used to restrict or reserve resource usage. */ @JsonProperty(value = "resources") private K8SResourceRequirements resources; /* - * The kubernetes scheduling options. It describes restrictions used to - * help Kubernetes select appropriate nodes to host the database service + * The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to + * host the database service */ @JsonIgnore private Map additionalProperties; + /** Creates an instance of K8SSchedulingOptions class. */ + public K8SSchedulingOptions() { + } + /** * Get the resources property: 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 000000000000..73838b5eb5af --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/KeytabInformation.java @@ -0,0 +1,50 @@ +// 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; + + /** Creates an instance of KeytabInformation class. */ + public KeytabInformation() { + } + + /** + * 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 52f6ba78ccaf..b5b5e7d56011 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 */ @@ -27,6 +23,10 @@ public final class LogAnalyticsWorkspaceConfig { @JsonProperty(value = "primaryKey") private String primaryKey; + /** Creates an instance of LogAnalyticsWorkspaceConfig class. */ + public LogAnalyticsWorkspaceConfig() { + } + /** * Get the workspaceId property: 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 750a06ada079..000000000000 --- 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 8073a44675bb..cfbc0babe070 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 */ @@ -22,19 +19,21 @@ public final class OnPremiseProperty { private UUID id; /* - * Certificate that contains the Kubernetes cluster public key used to - * verify signing + * Certificate that contains the Kubernetes cluster public key used to verify signing */ @JsonProperty(value = "publicSigningKey", required = true) private String publicSigningKey; /* - * Unique thumbprint returned to customer to verify the certificate being - * uploaded + * Unique thumbprint returned to customer to verify the certificate being uploaded */ @JsonProperty(value = "signingCertificateThumbprint") private String signingCertificateThumbprint; + /** Creates an instance of OnPremiseProperty class. */ + public OnPremiseProperty() { + } + /** * Get the id property: A globally unique ID identifying the associated Kubernetes cluster. * @@ -106,15 +105,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 900ac0a42440..88a3cb32a929 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. */ @@ -21,8 +18,7 @@ public final class OperationDisplay { private String provider; /* - * The localized friendly form of the resource type related to this - * action/operation. + * The localized friendly form of the resource type related to this action/operation. */ @JsonProperty(value = "resource", required = true) private String resource; @@ -39,6 +35,10 @@ public final class OperationDisplay { @JsonProperty(value = "description", required = true) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name. * @@ -126,24 +126,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 79077e77c321..383744f394f4 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. */ @@ -28,6 +24,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: Array of results. * diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java index 2d073d99bf58..e7516153dae3 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for OperationOrigin. */ +/** The intended executor of the operation. */ public final class OperationOrigin extends ExpandableStringEnum { /** Static value user for OperationOrigin. */ public static final OperationOrigin USER = fromString("user"); @@ -27,7 +27,11 @@ public static OperationOrigin fromString(String name) { return fromString(name, OperationOrigin.class); } - /** @return known OperationOrigin values. */ + /** + * Gets known OperationOrigin values. + * + * @return known OperationOrigin values. + */ public static Collection values() { return values(OperationOrigin.class); } 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 83a59ffdfc07..c93a1a532c35 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 444b1b8bf193..7609b45c0ba4 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; @@ -28,8 +24,12 @@ public final class PageOfDataControllerResource { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of PageOfDataControllerResource class. */ + public PageOfDataControllerResource() { + } + /** - * Get the value property: The value property. + * Get the value property: Array of results. * * @return the value value. */ @@ -38,7 +38,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 000000000000..ad1a5cb7c400 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstance.java @@ -0,0 +1,270 @@ +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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 000000000000..d97efe6f250d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceListResult.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.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; + + /** Creates an instance of PostgresInstanceListResult class. */ + public PostgresInstanceListResult() { + } + + /** + * 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 000000000000..7ea10926c65f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceProperties.java @@ -0,0 +1,173 @@ +// 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; + + /** Creates an instance of PostgresInstanceProperties class. */ + public PostgresInstanceProperties() { + } + + /** + * 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 000000000000..447cfb3301ff --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSku.java @@ -0,0 +1,89 @@ +// 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; + + /** Creates an instance of PostgresInstanceSku class. */ + public PostgresInstanceSku() { + } + + /** + * 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 000000000000..e98ec41214b1 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceSkuTier.java @@ -0,0 +1,48 @@ +// 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; + +/** This field is required to be implemented by the Resource Provider if the service has more than one tier. */ +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) { + if (value == null) { + return null; + } + PostgresInstanceSkuTier[] items = PostgresInstanceSkuTier.values(); + for (PostgresInstanceSkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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 000000000000..0c65194705de --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstanceUpdate.java @@ -0,0 +1,82 @@ +// 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; + + /** Creates an instance of PostgresInstanceUpdate class. */ + public PostgresInstanceUpdate() { + } + + /** + * 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 000000000000..62076b56c9dd --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PostgresInstances.java @@ -0,0 +1,160 @@ +// 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); + + /** + * List postgres Instance resources in the resource group + * + *

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); + + /** + * List postgres Instance resources in the resource group + * + *

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. + * @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); + + /** + * 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); + + /** + * 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/RecoveryMode.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/RecoveryMode.java new file mode 100644 index 000000000000..82e471cbb5c2 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/RecoveryMode.java @@ -0,0 +1,41 @@ +// 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; + +/** Status of the database. */ +public final class RecoveryMode extends ExpandableStringEnum { + /** Static value Full for RecoveryMode. */ + public static final RecoveryMode FULL = fromString("Full"); + + /** Static value Bulk-logged for RecoveryMode. */ + public static final RecoveryMode BULK_LOGGED = fromString("Bulk-logged"); + + /** Static value Simple for RecoveryMode. */ + public static final RecoveryMode SIMPLE = fromString("Simple"); + + /** + * Creates or finds a RecoveryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecoveryMode. + */ + @JsonCreator + public static RecoveryMode fromString(String name) { + return fromString(name, RecoveryMode.class); + } + + /** + * Gets known RecoveryMode values. + * + * @return known RecoveryMode values. + */ + public static Collection values() { + return values(RecoveryMode.class); + } +} 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 fc3534446c6e..41abf6916682 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 @@ -69,7 +69,7 @@ public interface SqlManagedInstance { SqlManagedInstanceSku sku(); /** - * 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. */ @@ -89,6 +89,13 @@ public interface SqlManagedInstance { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.SqlManagedInstanceInner object. * 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 ea188cdfcb7c..2d42dae51019 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. */ @@ -29,6 +26,10 @@ public final class SqlManagedInstanceK8SRaw { */ @JsonIgnore private Map additionalProperties; + /** Creates an instance of SqlManagedInstanceK8SRaw class. */ + public SqlManagedInstanceK8SRaw() { + } + /** * Get the spec property: 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 b51d71b843f5..0e1488f60a7d 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. */ @@ -25,11 +22,9 @@ public final class SqlManagedInstanceK8SSpec { private K8SScheduling scheduling; /* - * This option specifies the number of SQL Managed Instance replicas that - * will be deployed in your Kubernetes cluster for high availability - * purposes. If sku.tier is BusinessCritical, allowed values are '2' or '3' - * with default of '3'. If sku.tier is GeneralPurpose, replicas must be - * '1'. + * This option specifies the number of SQL Managed Instance replicas that will be deployed in your Kubernetes + * cluster for high availability purposes. If sku.tier is BusinessCritical, allowed values are '2' or '3' with + * default of '3'. If sku.tier is GeneralPurpose, replicas must be '1'. */ @JsonProperty(value = "replicas") private Integer replicas; @@ -39,6 +34,10 @@ public final class SqlManagedInstanceK8SSpec { */ @JsonIgnore private Map additionalProperties; + /** Creates an instance of SqlManagedInstanceK8SSpec class. */ + public SqlManagedInstanceK8SSpec() { + } + /** * Get the scheduling property: 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 8e45487f24d7..9d19c43f2d10 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. */ @@ -28,6 +24,10 @@ public final class SqlManagedInstanceListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of SqlManagedInstanceListResult class. */ + public SqlManagedInstanceListResult() { + } + /** * Get the value property: 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 e4151ce5bcee..d4087ab2a0b8 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 */ @@ -52,18 +48,23 @@ public final class SqlManagedInstanceProperties { private BasicLoginInformation basicLoginInformation; /* - * Last uploaded date from Kubernetes cluster. Defaults to current date - * time + * Last uploaded date from Kubernetes cluster. Defaults to current date time */ @JsonProperty(value = "lastUploadedDate") 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. */ @@ -71,19 +72,22 @@ public final class SqlManagedInstanceProperties { private ArcSqlManagedInstanceLicenseType licenseType; /* - * If a CustomLocation is provided, this contains the ARM id of the - * connected cluster the custom location belongs to. + * If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom location belongs + * to. */ @JsonProperty(value = "clusterId") private String clusterId; /* - * If a CustomLocation is provided, this contains the ARM id of the - * extension the custom location belongs to. + * If a CustomLocation is provided, this contains the ARM id of the extension the custom location belongs to. */ @JsonProperty(value = "extensionId") private String extensionId; + /** Creates an instance of SqlManagedInstanceProperties class. */ + public SqlManagedInstanceProperties() { + } + /** * Get the dataControllerId property: null. * @@ -225,7 +229,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 +237,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 +334,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 b3de6cf37336..22b6df38ce90 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. @@ -27,27 +23,26 @@ public final class SqlManagedInstanceSku { private SqlManagedInstanceSkuTier tier; /* - * Whether dev/test is enabled. When the dev field is set to true, the - * resource is used for dev/test purpose. + * 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. + * 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; /* - * 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 +137,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 +146,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 +157,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 +166,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/SqlManagedInstanceSkuTier.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSkuTier.java index fa996f76e3d4..622397928ed4 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSkuTier.java +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSkuTier.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for SqlManagedInstanceSkuTier. */ +/** The pricing tier for the instance. */ public enum SqlManagedInstanceSkuTier { /** Enum value GeneralPurpose. */ GENERAL_PURPOSE("GeneralPurpose"), @@ -30,6 +30,9 @@ public enum SqlManagedInstanceSkuTier { */ @JsonCreator public static SqlManagedInstanceSkuTier fromString(String value) { + if (value == null) { + return null; + } SqlManagedInstanceSkuTier[] items = SqlManagedInstanceSkuTier.values(); for (SqlManagedInstanceSkuTier item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static SqlManagedInstanceSkuTier fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { 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 f5dd0d8e9a47..57ca515729f9 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. */ @@ -23,6 +19,10 @@ public final class SqlManagedInstanceUpdate { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of SqlManagedInstanceUpdate class. */ + public SqlManagedInstanceUpdate() { + } + /** * Get the tags property: 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 3c2fae966ded..17e7d613ba15 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,30 +26,34 @@ 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); /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 all sqlManagedInstances in a resource group. + * @return all sqlManagedInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets all sqlManagedInstances in a resource group. + * List sqlManagedInstance resources in the resource group + * + *

Gets all sqlManagedInstances in a resource group. * * @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 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); @@ -58,32 +62,32 @@ public interface SqlManagedInstances { * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlManagedInstance. + * @return a SqlManagedInstance along with {@link Response}. */ - SqlManagedInstance getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlManagedInstanceName, Context context); /** * Retrieves a SQL Managed Instance resource. * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlManagedInstance. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlManagedInstanceName, Context context); + SqlManagedInstance getByResourceGroup(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. * @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 +98,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 +113,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 +125,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/SqlServerDatabaseResource.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResource.java new file mode 100644 index 000000000000..90546fce7cd2 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResource.java @@ -0,0 +1,236 @@ +// 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.SqlServerDatabaseResourceInner; +import java.util.Map; + +/** An immutable client-side representation of SqlServerDatabaseResource. */ +public interface SqlServerDatabaseResource { + /** + * 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 properties property: Properties of Arc Sql Server database. + * + * @return the properties value. + */ + SqlServerDatabaseResourceProperties properties(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerDatabaseResourceInner object. + * + * @return the inner object. + */ + SqlServerDatabaseResourceInner innerModel(); + + /** The entirety of the SqlServerDatabaseResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The SqlServerDatabaseResource definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlServerDatabaseResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SqlServerDatabaseResource 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the SqlServerDatabaseResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sqlServerInstanceName. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @return the next definition stage. + */ + WithProperties withExistingSqlServerInstance(String resourceGroupName, String sqlServerInstanceName); + } + /** The stage of the SqlServerDatabaseResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Arc Sql Server database. + * + * @param properties Properties of Arc Sql Server database. + * @return the next definition stage. + */ + WithCreate withProperties(SqlServerDatabaseResourceProperties properties); + } + /** + * The stage of the SqlServerDatabaseResource 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlServerDatabaseResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlServerDatabaseResource create(Context context); + } + /** The stage of the SqlServerDatabaseResource 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); + } + } + /** + * Begins update for the SqlServerDatabaseResource resource. + * + * @return the stage of resource update. + */ + SqlServerDatabaseResource.Update update(); + + /** The template for SqlServerDatabaseResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlServerDatabaseResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlServerDatabaseResource apply(Context context); + } + /** The SqlServerDatabaseResource update stages. */ + interface UpdateStages { + /** The stage of the SqlServerDatabaseResource 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 SqlServerDatabaseResource 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(SqlServerDatabaseResourceProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlServerDatabaseResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlServerDatabaseResource refresh(Context context); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourceProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourceProperties.java new file mode 100644 index 000000000000..38e4a6b65566 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourceProperties.java @@ -0,0 +1,308 @@ +// 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; + +/** The properties of Arc Sql Server database resource. */ +@Fluent +public final class SqlServerDatabaseResourceProperties { + /* + * Collation of the database. + */ + @JsonProperty(value = "collationName") + private String collationName; + + /* + * Creation date of the database. + */ + @JsonProperty(value = "databaseCreationDate") + private OffsetDateTime databaseCreationDate; + + /* + * Compatibility level of the database + */ + @JsonProperty(value = "compatibilityLevel") + private Integer compatibilityLevel; + + /* + * Size of the database. + */ + @JsonProperty(value = "sizeMB") + private Float sizeMB; + + /* + * Space left of the database. + */ + @JsonProperty(value = "spaceAvailableMB") + private Float spaceAvailableMB; + + /* + * State of the database. + */ + @JsonProperty(value = "state") + private DatabaseState state; + + /* + * Whether the database is read only or not. + */ + @JsonProperty(value = "isReadOnly") + private Boolean isReadOnly; + + /* + * Status of the database. + */ + @JsonProperty(value = "recoveryMode") + private RecoveryMode recoveryMode; + + /* + * List of features that are enabled for the database + */ + @JsonProperty(value = "databaseOptions") + private SqlServerDatabaseResourcePropertiesDatabaseOptions databaseOptions; + + /* + * The backupInformation property. + */ + @JsonProperty(value = "backupInformation") + private SqlServerDatabaseResourcePropertiesBackupInformation backupInformation; + + /* + * The provisioning state of the Arc-enabled SQL Server database resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of SqlServerDatabaseResourceProperties class. */ + public SqlServerDatabaseResourceProperties() { + } + + /** + * Get the collationName property: Collation of the database. + * + * @return the collationName value. + */ + public String collationName() { + return this.collationName; + } + + /** + * Set the collationName property: Collation of the database. + * + * @param collationName the collationName value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withCollationName(String collationName) { + this.collationName = collationName; + return this; + } + + /** + * Get the databaseCreationDate property: Creation date of the database. + * + * @return the databaseCreationDate value. + */ + public OffsetDateTime databaseCreationDate() { + return this.databaseCreationDate; + } + + /** + * Set the databaseCreationDate property: Creation date of the database. + * + * @param databaseCreationDate the databaseCreationDate value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withDatabaseCreationDate(OffsetDateTime databaseCreationDate) { + this.databaseCreationDate = databaseCreationDate; + return this; + } + + /** + * Get the compatibilityLevel property: Compatibility level of the database. + * + * @return the compatibilityLevel value. + */ + public Integer compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Set the compatibilityLevel property: Compatibility level of the database. + * + * @param compatibilityLevel the compatibilityLevel value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withCompatibilityLevel(Integer compatibilityLevel) { + this.compatibilityLevel = compatibilityLevel; + return this; + } + + /** + * Get the sizeMB property: Size of the database. + * + * @return the sizeMB value. + */ + public Float sizeMB() { + return this.sizeMB; + } + + /** + * Set the sizeMB property: Size of the database. + * + * @param sizeMB the sizeMB value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withSizeMB(Float sizeMB) { + this.sizeMB = sizeMB; + return this; + } + + /** + * Get the spaceAvailableMB property: Space left of the database. + * + * @return the spaceAvailableMB value. + */ + public Float spaceAvailableMB() { + return this.spaceAvailableMB; + } + + /** + * Set the spaceAvailableMB property: Space left of the database. + * + * @param spaceAvailableMB the spaceAvailableMB value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withSpaceAvailableMB(Float spaceAvailableMB) { + this.spaceAvailableMB = spaceAvailableMB; + return this; + } + + /** + * Get the state property: State of the database. + * + * @return the state value. + */ + public DatabaseState state() { + return this.state; + } + + /** + * Set the state property: State of the database. + * + * @param state the state value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withState(DatabaseState state) { + this.state = state; + return this; + } + + /** + * Get the isReadOnly property: Whether the database is read only or not. + * + * @return the isReadOnly value. + */ + public Boolean isReadOnly() { + return this.isReadOnly; + } + + /** + * Set the isReadOnly property: Whether the database is read only or not. + * + * @param isReadOnly the isReadOnly value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withIsReadOnly(Boolean isReadOnly) { + this.isReadOnly = isReadOnly; + return this; + } + + /** + * Get the recoveryMode property: Status of the database. + * + * @return the recoveryMode value. + */ + public RecoveryMode recoveryMode() { + return this.recoveryMode; + } + + /** + * Set the recoveryMode property: Status of the database. + * + * @param recoveryMode the recoveryMode value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withRecoveryMode(RecoveryMode recoveryMode) { + this.recoveryMode = recoveryMode; + return this; + } + + /** + * Get the databaseOptions property: List of features that are enabled for the database. + * + * @return the databaseOptions value. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions databaseOptions() { + return this.databaseOptions; + } + + /** + * Set the databaseOptions property: List of features that are enabled for the database. + * + * @param databaseOptions the databaseOptions value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withDatabaseOptions( + SqlServerDatabaseResourcePropertiesDatabaseOptions databaseOptions) { + this.databaseOptions = databaseOptions; + return this; + } + + /** + * Get the backupInformation property: The backupInformation property. + * + * @return the backupInformation value. + */ + public SqlServerDatabaseResourcePropertiesBackupInformation backupInformation() { + return this.backupInformation; + } + + /** + * Set the backupInformation property: The backupInformation property. + * + * @param backupInformation the backupInformation value to set. + * @return the SqlServerDatabaseResourceProperties object itself. + */ + public SqlServerDatabaseResourceProperties withBackupInformation( + SqlServerDatabaseResourcePropertiesBackupInformation backupInformation) { + this.backupInformation = backupInformation; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Arc-enabled SQL Server database resource. + * + * @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 (databaseOptions() != null) { + databaseOptions().validate(); + } + if (backupInformation() != null) { + backupInformation().validate(); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourcePropertiesBackupInformation.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourcePropertiesBackupInformation.java new file mode 100644 index 000000000000..3c7fe14b15a8 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourcePropertiesBackupInformation.java @@ -0,0 +1,77 @@ +// 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; + +/** The SqlServerDatabaseResourcePropertiesBackupInformation model. */ +@Fluent +public final class SqlServerDatabaseResourcePropertiesBackupInformation { + /* + * Date time of last full backup. + */ + @JsonProperty(value = "lastFullBackup") + private OffsetDateTime lastFullBackup; + + /* + * Date time of last log backup. + */ + @JsonProperty(value = "lastLogBackup") + private OffsetDateTime lastLogBackup; + + /** Creates an instance of SqlServerDatabaseResourcePropertiesBackupInformation class. */ + public SqlServerDatabaseResourcePropertiesBackupInformation() { + } + + /** + * Get the lastFullBackup property: Date time of last full backup. + * + * @return the lastFullBackup value. + */ + public OffsetDateTime lastFullBackup() { + return this.lastFullBackup; + } + + /** + * Set the lastFullBackup property: Date time of last full backup. + * + * @param lastFullBackup the lastFullBackup value to set. + * @return the SqlServerDatabaseResourcePropertiesBackupInformation object itself. + */ + public SqlServerDatabaseResourcePropertiesBackupInformation withLastFullBackup(OffsetDateTime lastFullBackup) { + this.lastFullBackup = lastFullBackup; + return this; + } + + /** + * Get the lastLogBackup property: Date time of last log backup. + * + * @return the lastLogBackup value. + */ + public OffsetDateTime lastLogBackup() { + return this.lastLogBackup; + } + + /** + * Set the lastLogBackup property: Date time of last log backup. + * + * @param lastLogBackup the lastLogBackup value to set. + * @return the SqlServerDatabaseResourcePropertiesBackupInformation object itself. + */ + public SqlServerDatabaseResourcePropertiesBackupInformation withLastLogBackup(OffsetDateTime lastLogBackup) { + this.lastLogBackup = lastLogBackup; + 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/SqlServerDatabaseResourcePropertiesDatabaseOptions.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourcePropertiesDatabaseOptions.java new file mode 100644 index 000000000000..70da07b3ea19 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseResourcePropertiesDatabaseOptions.java @@ -0,0 +1,234 @@ +// 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; + +/** List of features that are enabled for the database. */ +@Fluent +public final class SqlServerDatabaseResourcePropertiesDatabaseOptions { + /* + * The isAutoCloseOn property. + */ + @JsonProperty(value = "isAutoCloseOn") + private Boolean isAutoCloseOn; + + /* + * The isAutoShrinkOn property. + */ + @JsonProperty(value = "isAutoShrinkOn") + private Boolean isAutoShrinkOn; + + /* + * The isAutoCreateStatsOn property. + */ + @JsonProperty(value = "isAutoCreateStatsOn") + private Boolean isAutoCreateStatsOn; + + /* + * The isAutoUpdateStatsOn property. + */ + @JsonProperty(value = "isAutoUpdateStatsOn") + private Boolean isAutoUpdateStatsOn; + + /* + * The isRemoteDataArchiveEnabled property. + */ + @JsonProperty(value = "isRemoteDataArchiveEnabled") + private Boolean isRemoteDataArchiveEnabled; + + /* + * The isMemoryOptimizationEnabled property. + */ + @JsonProperty(value = "isMemoryOptimizationEnabled") + private Boolean isMemoryOptimizationEnabled; + + /* + * The isEncrypted property. + */ + @JsonProperty(value = "isEncrypted") + private Boolean isEncrypted; + + /* + * The isTrustworthyOn property. + */ + @JsonProperty(value = "isTrustworthyOn") + private Boolean isTrustworthyOn; + + /** Creates an instance of SqlServerDatabaseResourcePropertiesDatabaseOptions class. */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions() { + } + + /** + * Get the isAutoCloseOn property: The isAutoCloseOn property. + * + * @return the isAutoCloseOn value. + */ + public Boolean isAutoCloseOn() { + return this.isAutoCloseOn; + } + + /** + * Set the isAutoCloseOn property: The isAutoCloseOn property. + * + * @param isAutoCloseOn the isAutoCloseOn value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsAutoCloseOn(Boolean isAutoCloseOn) { + this.isAutoCloseOn = isAutoCloseOn; + return this; + } + + /** + * Get the isAutoShrinkOn property: The isAutoShrinkOn property. + * + * @return the isAutoShrinkOn value. + */ + public Boolean isAutoShrinkOn() { + return this.isAutoShrinkOn; + } + + /** + * Set the isAutoShrinkOn property: The isAutoShrinkOn property. + * + * @param isAutoShrinkOn the isAutoShrinkOn value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsAutoShrinkOn(Boolean isAutoShrinkOn) { + this.isAutoShrinkOn = isAutoShrinkOn; + return this; + } + + /** + * Get the isAutoCreateStatsOn property: The isAutoCreateStatsOn property. + * + * @return the isAutoCreateStatsOn value. + */ + public Boolean isAutoCreateStatsOn() { + return this.isAutoCreateStatsOn; + } + + /** + * Set the isAutoCreateStatsOn property: The isAutoCreateStatsOn property. + * + * @param isAutoCreateStatsOn the isAutoCreateStatsOn value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsAutoCreateStatsOn(Boolean isAutoCreateStatsOn) { + this.isAutoCreateStatsOn = isAutoCreateStatsOn; + return this; + } + + /** + * Get the isAutoUpdateStatsOn property: The isAutoUpdateStatsOn property. + * + * @return the isAutoUpdateStatsOn value. + */ + public Boolean isAutoUpdateStatsOn() { + return this.isAutoUpdateStatsOn; + } + + /** + * Set the isAutoUpdateStatsOn property: The isAutoUpdateStatsOn property. + * + * @param isAutoUpdateStatsOn the isAutoUpdateStatsOn value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsAutoUpdateStatsOn(Boolean isAutoUpdateStatsOn) { + this.isAutoUpdateStatsOn = isAutoUpdateStatsOn; + return this; + } + + /** + * Get the isRemoteDataArchiveEnabled property: The isRemoteDataArchiveEnabled property. + * + * @return the isRemoteDataArchiveEnabled value. + */ + public Boolean isRemoteDataArchiveEnabled() { + return this.isRemoteDataArchiveEnabled; + } + + /** + * Set the isRemoteDataArchiveEnabled property: The isRemoteDataArchiveEnabled property. + * + * @param isRemoteDataArchiveEnabled the isRemoteDataArchiveEnabled value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsRemoteDataArchiveEnabled( + Boolean isRemoteDataArchiveEnabled) { + this.isRemoteDataArchiveEnabled = isRemoteDataArchiveEnabled; + return this; + } + + /** + * Get the isMemoryOptimizationEnabled property: The isMemoryOptimizationEnabled property. + * + * @return the isMemoryOptimizationEnabled value. + */ + public Boolean isMemoryOptimizationEnabled() { + return this.isMemoryOptimizationEnabled; + } + + /** + * Set the isMemoryOptimizationEnabled property: The isMemoryOptimizationEnabled property. + * + * @param isMemoryOptimizationEnabled the isMemoryOptimizationEnabled value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsMemoryOptimizationEnabled( + Boolean isMemoryOptimizationEnabled) { + this.isMemoryOptimizationEnabled = isMemoryOptimizationEnabled; + return this; + } + + /** + * Get the isEncrypted property: The isEncrypted property. + * + * @return the isEncrypted value. + */ + public Boolean isEncrypted() { + return this.isEncrypted; + } + + /** + * Set the isEncrypted property: The isEncrypted property. + * + * @param isEncrypted the isEncrypted value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsEncrypted(Boolean isEncrypted) { + this.isEncrypted = isEncrypted; + return this; + } + + /** + * Get the isTrustworthyOn property: The isTrustworthyOn property. + * + * @return the isTrustworthyOn value. + */ + public Boolean isTrustworthyOn() { + return this.isTrustworthyOn; + } + + /** + * Set the isTrustworthyOn property: The isTrustworthyOn property. + * + * @param isTrustworthyOn the isTrustworthyOn value to set. + * @return the SqlServerDatabaseResourcePropertiesDatabaseOptions object itself. + */ + public SqlServerDatabaseResourcePropertiesDatabaseOptions withIsTrustworthyOn(Boolean isTrustworthyOn) { + this.isTrustworthyOn = isTrustworthyOn; + 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/SqlServerDatabaseUpdate.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseUpdate.java new file mode 100644 index 000000000000..94f3454e9c25 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabaseUpdate.java @@ -0,0 +1,82 @@ +// 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 database resource. */ +@Fluent +public final class SqlServerDatabaseUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The data controller's properties + */ + @JsonProperty(value = "properties") + private SqlServerDatabaseResourceProperties properties; + + /** Creates an instance of SqlServerDatabaseUpdate class. */ + public SqlServerDatabaseUpdate() { + } + + /** + * 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 SqlServerDatabaseUpdate object itself. + */ + public SqlServerDatabaseUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The data controller's properties. + * + * @return the properties value. + */ + public SqlServerDatabaseResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The data controller's properties. + * + * @param properties the properties value to set. + * @return the SqlServerDatabaseUpdate object itself. + */ + public SqlServerDatabaseUpdate withProperties(SqlServerDatabaseResourceProperties 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/SqlServerDatabases.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabases.java new file mode 100644 index 000000000000..b04facdd1741 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerDatabases.java @@ -0,0 +1,146 @@ +// 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 SqlServerDatabases. */ +public interface SqlServerDatabases { + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context); + + /** + * Deletes an Arc Sql Server database resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 sqlServerInstanceName, String databaseName); + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sqlServerInstanceName, String databaseName, Context context); + + /** + * Retrieves an Arc Sql Server database. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of SQL Server Instance. + * @param databaseName Name of the database. + * @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 arc Sql Server database. + */ + SqlServerDatabaseResource get(String resourceGroupName, String sqlServerInstanceName, String databaseName); + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sqlServerInstanceName); + + /** + * List the databases associated with the given Arc Sql Server. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a list of Arc Sql Server database as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String sqlServerInstanceName, Context context); + + /** + * Retrieves an Arc Sql Server database. + * + * @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 arc Sql Server database along with {@link Response}. + */ + SqlServerDatabaseResource getById(String id); + + /** + * Retrieves an Arc Sql Server database. + * + * @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 arc Sql Server database along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Arc Sql Server database 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 Arc Sql Server database 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 the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlServerDatabaseResource resource. + * + * @param name resource name. + * @return the first stage of the new SqlServerDatabaseResource definition. + */ + SqlServerDatabaseResource.DefinitionStages.Blank define(String name); +} 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 6420ef9d0071..18b4c0fcaa87 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. */ @@ -75,6 +75,13 @@ public interface SqlServerInstance { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerInstanceInner object. * 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 71586691fdf6..23c9a9de2c1d 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. */ @@ -28,6 +24,10 @@ public final class SqlServerInstanceListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of SqlServerInstanceListResult class. */ + public SqlServerInstanceListResult() { + } + /** * Get the value property: 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 723a53f8a3e3..99b30776c5ca 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. */ @@ -45,6 +42,12 @@ public final class SqlServerInstanceProperties { @JsonProperty(value = "vCore") private String vCore; + /* + * The number of total cores of the Operating System Environment (OSE) hosting the SQL Server instance. + */ + @JsonProperty(value = "cores") + private String cores; + /* * The cloud connectivity status. */ @@ -112,11 +115,21 @@ 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; + + /** Creates an instance of SqlServerInstanceProperties class. */ + public SqlServerInstanceProperties() { + } + /** * Get the version property: SQL Server version. * @@ -206,6 +219,28 @@ public SqlServerInstanceProperties withVCore(String vCore) { return this; } + /** + * Get the cores property: The number of total cores of the Operating System Environment (OSE) hosting the SQL + * Server instance. + * + * @return the cores value. + */ + public String cores() { + return this.cores; + } + + /** + * Set the cores property: The number of total cores of the Operating System Environment (OSE) hosting the SQL + * Server instance. + * + * @param cores the cores value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withCores(String cores) { + this.cores = cores; + return this; + } + /** * Get the status property: The cloud connectivity status. * @@ -428,7 +463,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 +471,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 +498,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 9263855be4a7..606d0a7e2de3 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. */ @@ -23,6 +19,10 @@ public final class SqlServerInstanceUpdate { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of SqlServerInstanceUpdate class. */ + public SqlServerInstanceUpdate() { + } + /** * Get the tags property: 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 3f47165c53e0..da60c6e56920 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,30 +26,34 @@ 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); /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 all sqlServerInstances in a resource group. + * @return all sqlServerInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets all sqlServerInstances in a resource group. + * List sqlServerInstance resources in the resource group + * + *

Gets all sqlServerInstances in a resource group. * * @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 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); @@ -58,32 +62,32 @@ public interface SqlServerInstances { * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlServerInstance. + * @return a SqlServerInstance along with {@link Response}. */ - SqlServerInstance getByResourceGroup(String resourceGroupName, String sqlServerInstanceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlServerInstanceName, Context context); /** * Retrieves a SQL Server Instance resource. * * @param resourceGroupName The name of the Azure resource group. * @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 a SqlServerInstance. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String sqlServerInstanceName, Context context); + SqlServerInstance getByResourceGroup(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. * @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 +98,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 +113,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 +125,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 b51c30bc05bd..6a3518e3cfff 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 @@ -8,17 +8,29 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SqlVersion. */ +/** SQL Server version. */ 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. * @@ -30,7 +42,11 @@ public static SqlVersion fromString(String name) { return fromString(name, SqlVersion.class); } - /** @return known SqlVersion values. */ + /** + * Gets known SqlVersion values. + * + * @return known SqlVersion values. + */ public static Collection values() { return values(SqlVersion.class); } 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 f1f8511ca0e0..0b71919a6a09 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. */ @@ -28,8 +24,7 @@ public final class UploadServicePrincipal { private UUID tenantId; /* - * Authority for the service principal. Example: - * https://login.microsoftonline.com/ + * Authority for the service principal. Example: https://login.microsoftonline.com/ */ @JsonProperty(value = "authority") private String authority; @@ -40,6 +35,10 @@ public final class UploadServicePrincipal { @JsonProperty(value = "clientSecret") private String clientSecret; + /** Creates an instance of UploadServicePrincipal class. */ + public UploadServicePrincipal() { + } + /** * Get the clientId property: 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 1fee37441a72..0f0142a2cff6 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,37 +5,34 @@ 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 + * Last uploaded date for metrics from kubernetes cluster. Defaults to current date time */ @JsonProperty(value = "metrics") private OffsetDateTime metrics; /* - * Last uploaded date for logs from kubernetes cluster. Defaults to current - * date time + * Last uploaded date for logs from kubernetes cluster. Defaults to current date time */ @JsonProperty(value = "logs") private OffsetDateTime logs; /* - * Last uploaded date for usages from kubernetes cluster. Defaults to - * current date time + * Last uploaded date for usages from kubernetes cluster. Defaults to current date time */ @JsonProperty(value = "usages") private OffsetDateTime usages; + /** Creates an instance of UploadWatermark class. */ + public UploadWatermark() { + } + /** * Get the metrics property: 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 000000000000..15079a8f950d --- /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-06-15-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 000000000000..22f644e4cf88 --- /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-06-15-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 000000000000..af78d8cd85ca --- /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-06-15-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 000000000000..102f73bb0855 --- /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-06-15-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 2a4b3e710503..c6f6d868d61a 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-06-15-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 7e3e73475110..4d3974bcaf2a 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-06-15-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 e9a29c0afd43..55f6991ca377 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-06-15-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 050a703e2e75..c6f6f3b5d673 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-06-15-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 dc30e9bf6cad..f24c3bb2eb9d 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-06-15-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 b0988321b1af..2ebcad32d1c3 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-06-15-preview/examples/CreateOrUpdateDataController.json */ /** * Sample code: Create or update a Data Controller. @@ -41,24 +41,28 @@ public static void createOrUpdateADataController( .withOnPremiseProperty( new OnPremiseProperty() .withId(UUID.fromString("12345678-1234-1234-ab12-1a2b3c4d5e6f")) - .withPublicSigningKey("publicOnPremSigningKey")) + .withPublicSigningKey("fakeTokenPlaceholder")) .withUploadWatermark( new UploadWatermark() .withMetrics(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) .withLogs(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) .withUsages(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z"))) .withBasicLoginInformation( - new BasicLoginInformation().withUsername("username").withPassword("********")) + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) + .withMetricsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) + .withLogsDashboardCredential( + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) .withLogAnalyticsWorkspaceConfig( new LogAnalyticsWorkspaceConfig() .withWorkspaceId(UUID.fromString("00000000-1111-2222-3333-444444444444")) - .withPrimaryKey("********")) + .withPrimaryKey("fakeTokenPlaceholder")) .withUploadServicePrincipal( new UploadServicePrincipal() .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444")) .withAuthority("https://login.microsoftonline.com/") - .withClientSecret("********")) + .withClientSecret("fakeTokenPlaceholder")) .withClusterId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") .withExtensionId( 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 b4aa2230963e..cce3ad164554 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-06-15-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 000000000000..5343f587938d --- /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-06-15-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("fakeTokenPlaceholder")) + .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 000000000000..67879f80dbe7 --- /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-06-15-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 000000000000..0d183ebdc129 --- /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-06-15-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 000000000000..8aac2496da22 --- /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-06-15-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 000000000000..4fe4f7fd5e78 --- /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-06-15-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 000000000000..20fdf40c7624 --- /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-06-15-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 da8f0118446c..400c42681c52 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-06-15-preview/examples/CreateOrUpdateSqlManagedInstance.json */ /** * Sample code: Create or update a SQL Managed Instance. @@ -74,7 +76,10 @@ public static void createOrUpdateASQLManagedInstance( .withAdditionalProperties(mapOf())) .withAdditionalProperties(mapOf("additionalProperty", 1234))) .withBasicLoginInformation( - new BasicLoginInformation().withUsername("username").withPassword("********")) + new BasicLoginInformation().withUsername("username").withPassword("fakeTokenPlaceholder")) + .withActiveDirectoryInformation( + new ActiveDirectoryInformation() + .withKeytabInformation(new KeytabInformation().withKeytab("fakeTokenPlaceholder"))) .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 09e98c6c837e..2a63b3fb7dd4 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-06-15-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 eb77f8f121ad..b1c0912fbfd1 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-06-15-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 eb2792e43404..0e42bf08b126 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-06-15-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 35cb9065802c..6634a815ebd9 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-06-15-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 d4d6daf18f1b..5f65f4dbee17 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-06-15-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/SqlServerDatabasesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesCreateSamples.java new file mode 100644 index 000000000000..af65a524498d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesCreateSamples.java @@ -0,0 +1,70 @@ +// 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.DatabaseState; +import com.azure.resourcemanager.azurearcdata.models.RecoveryMode; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResourceProperties; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResourcePropertiesBackupInformation; +import com.azure.resourcemanager.azurearcdata.models.SqlServerDatabaseResourcePropertiesDatabaseOptions; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlServerDatabases Create. */ +public final class SqlServerDatabasesCreateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/CreateOrUpdateArcSqlServerDatabase.json + */ + /** + * Sample code: Create a Arc Sql Server database. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void createAArcSqlServerDatabase(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager + .sqlServerDatabases() + .define("testdb") + .withRegion("southeastasia") + .withExistingSqlServerInstance("testrg", "testSqlServerInstance") + .withProperties( + new SqlServerDatabaseResourceProperties() + .withCollationName("SQL_Latin1_General_CP1_CI_AS") + .withDatabaseCreationDate(OffsetDateTime.parse("2022-04-05T16:26:33.883Z")) + .withCompatibilityLevel(150) + .withSizeMB(150.0F) + .withSpaceAvailableMB(100.0F) + .withState(DatabaseState.ONLINE) + .withIsReadOnly(true) + .withRecoveryMode(RecoveryMode.FULL) + .withDatabaseOptions( + new SqlServerDatabaseResourcePropertiesDatabaseOptions() + .withIsAutoCloseOn(true) + .withIsAutoShrinkOn(true) + .withIsAutoCreateStatsOn(true) + .withIsAutoUpdateStatsOn(true) + .withIsRemoteDataArchiveEnabled(true) + .withIsMemoryOptimizationEnabled(true) + .withIsEncrypted(true) + .withIsTrustworthyOn(true)) + .withBackupInformation( + new SqlServerDatabaseResourcePropertiesBackupInformation() + .withLastFullBackup(OffsetDateTime.parse("2022-05-05T16:26:33.883Z")) + .withLastLogBackup(OffsetDateTime.parse("2022-05-10T16:26:33.883Z")))) + .withTags(mapOf("mytag", "myval")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesDeleteSamples.java new file mode 100644 index 000000000000..ae2636adadbe --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesDeleteSamples.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 SqlServerDatabases Delete. */ +public final class SqlServerDatabasesDeleteSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/DeleteArcSqlServerDatabase.json + */ + /** + * Sample code: Deletes a database resource. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void deletesADatabaseResource(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.sqlServerDatabases().deleteWithResponse("testrg", "testsqlManagedInstance", "testdb", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesGetSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesGetSamples.java new file mode 100644 index 000000000000..dc66d9ad04f0 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesGetSamples.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 SqlServerDatabases Get. */ +public final class SqlServerDatabasesGetSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/GetArcSqlServerDatabase.json + */ + /** + * Sample code: Retrieves an Arc Sql Server database resource. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void retrievesAnArcSqlServerDatabaseResource( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.sqlServerDatabases().getWithResponse("testrg", "testSqlServerInstance", "testdb", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesListSamples.java new file mode 100644 index 000000000000..59faaa26e367 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesListSamples.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 SqlServerDatabases List. */ +public final class SqlServerDatabasesListSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/ListBySqlServerInstanceDatabase.json + */ + /** + * Sample code: Gets all databases associated with an Arc Enabled Sql server. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void getsAllDatabasesAssociatedWithAnArcEnabledSqlServer( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + manager.sqlServerDatabases().list("testrg", "testSqlServerInstance", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesUpdateSamples.java new file mode 100644 index 000000000000..61cc52f6512e --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerDatabasesUpdateSamples.java @@ -0,0 +1,41 @@ +// 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.SqlServerDatabaseResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlServerDatabases Update. */ +public final class SqlServerDatabasesUpdateSamples { + /* + * x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-06-15-preview/examples/UpdateSqlServerDatabase.json + */ + /** + * Sample code: Update a database. + * + * @param manager Entry point to AzureArcDataManager. + */ + public static void updateADatabase(com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager) { + SqlServerDatabaseResource resource = + manager + .sqlServerDatabases() + .getWithResponse("testrg", "testsqlManagedInstance", "testdb", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval1")).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/SqlServerInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/generated/SqlServerInstancesCreateSamples.java index c00d97d070a8..7cb889827a46 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-06-15-preview/examples/CreateOrUpdateSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags. @@ -34,21 +35,23 @@ 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) + .withCores("4") + .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 8142f5c64df3..10b5f6a86a49 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-06-15-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 37d5005540c4..d86a58896759 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-06-15-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 8a4730bc5080..48bcd3eca892 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-06-15-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 80ee6a6b3e97..6740de3cebf6 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-06-15-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 f361ca3b034d..0a4249f03ee3 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-06-15-preview/examples/UpdateSqlServerInstance.json */ /** * Sample code: Updates a SQL Server Instance tags.