From 6a21f3a42417b0ed0333931cf754ee873b2fa1b6 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 20 Jul 2021 23:13:19 -0700 Subject: [PATCH] [Automation] Generate Fluent Lite from azurearcdata#package-2021-08-01 (#23101) * [Automation] External Change * [Automation] Generate Fluent Lite from azurearcdata#package-2021-08-01 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 ++ .../SAMPLE.md | 33 + .../pom.xml | 86 + .../azurearcdata/AzureArcDataManager.java | 266 ++++ .../fluent/AzureArcDataManagementClient.java | 74 + .../fluent/DataControllersClient.java | 221 +++ .../azurearcdata/fluent/OperationsClient.java | 36 + .../fluent/SqlManagedInstancesClient.java | 218 +++ .../fluent/SqlServerInstancesClient.java | 218 +++ .../models/DataControllerResourceInner.java | 121 ++ .../fluent/models/OperationInner.java | 148 ++ .../models/SqlManagedInstanceInner.java | 151 ++ .../fluent/models/SqlServerInstanceInner.java | 86 + .../fluent/models/package-info.java | 9 + .../azurearcdata/fluent/package-info.java | 9 + .../AzureArcDataManagementClientBuilder.java | 146 ++ .../AzureArcDataManagementClientImpl.java | 335 ++++ .../DataControllerResourceImpl.java | 201 +++ .../DataControllersClientImpl.java | 1400 +++++++++++++++++ .../implementation/DataControllersImpl.java | 176 +++ .../implementation/OperationImpl.java | 57 + .../implementation/OperationsClientImpl.java | 269 ++++ .../implementation/OperationsImpl.java | 46 + .../SqlManagedInstanceImpl.java | 209 +++ .../SqlManagedInstancesClientImpl.java | 1387 ++++++++++++++++ .../SqlManagedInstancesImpl.java | 181 +++ .../implementation/SqlServerInstanceImpl.java | 188 +++ .../SqlServerInstancesClientImpl.java | 1379 ++++++++++++++++ .../SqlServerInstancesImpl.java | 181 +++ .../azurearcdata/implementation/Utils.java | 204 +++ .../implementation/package-info.java | 9 + .../ArcSqlManagedInstanceLicenseType.java | 47 + .../models/ArcSqlServerLicenseType.java | 40 + .../models/BasicLoginInformation.java | 76 + .../azurearcdata/models/ConnectionStatus.java | 37 + .../models/DataControllerProperties.java | 324 ++++ .../models/DataControllerResource.java | 235 +++ .../models/DataControllerUpdate.java | 51 + .../azurearcdata/models/DataControllers.java | 158 ++ .../azurearcdata/models/DefenderStatus.java | 37 + .../azurearcdata/models/EditionType.java | 46 + .../azurearcdata/models/ExtendedLocation.java | 76 + .../models/ExtendedLocationTypes.java | 31 + .../azurearcdata/models/Infrastructure.java | 59 + .../models/K8SResourceRequirements.java | 131 ++ .../azurearcdata/models/K8SScheduling.java | 94 ++ .../models/K8SSchedulingOptions.java | 100 ++ .../models/LogAnalyticsWorkspaceConfig.java | 77 + .../azurearcdata/models/ODataError.java | 133 ++ .../models/OnPremiseProperty.java | 120 ++ .../azurearcdata/models/Operation.java | 53 + .../azurearcdata/models/OperationDisplay.java | 149 ++ .../models/OperationListResult.java | 59 + .../azurearcdata/models/OperationOrigin.java | 34 + .../azurearcdata/models/Operations.java | 31 + .../models/PageOfDataControllerResource.java | 81 + .../models/ResourceIdentityType.java | 44 + .../models/SqlManagedInstance.java | 253 +++ .../models/SqlManagedInstanceK8SRaw.java | 91 ++ .../models/SqlManagedInstanceK8SSpec.java | 125 ++ .../models/SqlManagedInstanceListResult.java | 59 + .../models/SqlManagedInstanceProperties.java | 313 ++++ .../models/SqlManagedInstanceSku.java | 191 +++ .../models/SqlManagedInstanceSkuTier.java | 47 + .../models/SqlManagedInstanceUpdate.java | 51 + .../models/SqlManagedInstances.java | 158 ++ .../models/SqlServerInstance.java | 217 +++ .../models/SqlServerInstanceListResult.java | 59 + .../models/SqlServerInstanceProperties.java | 458 ++++++ .../models/SqlServerInstanceUpdate.java | 51 + .../models/SqlServerInstances.java | 158 ++ .../azurearcdata/models/SqlVersion.java | 37 + .../models/UploadServicePrincipal.java | 130 ++ .../azurearcdata/models/UploadWatermark.java | 106 ++ .../azurearcdata/models/package-info.java | 9 + .../azurearcdata/package-info.java | 9 + .../src/main/java/module-info.java | 19 + .../DataControllersDeleteSamples.java | 21 + ...aControllersGetByResourceGroupSamples.java | 23 + ...ControllersListByResourceGroupSamples.java | 21 + .../DataControllersListSamples.java | 21 + ...ControllersPatchDataControllerSamples.java | 40 + ...taControllersPutDataControllerSamples.java | 83 + .../azurearcdata/OperationsListSamples.java | 21 + .../SqlManagedInstancesCreateSamples.java | 96 ++ .../SqlManagedInstancesDeleteSamples.java | 21 + ...gedInstancesGetByResourceGroupSamples.java | 23 + ...edInstancesListByResourceGroupSamples.java | 21 + .../SqlManagedInstancesListSamples.java | 21 + .../SqlManagedInstancesUpdateSamples.java | 40 + .../SqlServerInstancesCreateSamples.java | 63 + .../SqlServerInstancesDeleteSamples.java | 21 + ...verInstancesGetByResourceGroupSamples.java | 23 + ...erInstancesListByResourceGroupSamples.java | 21 + .../SqlServerInstancesListSamples.java | 21 + .../SqlServerInstancesUpdateSamples.java | 40 + sdk/azurearcdata/ci.yml | 33 + sdk/azurearcdata/pom.xml | 53 + 101 files changed, 13744 insertions(+) create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/AzureArcDataManager.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/AzureArcDataManagementClient.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/DataControllersClient.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/OperationsClient.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerInstancesClient.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/DataControllerResourceInner.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/OperationInner.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlManagedInstanceInner.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerInstanceInner.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/package-info.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/package-info.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientBuilder.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllerResourceImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersClientImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsClientImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstanceImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesClientImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstanceImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesClientImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesImpl.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/Utils.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/package-info.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlManagedInstanceLicenseType.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerLicenseType.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/BasicLoginInformation.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ConnectionStatus.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerProperties.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerResource.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerUpdate.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllers.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DefenderStatus.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/EditionType.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocation.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocationTypes.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Infrastructure.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SScheduling.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SSchedulingOptions.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/LogAnalyticsWorkspaceConfig.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ODataError.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OnPremiseProperty.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operation.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationDisplay.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationListResult.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operations.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PageOfDataControllerResource.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ResourceIdentityType.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SRaw.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SSpec.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceListResult.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSku.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSkuTier.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstances.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstance.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceListResult.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceUpdate.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstances.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlVersion.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadServicePrincipal.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadWatermark.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/package-info.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/package-info.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/module-info.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java create mode 100644 sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java create mode 100644 sdk/azurearcdata/ci.yml create mode 100644 sdk/azurearcdata/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 71bc8a1bef7ca..9415823093ef5 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -306,6 +306,7 @@ com.azure.resourcemanager:azure-resourcemanager-postgresqlflexibleserver;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 0c475ccdb3e4f..edd475ba5d02b 100644 --- a/pom.xml +++ b/pom.xml @@ -716,6 +716,7 @@ sdk/authorization sdk/automation sdk/avs + sdk/azurearcdata sdk/azurestack sdk/azurestackhci sdk/batch diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md new file mode 100644 index 0000000000000..b9366a151a480 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-07-21) + +- 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). diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md new file mode 100644 index 0000000000000..8d189fa6ffb4a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager AzureArcData client library for Java + +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). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-azurearcdata;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-azurearcdata + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +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. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of 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`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +AzureArcDataManager manager = AzureArcDataManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +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 + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[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 diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md new file mode 100644 index 0000000000000..665437f9d9250 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md @@ -0,0 +1,33 @@ +# Code snippets and samples + + +### DataControllers + +- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java) +- [GetByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.java) +- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java) +- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java) +- [PatchDataController](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java) +- [PutDataController](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java) + +### Operations + +- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java) + +### SqlManagedInstances + +- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java) +- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java) +- [GetByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.java) +- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java) +- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java) +- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java) + +### SqlServerInstances + +- [Create](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java) +- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java) +- [GetByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.java) +- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java) +- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java) +- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java) diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml new file mode 100644 index 0000000000000..0b7277842e7c6 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-azurearcdata + 1.0.0-beta.1 + 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. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + 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 new file mode 100644 index 0000000000000..7bd1ec83de9e9 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/AzureArcDataManager.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +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.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +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.AzureArcDataManagementClientBuilder; +import com.azure.resourcemanager.azurearcdata.implementation.DataControllersImpl; +import com.azure.resourcemanager.azurearcdata.implementation.OperationsImpl; +import com.azure.resourcemanager.azurearcdata.implementation.SqlManagedInstancesImpl; +import com.azure.resourcemanager.azurearcdata.implementation.SqlServerInstancesImpl; +import com.azure.resourcemanager.azurearcdata.models.DataControllers; +import com.azure.resourcemanager.azurearcdata.models.Operations; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstances; +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; + +/** + * Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful set of web APIs to manage + * Azure Data Services on Azure Arc Resources. + */ +public final class AzureArcDataManager { + private Operations operations; + + private SqlManagedInstances sqlManagedInstances; + + private SqlServerInstances sqlServerInstances; + + private DataControllers dataControllers; + + private final AzureArcDataManagementClient clientObject; + + private AzureArcDataManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AzureArcDataManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of AzureArcData service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the AzureArcData service API instance. + */ + public static AzureArcDataManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create AzureArcDataManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AzureArcDataManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private 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 Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of AzureArcData service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the AzureArcData service API instance. + */ + public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.azurearcdata") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new AzureArcDataManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of SqlManagedInstances. */ + public SqlManagedInstances sqlManagedInstances() { + if (this.sqlManagedInstances == null) { + this.sqlManagedInstances = new SqlManagedInstancesImpl(clientObject.getSqlManagedInstances(), this); + } + return sqlManagedInstances; + } + + /** @return Resource collection API of SqlServerInstances. */ + public SqlServerInstances sqlServerInstances() { + if (this.sqlServerInstances == null) { + this.sqlServerInstances = new SqlServerInstancesImpl(clientObject.getSqlServerInstances(), this); + } + return sqlServerInstances; + } + + /** @return Resource collection API of DataControllers. */ + public DataControllers dataControllers() { + if (this.dataControllers == null) { + this.dataControllers = new DataControllersImpl(clientObject.getDataControllers(), this); + } + return dataControllers; + } + + /** + * @return Wrapped service client AzureArcDataManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public AzureArcDataManagementClient serviceClient() { + return this.clientObject; + } +} 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 new file mode 100644 index 0000000000000..da11f09fe2a9f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/AzureArcDataManagementClient.java @@ -0,0 +1,74 @@ +// 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.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AzureArcDataManagementClient class. */ +public interface AzureArcDataManagementClient { + /** + * Gets The ID of the Azure subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SqlManagedInstancesClient object to access its operations. + * + * @return the SqlManagedInstancesClient object. + */ + SqlManagedInstancesClient getSqlManagedInstances(); + + /** + * Gets the SqlServerInstancesClient object to access its operations. + * + * @return the SqlServerInstancesClient object. + */ + SqlServerInstancesClient getSqlServerInstances(); + + /** + * Gets the DataControllersClient object to access its operations. + * + * @return the DataControllersClient object. + */ + DataControllersClient getDataControllers(); +} 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 new file mode 100644 index 0000000000000..49f0a7bee68a6 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/DataControllersClient.java @@ -0,0 +1,221 @@ +// 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.DataControllerResourceInner; +import com.azure.resourcemanager.azurearcdata.models.DataControllerUpdate; + +/** An instance of this class provides access to all the operations defined in DataControllersClient. */ +public interface DataControllersClient { + /** + * List dataController 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List dataController 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List dataController resources in the 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List dataController resources in the 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataControllerResourceInner> beginPutDataController( + String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource); + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataControllerResourceInner> beginPutDataController( + String resourceGroupName, + String dataControllerName, + DataControllerResourceInner dataControllerResource, + Context context); + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataControllerResourceInner putDataController( + String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource); + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataControllerResourceInner putDataController( + String resourceGroupName, + String dataControllerName, + DataControllerResourceInner dataControllerResource, + Context context); + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context); + + /** + * Retrieves a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data controller resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataControllerResourceInner getByResourceGroup(String resourceGroupName, String dataControllerName); + + /** + * 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. + * @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); + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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 data controller resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataControllerResourceInner patchDataController( + 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 dataControllerResource The update data controller resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data controller resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchDataControllerWithResponse( + String resourceGroupName, + String dataControllerName, + DataControllerUpdate dataControllerResource, + Context context); +} 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 new file mode 100644 index 0000000000000..41bea71529e20 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// 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.util.Context; +import com.azure.resourcemanager.azurearcdata.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Azure Data Services on Azure Arc API 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @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 result of the request to list Azure Data Services on Azure Arc operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java new file mode 100644 index 0000000000000..6e29427dab0bf --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlManagedInstancesClient.java @@ -0,0 +1,218 @@ +// 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.SqlManagedInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceUpdate; + +/** An instance of this class provides access to all the operations defined in SqlManagedInstancesClient. */ +public interface SqlManagedInstancesClient { + /** + * List sqlManagedInstance 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 SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List sqlManagedInstance 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 SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName); + + /** + * 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); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SqlManagedInstanceInner> beginCreate( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SqlManagedInstanceInner> beginCreate( + String resourceGroupName, + String sqlManagedInstanceName, + SqlManagedInstanceInner sqlManagedInstance, + Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlManagedInstanceInner create( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlManagedInstanceInner create( + String resourceGroupName, + String sqlManagedInstanceName, + SqlManagedInstanceInner sqlManagedInstance, + Context context); + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context); + + /** + * Updates a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @param parameters The SQL Managed Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlManagedInstanceInner update( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters); + + /** + * Updates a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @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); +} 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 new file mode 100644 index 0000000000000..eeb39cee2409f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/SqlServerInstancesClient.java @@ -0,0 +1,218 @@ +// 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.SqlServerInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceUpdate; + +/** An instance of this class provides access to all the operations defined in SqlServerInstancesClient. */ +public interface SqlServerInstancesClient { + /** + * List sqlServerInstance 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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List sqlServerInstance 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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves a SQL Server Instance resource. + * + * @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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlServerInstanceInner getByResourceGroup(String resourceGroupName, String sqlServerInstanceName); + + /** + * 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); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SqlServerInstanceInner> beginCreate( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SqlServerInstanceInner> beginCreate( + String resourceGroupName, + String sqlServerInstanceName, + SqlServerInstanceInner sqlServerInstance, + Context context); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlServerInstanceInner create( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlServerInstanceInner create( + String resourceGroupName, + String sqlServerInstanceName, + SqlServerInstanceInner sqlServerInstance, + Context context); + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context); + + /** + * Updates a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of sqlServerInstance. + * @param parameters The SQL Server Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlServerInstanceInner update( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters); + + /** + * Updates a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of sqlServerInstance. + * @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); +} 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 new file mode 100644 index 0000000000000..e3519feb731f6 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/DataControllerResourceInner.java @@ -0,0 +1,121 @@ +// 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.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. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The data controller's properties + */ + @JsonProperty(value = "properties", required = true) + private DataControllerProperties properties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the DataControllerResourceInner object itself. + */ + public DataControllerResourceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + 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 DataControllerResourceInner object itself. + */ + public DataControllerResourceInner withProperties(DataControllerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public DataControllerResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataControllerResourceInner 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 DataControllerResourceInner")); + } else { + properties().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..de9bd56b107f3 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/OperationInner.java @@ -0,0 +1,148 @@ +// 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.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.JsonProperty; +import java.util.Map; + +/** 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. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The localized display information for this particular operation / + * action. + */ + @JsonProperty(value = "display", required = true) + private OperationDisplay display; + + /* + * The intended executor of the operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private OperationOrigin origin; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction", required = true) + private boolean isDataAction; + + /* + * Additional descriptions for the operation. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private Map properties; + + /** + * Get the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation being performed on this particular object. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The localized display information for this particular operation / action. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The localized display information for this particular operation / action. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the properties property: Additional descriptions for the operation. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * 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 OperationInner")); + } + if (display() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property display in model OperationInner")); + } else { + display().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..4a4b565009b30 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlManagedInstanceInner.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; +import com.azure.resourcemanager.azurearcdata.models.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 + */ + @JsonProperty(value = "properties", required = true) + private SqlManagedInstanceProperties properties; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Resource sku. + */ + @JsonProperty(value = "sku") + private SqlManagedInstanceSku sku; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: null. + * + * @return the properties value. + */ + public SqlManagedInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: null. + * + * @param properties the properties value to set. + * @return the SqlManagedInstanceInner object itself. + */ + public SqlManagedInstanceInner withProperties(SqlManagedInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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 SqlManagedInstanceInner object itself. + */ + public SqlManagedInstanceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the sku property: Resource sku. + * + * @return the sku value. + */ + public SqlManagedInstanceSku sku() { + return this.sku; + } + + /** + * Set the sku property: Resource sku. + * + * @param sku the sku value to set. + * @return the SqlManagedInstanceInner object itself. + */ + public SqlManagedInstanceInner withSku(SqlManagedInstanceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SqlManagedInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlManagedInstanceInner 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 SqlManagedInstanceInner")); + } else { + properties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..81543824dc99d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/SqlServerInstanceInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.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.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 + */ + @JsonProperty(value = "properties") + private SqlServerInstanceProperties properties; + + /* + * Read only system data + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: null. + * + * @return the properties value. + */ + public SqlServerInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: null. + * + * @param properties the properties value to set. + * @return the SqlServerInstanceInner object itself. + */ + public SqlServerInstanceInner withProperties(SqlServerInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Read only system data. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SqlServerInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlServerInstanceInner 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) { + properties().validate(); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/package-info.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/package-info.java new file mode 100644 index 0000000000000..91a1d2c9554db --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for AzureArcDataManagementClient. The AzureArcData management API provides a + * RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ +package com.azure.resourcemanager.azurearcdata.fluent.models; diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/package-info.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/package-info.java new file mode 100644 index 0000000000000..904a73cdcffea --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for AzureArcDataManagementClient. The AzureArcData management API provides a + * RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ +package com.azure.resourcemanager.azurearcdata.fluent; 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 new file mode 100644 index 0000000000000..142dec68b8efe --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientBuilder.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.implementation; + +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; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the AzureArcDataManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureArcDataManagementClientImpl.class}) +public final class AzureArcDataManagementClientBuilder { + /* + * The ID of the Azure subscription + */ + private String subscriptionId; + + /** + * Sets The ID of the Azure subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureArcDataManagementClientBuilder. + */ + public AzureArcDataManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzureArcDataManagementClientBuilder. + */ + public AzureArcDataManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the AzureArcDataManagementClientBuilder. + */ + public AzureArcDataManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the AzureArcDataManagementClientBuilder. + */ + public AzureArcDataManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AzureArcDataManagementClientBuilder. + */ + public AzureArcDataManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AzureArcDataManagementClientBuilder. + */ + public AzureArcDataManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzureArcDataManagementClientImpl with the provided parameters. + * + * @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(); + } + AzureArcDataManagementClientImpl client = + new AzureArcDataManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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 new file mode 100644 index 0000000000000..257e747d16b19 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/AzureArcDataManagementClientImpl.java @@ -0,0 +1,335 @@ +// 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.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +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.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.AzureArcDataManagementClient; +import com.azure.resourcemanager.azurearcdata.fluent.DataControllersClient; +import com.azure.resourcemanager.azurearcdata.fluent.OperationsClient; +import com.azure.resourcemanager.azurearcdata.fluent.SqlManagedInstancesClient; +import com.azure.resourcemanager.azurearcdata.fluent.SqlServerInstancesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +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; + + /** + * Gets The ID of the Azure subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SqlManagedInstancesClient object to access its operations. */ + private final SqlManagedInstancesClient sqlManagedInstances; + + /** + * Gets the SqlManagedInstancesClient object to access its operations. + * + * @return the SqlManagedInstancesClient object. + */ + public SqlManagedInstancesClient getSqlManagedInstances() { + return this.sqlManagedInstances; + } + + /** The SqlServerInstancesClient object to access its operations. */ + private final SqlServerInstancesClient sqlServerInstances; + + /** + * Gets the SqlServerInstancesClient object to access its operations. + * + * @return the SqlServerInstancesClient object. + */ + public SqlServerInstancesClient getSqlServerInstances() { + return this.sqlServerInstances; + } + + /** The DataControllersClient object to access its operations. */ + private final DataControllersClient dataControllers; + + /** + * Gets the DataControllersClient object to access its operations. + * + * @return the DataControllersClient object. + */ + public DataControllersClient getDataControllers() { + return this.dataControllers; + } + + /** + * Initializes an instance of AzureArcDataManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the Azure subscription. + * @param endpoint server parameter. + */ + AzureArcDataManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-08-01"; + this.operations = new OperationsClientImpl(this); + this.sqlManagedInstances = new SqlManagedInstancesClientImpl(this); + this.sqlServerInstances = new SqlServerInstancesClientImpl(this); + this.dataControllers = new DataControllersClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @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; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} 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 new file mode 100644 index 0000000000000..03d9e156dc60b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllerResourceImpl.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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.fluent.models.DataControllerResourceInner; +import com.azure.resourcemanager.azurearcdata.models.DataControllerProperties; +import com.azure.resourcemanager.azurearcdata.models.DataControllerResource; +import com.azure.resourcemanager.azurearcdata.models.DataControllerUpdate; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; +import java.util.Collections; +import java.util.Map; + +public final class DataControllerResourceImpl + implements DataControllerResource, DataControllerResource.Definition, DataControllerResource.Update { + private DataControllerResourceInner 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 DataControllerProperties 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 DataControllerResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataControllerName; + + private DataControllerUpdate updateDataControllerResource; + + public DataControllerResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DataControllerResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getDataControllers() + .putDataController(resourceGroupName, dataControllerName, this.innerModel(), Context.NONE); + return this; + } + + public DataControllerResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataControllers() + .putDataController(resourceGroupName, dataControllerName, this.innerModel(), context); + return this; + } + + DataControllerResourceImpl(String name, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = new DataControllerResourceInner(); + this.serviceManager = serviceManager; + this.dataControllerName = name; + } + + public DataControllerResourceImpl update() { + this.updateDataControllerResource = new DataControllerUpdate(); + return this; + } + + public DataControllerResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDataControllers() + .patchDataControllerWithResponse( + resourceGroupName, dataControllerName, updateDataControllerResource, Context.NONE) + .getValue(); + return this; + } + + public DataControllerResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataControllers() + .patchDataControllerWithResponse( + resourceGroupName, dataControllerName, updateDataControllerResource, context) + .getValue(); + return this; + } + + DataControllerResourceImpl( + DataControllerResourceInner innerObject, + com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataControllerName = Utils.getValueFromIdByName(innerObject.id(), "dataControllers"); + } + + public DataControllerResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDataControllers() + .getByResourceGroupWithResponse(resourceGroupName, dataControllerName, Context.NONE) + .getValue(); + return this; + } + + public DataControllerResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataControllers() + .getByResourceGroupWithResponse(resourceGroupName, dataControllerName, context) + .getValue(); + return this; + } + + public DataControllerResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DataControllerResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DataControllerResourceImpl withProperties(DataControllerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public DataControllerResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDataControllerResource.withTags(tags); + return this; + } + } + + public DataControllerResourceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + 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/DataControllersClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersClientImpl.java new file mode 100644 index 0000000000000..a0da4a4f34341 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersClientImpl.java @@ -0,0 +1,1400 @@ +// 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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurearcdata.fluent.DataControllersClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.DataControllerResourceInner; +import com.azure.resourcemanager.azurearcdata.models.DataControllerUpdate; +import com.azure.resourcemanager.azurearcdata.models.PageOfDataControllerResource; +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 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; + + /** The service client containing this operation class. */ + private final AzureArcDataManagementClientImpl client; + + /** + * Initializes an instance of DataControllersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataControllersClientImpl(AzureArcDataManagementClientImpl client) { + this.service = + RestProxy.create(DataControllersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureArcDataManagementClientDataControllers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureArcDataManageme") + private interface DataControllersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers") + @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" + + "/dataControllers") + @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"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> putDataController( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataControllerName") String dataControllerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataControllerResourceInner dataControllerResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @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"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @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"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/dataControllers/{dataControllerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patchDataController( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataControllerName") String dataControllerName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataControllerUpdate dataControllerResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listInSubscriptionNext( + @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> listInGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List dataController 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 the response. + */ + @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 dataController 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 the response. + */ + @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 dataController 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listInSubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List dataController 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listInSubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List dataController 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List dataController 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List dataController resources in the 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 the response. + */ + @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 dataController resources in the 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 the response. + */ + @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 dataController resources in the 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listInGroupNextSinglePageAsync(nextLink)); + } + + /** + * List dataController resources in the 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listInGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List dataController resources in the 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List dataController resources in the 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 the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putDataControllerWithResponseAsync( + String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource) { + 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 (dataControllerResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataControllerResource is required and cannot be null.")); + } else { + dataControllerResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .putDataController( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + dataControllerResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putDataControllerWithResponseAsync( + String resourceGroupName, + String dataControllerName, + DataControllerResourceInner dataControllerResource, + 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 (dataControllerResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataControllerResource is required and cannot be null.")); + } else { + dataControllerResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .putDataController( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + dataControllerResource, + accept, + context); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataControllerResourceInner> + beginPutDataControllerAsync( + String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource) { + Mono>> mono = + putDataControllerWithResponseAsync(resourceGroupName, dataControllerName, dataControllerResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataControllerResourceInner.class, + DataControllerResourceInner.class, + Context.NONE); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataControllerResourceInner> + beginPutDataControllerAsync( + String resourceGroupName, + String dataControllerName, + DataControllerResourceInner dataControllerResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + putDataControllerWithResponseAsync(resourceGroupName, dataControllerName, dataControllerResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataControllerResourceInner.class, + DataControllerResourceInner.class, + context); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataControllerResourceInner> beginPutDataController( + String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource) { + return beginPutDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource) + .getSyncPoller(); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataControllerResourceInner> beginPutDataController( + String resourceGroupName, + String dataControllerName, + DataControllerResourceInner dataControllerResource, + Context context) { + return beginPutDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource, context) + .getSyncPoller(); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putDataControllerAsync( + String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource) { + return beginPutDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putDataControllerAsync( + String resourceGroupName, + String dataControllerName, + DataControllerResourceInner dataControllerResource, + Context context) { + return beginPutDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataControllerResourceInner putDataController( + String resourceGroupName, String dataControllerName, DataControllerResourceInner dataControllerResource) { + return putDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource).block(); + } + + /** + * Creates or replaces a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataControllerResourceInner putDataController( + String resourceGroupName, + String dataControllerName, + DataControllerResourceInner dataControllerResource, + Context context) { + return putDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource, context).block(); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(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 + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + 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 + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataControllerName) { + return deleteWithResponseAsync(resourceGroupName, dataControllerName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataControllerName) { + deleteAsync(resourceGroupName, dataControllerName).block(); + } + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context) { + return deleteWithResponseAsync(resourceGroupName, dataControllerName, context).block(); + } + + /** + * Retrieves a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data controller resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + 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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + private Mono> getByResourceGroupWithResponseAsync( + 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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieves a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data controller resource. + */ + @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(); + } + }); + } + + /** + * Retrieves a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data controller resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataControllerResourceInner getByResourceGroup(String resourceGroupName, String dataControllerName) { + return getByResourceGroupAsync(resourceGroupName, dataControllerName).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchDataControllerWithResponseAsync( + String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource) { + 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 (dataControllerResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataControllerResource is required and cannot be null.")); + } else { + dataControllerResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patchDataController( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + dataControllerResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchDataControllerWithResponseAsync( + String resourceGroupName, + String dataControllerName, + DataControllerUpdate dataControllerResource, + 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 (dataControllerResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataControllerResource is required and cannot be null.")); + } else { + dataControllerResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patchDataController( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + dataControllerName, + this.client.getApiVersion(), + dataControllerResource, + accept, + context); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @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(); + } + }); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataControllerResourceInner patchDataController( + String resourceGroupName, String dataControllerName, DataControllerUpdate dataControllerResource) { + return patchDataControllerAsync(resourceGroupName, dataControllerName, dataControllerResource).block(); + } + + /** + * Updates a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchDataControllerWithResponse( + String resourceGroupName, + String dataControllerName, + DataControllerUpdate dataControllerResource, + Context context) { + return patchDataControllerWithResponseAsync( + resourceGroupName, dataControllerName, dataControllerResource, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInSubscriptionNextSinglePageAsync(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.listInSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInSubscriptionNextSinglePageAsync( + 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 + .listInSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInGroupNextSinglePageAsync(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.listInGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInGroupNextSinglePageAsync( + 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 + .listInGroupNext(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/DataControllersImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersImpl.java new file mode 100644 index 0000000000000..ec5498c3192b9 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/DataControllersImpl.java @@ -0,0 +1,176 @@ +// 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.DataControllersClient; +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 final DataControllersClient innerClient; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public DataControllersImpl( + DataControllersClient 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 DataControllerResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DataControllerResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DataControllerResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DataControllerResourceImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String dataControllerName) { + this.serviceClient().delete(resourceGroupName, dataControllerName); + } + + public Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context) { + return this.serviceClient().deleteWithResponse(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 = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, dataControllerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataControllerResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataControllerResource 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dataControllerName, 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dataControllerName, 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))); + } + this.deleteWithResponse(resourceGroupName, dataControllerName, Context.NONE).getValue(); + } + + 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 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))); + } + return this.deleteWithResponse(resourceGroupName, dataControllerName, context); + } + + private DataControllersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + public DataControllerResourceImpl define(String name) { + return new DataControllerResourceImpl(name, this.manager()); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationImpl.java new file mode 100644 index 0000000000000..6101437c1e4cf --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationImpl.java @@ -0,0 +1,57 @@ +// 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.resourcemanager.azurearcdata.fluent.models.OperationInner; +import com.azure.resourcemanager.azurearcdata.models.Operation; +import com.azure.resourcemanager.azurearcdata.models.OperationDisplay; +import com.azure.resourcemanager.azurearcdata.models.OperationOrigin; +import java.util.Collections; +import java.util.Map; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationOrigin origin() { + return this.innerModel().origin(); + } + + public boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..44a32405b17e0 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// 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.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.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.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; +import reactor.core.publisher.Mono; + +/** 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; + + /** The service client containing this operation class. */ + private final AzureArcDataManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AzureArcDataManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureArcDataManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureArcDataManageme") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.AzureArcData/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @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); + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @throws 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. + */ + @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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), 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())); + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @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. + */ + @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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Azure Data Services on Azure Arc operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Azure Data Services on Azure Arc operations. + */ + @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/OperationsImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..6fcceee329a7b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +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.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 final OperationsClient innerClient; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public OperationsImpl( + OperationsClient 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 OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } +} 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 new file mode 100644 index 0000000000000..774e2e7809079 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstanceImpl.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.SqlManagedInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstance; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceSku; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SqlManagedInstanceImpl + implements SqlManagedInstance, SqlManagedInstance.Definition, SqlManagedInstance.Update { + private SqlManagedInstanceInner 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 SqlManagedInstanceProperties properties() { + return this.innerModel().properties(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SqlManagedInstanceSku 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 SqlManagedInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlManagedInstanceName; + + private SqlManagedInstanceUpdate updateParameters; + + public SqlManagedInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SqlManagedInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlManagedInstances() + .create(resourceGroupName, sqlManagedInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public SqlManagedInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlManagedInstances() + .create(resourceGroupName, sqlManagedInstanceName, this.innerModel(), context); + return this; + } + + SqlManagedInstanceImpl(String name, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = new SqlManagedInstanceInner(); + this.serviceManager = serviceManager; + this.sqlManagedInstanceName = name; + } + + public SqlManagedInstanceImpl update() { + this.updateParameters = new SqlManagedInstanceUpdate(); + return this; + } + + public SqlManagedInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlManagedInstances() + .updateWithResponse(resourceGroupName, sqlManagedInstanceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SqlManagedInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlManagedInstances() + .updateWithResponse(resourceGroupName, sqlManagedInstanceName, updateParameters, context) + .getValue(); + return this; + } + + SqlManagedInstanceImpl( + SqlManagedInstanceInner innerObject, + com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlManagedInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sqlManagedInstances"); + } + + public SqlManagedInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlManagedInstances() + .getByResourceGroupWithResponse(resourceGroupName, sqlManagedInstanceName, Context.NONE) + .getValue(); + return this; + } + + public SqlManagedInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlManagedInstances() + .getByResourceGroupWithResponse(resourceGroupName, sqlManagedInstanceName, context) + .getValue(); + return this; + } + + public SqlManagedInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SqlManagedInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SqlManagedInstanceImpl withProperties(SqlManagedInstanceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public SqlManagedInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SqlManagedInstanceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public SqlManagedInstanceImpl withSku(SqlManagedInstanceSku 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/SqlManagedInstancesClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesClientImpl.java new file mode 100644 index 0000000000000..ce24bd702682b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesClientImpl.java @@ -0,0 +1,1387 @@ +// 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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurearcdata.fluent.SqlManagedInstancesClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.SqlManagedInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceListResult; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceUpdate; +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 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; + + /** The service client containing this operation class. */ + private final AzureArcDataManagementClientImpl client; + + /** + * Initializes an instance of SqlManagedInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlManagedInstancesClientImpl(AzureArcDataManagementClientImpl client) { + this.service = + RestProxy.create(SqlManagedInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureArcDataManagementClientSqlManagedInstances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureArcDataManageme") + private interface SqlManagedInstancesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances") + @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" + + "/sqlManagedInstances") + @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" + + "/sqlManagedInstances/{sqlManagedInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlManagedInstanceName") String sqlManagedInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlManagedInstances/{sqlManagedInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlManagedInstanceName") String sqlManagedInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlManagedInstanceInner sqlManagedInstance, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlManagedInstances/{sqlManagedInstanceName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlManagedInstanceName") String sqlManagedInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlManagedInstances/{sqlManagedInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlManagedInstanceName") String sqlManagedInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlManagedInstanceUpdate 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 sqlManagedInstance 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 SqlManagedInstance. + */ + @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 sqlManagedInstance 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 SqlManagedInstance. + */ + @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 sqlManagedInstance 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 SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List sqlManagedInstance 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 SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List sqlManagedInstance 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 SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List sqlManagedInstance 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 SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieves a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sqlManagedInstanceName) { + 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlManagedInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 ManagementException 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) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sqlManagedInstanceName, 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName 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, + sqlManagedInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieves a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a SqlManagedInstance. + */ + @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(); + } + }); + } + + /** + * Retrieves a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlManagedInstanceInner getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName) { + return getByResourceGroupAsync(resourceGroupName, sqlManagedInstanceName).block(); + } + + /** + * 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 ManagementException 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(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance) { + 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName is required and cannot be null.")); + } + if (sqlManagedInstance == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlManagedInstance is required and cannot be null.")); + } else { + sqlManagedInstance.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlManagedInstanceName, + this.client.getApiVersion(), + sqlManagedInstance, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sqlManagedInstanceName, + SqlManagedInstanceInner sqlManagedInstance, + 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName is required and cannot be null.")); + } + if (sqlManagedInstance == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlManagedInstance is required and cannot be null.")); + } else { + sqlManagedInstance.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlManagedInstanceName, + this.client.getApiVersion(), + sqlManagedInstance, + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SqlManagedInstanceInner> beginCreateAsync( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlManagedInstanceInner.class, + SqlManagedInstanceInner.class, + Context.NONE); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SqlManagedInstanceInner> beginCreateAsync( + String resourceGroupName, + String sqlManagedInstanceName, + SqlManagedInstanceInner sqlManagedInstance, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlManagedInstanceInner.class, + SqlManagedInstanceInner.class, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SqlManagedInstanceInner> beginCreate( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance) { + return beginCreateAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance).getSyncPoller(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SqlManagedInstanceInner> beginCreate( + String resourceGroupName, + String sqlManagedInstanceName, + SqlManagedInstanceInner sqlManagedInstance, + Context context) { + return beginCreateAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance, context).getSyncPoller(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance) { + return beginCreateAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sqlManagedInstanceName, + SqlManagedInstanceInner sqlManagedInstance, + Context context) { + return beginCreateAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlManagedInstanceInner create( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceInner sqlManagedInstance) { + return createAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlManagedInstanceInner create( + String resourceGroupName, + String sqlManagedInstanceName, + SqlManagedInstanceInner sqlManagedInstance, + Context context) { + return createAsync(resourceGroupName, sqlManagedInstanceName, sqlManagedInstance, context).block(); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String sqlManagedInstanceName) { + 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlManagedInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String sqlManagedInstanceName, 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName 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, + sqlManagedInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlManagedInstanceName) { + return deleteWithResponseAsync(resourceGroupName, sqlManagedInstanceName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlManagedInstanceName) { + deleteAsync(resourceGroupName, sqlManagedInstanceName).block(); + } + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, sqlManagedInstanceName, context).block(); + } + + /** + * Updates a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName 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, + sqlManagedInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @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) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate 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 (sqlManagedInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlManagedInstanceName 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, + sqlManagedInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @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. + */ + @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(); + } + }); + } + + /** + * Updates a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlManagedInstanceInner update( + String resourceGroupName, String sqlManagedInstanceName, SqlManagedInstanceUpdate parameters) { + return updateAsync(resourceGroupName, sqlManagedInstanceName, parameters).block(); + } + + /** + * Updates a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName Name of sqlManagedInstance. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlManagedInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlManagedInstance. + */ + @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/SqlManagedInstancesImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesImpl.java new file mode 100644 index 0000000000000..fefbc183159f5 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlManagedInstancesImpl.java @@ -0,0 +1,181 @@ +// 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.SqlManagedInstancesClient; +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 final SqlManagedInstancesClient innerClient; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public SqlManagedInstancesImpl( + SqlManagedInstancesClient 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 SqlManagedInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SqlManagedInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SqlManagedInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + 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 = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sqlManagedInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlManagedInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sqlManagedInstanceName) { + this.serviceClient().delete(resourceGroupName, sqlManagedInstanceName); + } + + public Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, sqlManagedInstanceName, context); + } + + public SqlManagedInstance 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 sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); + if (sqlManagedInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlManagedInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlManagedInstanceName, 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 sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); + if (sqlManagedInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlManagedInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlManagedInstanceName, 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 sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); + if (sqlManagedInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlManagedInstances'.", id))); + } + this.deleteWithResponse(resourceGroupName, sqlManagedInstanceName, Context.NONE).getValue(); + } + + 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 sqlManagedInstanceName = Utils.getValueFromIdByName(id, "sqlManagedInstances"); + if (sqlManagedInstanceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlManagedInstances'.", id))); + } + return this.deleteWithResponse(resourceGroupName, sqlManagedInstanceName, context); + } + + private SqlManagedInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + public SqlManagedInstanceImpl define(String name) { + return new SqlManagedInstanceImpl(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 new file mode 100644 index 0000000000000..5711b394ba3d0 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstanceImpl.java @@ -0,0 +1,188 @@ +// 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.SqlServerInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstance; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SqlServerInstanceImpl + implements SqlServerInstance, SqlServerInstance.Definition, SqlServerInstance.Update { + private SqlServerInstanceInner 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 SqlServerInstanceProperties 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 SqlServerInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlServerInstanceName; + + private SqlServerInstanceUpdate updateParameters; + + public SqlServerInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SqlServerInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerInstances() + .create(resourceGroupName, sqlServerInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public SqlServerInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerInstances() + .create(resourceGroupName, sqlServerInstanceName, this.innerModel(), context); + return this; + } + + SqlServerInstanceImpl(String name, com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager) { + this.innerObject = new SqlServerInstanceInner(); + this.serviceManager = serviceManager; + this.sqlServerInstanceName = name; + } + + public SqlServerInstanceImpl update() { + this.updateParameters = new SqlServerInstanceUpdate(); + return this; + } + + public SqlServerInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerInstances() + .updateWithResponse(resourceGroupName, sqlServerInstanceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public SqlServerInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerInstances() + .updateWithResponse(resourceGroupName, sqlServerInstanceName, updateParameters, context) + .getValue(); + return this; + } + + SqlServerInstanceImpl( + SqlServerInstanceInner 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"); + } + + public SqlServerInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerInstances() + .getByResourceGroupWithResponse(resourceGroupName, sqlServerInstanceName, Context.NONE) + .getValue(); + return this; + } + + public SqlServerInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlServerInstances() + .getByResourceGroupWithResponse(resourceGroupName, sqlServerInstanceName, context) + .getValue(); + return this; + } + + public SqlServerInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SqlServerInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SqlServerInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SqlServerInstanceImpl withProperties(SqlServerInstanceProperties properties) { + this.innerModel().withProperties(properties); + 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/SqlServerInstancesClientImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesClientImpl.java new file mode 100644 index 0000000000000..dc73beb7e8255 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesClientImpl.java @@ -0,0 +1,1379 @@ +// 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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurearcdata.fluent.SqlServerInstancesClient; +import com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerInstanceInner; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceListResult; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceUpdate; +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 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; + + /** The service client containing this operation class. */ + private final AzureArcDataManagementClientImpl client; + + /** + * Initializes an instance of SqlServerInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlServerInstancesClientImpl(AzureArcDataManagementClientImpl client) { + this.service = + RestProxy.create(SqlServerInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureArcDataManagementClientSqlServerInstances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureArcDataManageme") + private interface SqlServerInstancesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances") + @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" + + "/sqlServerInstances") + @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" + + "/sqlServerInstances/{sqlServerInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @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"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlServerInstanceName") String sqlServerInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlServerInstanceInner sqlServerInstance, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @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"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData" + + "/sqlServerInstances/{sqlServerInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlServerInstanceName") String sqlServerInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlServerInstanceUpdate 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 sqlServerInstance 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 SqlServerInstance. + */ + @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 sqlServerInstance 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 SqlServerInstance. + */ + @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 sqlServerInstance 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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List sqlServerInstance 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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List sqlServerInstance 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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List sqlServerInstance 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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieves a SQL Server Instance resource. + * + * @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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + 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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 ManagementException 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) + private Mono> getByResourceGroupWithResponseAsync( + 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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieves a SQL Server Instance resource. + * + * @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 SqlServerInstance. + */ + @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(); + } + }); + } + + /** + * Retrieves a SQL Server Instance resource. + * + * @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 SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlServerInstanceInner getByResourceGroup(String resourceGroupName, String sqlServerInstanceName) { + return getByResourceGroupAsync(resourceGroupName, sqlServerInstanceName).block(); + } + + /** + * 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 ManagementException 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(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance) { + 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 (sqlServerInstance == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstance is required and cannot be null.")); + } else { + sqlServerInstance.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + this.client.getApiVersion(), + sqlServerInstance, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sqlServerInstanceName, + SqlServerInstanceInner sqlServerInstance, + 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 (sqlServerInstance == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstance is required and cannot be null.")); + } else { + sqlServerInstance.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + this.client.getApiVersion(), + sqlServerInstance, + accept, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SqlServerInstanceInner> beginCreateAsync( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlServerInstanceInner.class, + SqlServerInstanceInner.class, + Context.NONE); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SqlServerInstanceInner> beginCreateAsync( + String resourceGroupName, + String sqlServerInstanceName, + SqlServerInstanceInner sqlServerInstance, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlServerInstanceInner.class, + SqlServerInstanceInner.class, + context); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SqlServerInstanceInner> beginCreate( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance) { + return beginCreateAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance).getSyncPoller(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SqlServerInstanceInner> beginCreate( + String resourceGroupName, + String sqlServerInstanceName, + SqlServerInstanceInner sqlServerInstance, + Context context) { + return beginCreateAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance, context).getSyncPoller(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance) { + return beginCreateAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sqlServerInstanceName, + SqlServerInstanceInner sqlServerInstance, + Context context) { + return beginCreateAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlServerInstanceInner create( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceInner sqlServerInstance) { + return createAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance).block(); + } + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlServerInstanceInner create( + String resourceGroupName, + String sqlServerInstanceName, + SqlServerInstanceInner sqlServerInstance, + Context context) { + return createAsync(resourceGroupName, sqlServerInstanceName, sqlServerInstance, context).block(); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(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 + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + 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 + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sqlServerInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlServerInstanceName) { + return deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlServerInstanceName) { + deleteAsync(resourceGroupName, sqlServerInstanceName).block(); + } + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, sqlServerInstanceName, context).block(); + } + + /** + * Updates a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of sqlServerInstance. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName 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, + sqlServerInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of sqlServerInstance. + * @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) + private Mono> updateWithResponseAsync( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate 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 (sqlServerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlServerInstanceName 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, + sqlServerInstanceName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of sqlServerInstance. + * @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. + */ + @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(); + } + }); + } + + /** + * Updates a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of sqlServerInstance. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlServerInstanceInner update( + String resourceGroupName, String sqlServerInstanceName, SqlServerInstanceUpdate parameters) { + return updateAsync(resourceGroupName, sqlServerInstanceName, parameters).block(); + } + + /** + * Updates a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName Name of sqlServerInstance. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlServerInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SqlServerInstance. + */ + @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/SqlServerInstancesImpl.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesImpl.java new file mode 100644 index 0000000000000..77145334c0842 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/SqlServerInstancesImpl.java @@ -0,0 +1,181 @@ +// 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.SqlServerInstancesClient; +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 final SqlServerInstancesClient innerClient; + + private final com.azure.resourcemanager.azurearcdata.AzureArcDataManager serviceManager; + + public SqlServerInstancesImpl( + SqlServerInstancesClient 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 SqlServerInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SqlServerInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SqlServerInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + 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 = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sqlServerInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlServerInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sqlServerInstanceName) { + this.serviceClient().delete(resourceGroupName, sqlServerInstanceName); + } + + public Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, sqlServerInstanceName, context); + } + + public SqlServerInstance 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlServerInstanceName, 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))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlServerInstanceName, 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))); + } + this.deleteWithResponse(resourceGroupName, sqlServerInstanceName, Context.NONE).getValue(); + } + + 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))); + } + return this.deleteWithResponse(resourceGroupName, sqlServerInstanceName, context); + } + + private SqlServerInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azurearcdata.AzureArcDataManager manager() { + return this.serviceManager; + } + + public SqlServerInstanceImpl define(String name) { + return new SqlServerInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/Utils.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/Utils.java new file mode 100644 index 0000000000000..415d85cc0e6a7 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/Utils.java @@ -0,0 +1,204 @@ +// 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.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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/package-info.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/package-info.java new file mode 100644 index 0000000000000..fc141afd38d43 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for AzureArcDataManagementClient. The AzureArcData management API provides a + * RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ +package com.azure.resourcemanager.azurearcdata.implementation; 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 new file mode 100644 index 0000000000000..1925e9d25024c --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlManagedInstanceLicenseType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ArcSqlManagedInstanceLicenseType. */ +public enum ArcSqlManagedInstanceLicenseType { + /** Enum value BasePrice. */ + BASE_PRICE("BasePrice"), + + /** Enum value LicenseIncluded. */ + LICENSE_INCLUDED("LicenseIncluded"); + + /** The actual serialized value for a ArcSqlManagedInstanceLicenseType instance. */ + private final String value; + + ArcSqlManagedInstanceLicenseType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ArcSqlManagedInstanceLicenseType instance. + * + * @param value the serialized value to parse. + * @return the parsed ArcSqlManagedInstanceLicenseType object, or null if unable to parse. + */ + @JsonCreator + public static ArcSqlManagedInstanceLicenseType fromString(String value) { + ArcSqlManagedInstanceLicenseType[] items = ArcSqlManagedInstanceLicenseType.values(); + for (ArcSqlManagedInstanceLicenseType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerLicenseType.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerLicenseType.java new file mode 100644 index 0000000000000..3c751f3fa80d3 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ArcSqlServerLicenseType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ArcSqlServerLicenseType. */ +public final class ArcSqlServerLicenseType extends ExpandableStringEnum { + /** Static value Paid for ArcSqlServerLicenseType. */ + public static final ArcSqlServerLicenseType PAID = fromString("Paid"); + + /** Static value Free for ArcSqlServerLicenseType. */ + public static final ArcSqlServerLicenseType FREE = fromString("Free"); + + /** Static value HADR for ArcSqlServerLicenseType. */ + public static final ArcSqlServerLicenseType HADR = fromString("HADR"); + + /** Static value Undefined for ArcSqlServerLicenseType. */ + public static final ArcSqlServerLicenseType UNDEFINED = fromString("Undefined"); + + /** + * Creates or finds a ArcSqlServerLicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArcSqlServerLicenseType. + */ + @JsonCreator + public static ArcSqlServerLicenseType fromString(String name) { + return fromString(name, ArcSqlServerLicenseType.class); + } + + /** @return known ArcSqlServerLicenseType values. */ + public static Collection 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 new file mode 100644 index 0000000000000..271f94b853f10 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/BasicLoginInformation.java @@ -0,0 +1,76 @@ +// 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; + +/** Username and password for basic login authentication. */ +@Fluent +public final class BasicLoginInformation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BasicLoginInformation.class); + + /* + * Login username. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Login password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the username property: Login username. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Login username. + * + * @param username the username value to set. + * @return the BasicLoginInformation object itself. + */ + public BasicLoginInformation withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Login password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Login password. + * + * @param password the password value to set. + * @return the BasicLoginInformation object itself. + */ + public BasicLoginInformation withPassword(String password) { + this.password = password; + 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/ConnectionStatus.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ConnectionStatus.java new file mode 100644 index 0000000000000..a21bff9dbae55 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ConnectionStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionStatus. */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for ConnectionStatus. */ + public static final ConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Unknown for ConnectionStatus. */ + public static final ConnectionStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** @return known ConnectionStatus values. */ + public static Collection 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 new file mode 100644 index 0000000000000..b4f99641c2a8e --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerProperties.java @@ -0,0 +1,324 @@ +// 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.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. + */ + @JsonProperty(value = "infrastructure") + private Infrastructure infrastructure; + + /* + * Properties from the Kubernetes data controller + */ + @JsonProperty(value = "onPremiseProperty") + private OnPremiseProperty onPremiseProperty; + + /* + * The raw kubernetes information + */ + @JsonProperty(value = "k8sRaw") + private Object k8SRaw; + + /* + * 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 + */ + @JsonProperty(value = "lastUploadedDate") + private OffsetDateTime lastUploadedDate; + + /* + * Username and password for basic login authentication. + */ + @JsonProperty(value = "basicLoginInformation") + private BasicLoginInformation basicLoginInformation; + + /* + * Log analytics workspace id and primary key + */ + @JsonProperty(value = "logAnalyticsWorkspaceConfig") + private LogAnalyticsWorkspaceConfig logAnalyticsWorkspaceConfig; + + /* + * Service principal for uploading billing, metrics and logs. + */ + @JsonProperty(value = "uploadServicePrincipal") + private UploadServicePrincipal uploadServicePrincipal; + + /* + * The provisioningState property. + */ + @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. + */ + @JsonProperty(value = "clusterId") + private String clusterId; + + /* + * If a CustomLocation is provided, this contains the ARM id of the + * extension the custom location belongs to. + */ + @JsonProperty(value = "extensionId") + private String extensionId; + + /** + * Get the infrastructure property: The infrastructure the data controller is running on. + * + * @return the infrastructure value. + */ + public Infrastructure infrastructure() { + return this.infrastructure; + } + + /** + * Set the infrastructure property: The infrastructure the data controller is running on. + * + * @param infrastructure the infrastructure value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withInfrastructure(Infrastructure infrastructure) { + this.infrastructure = infrastructure; + return this; + } + + /** + * Get the onPremiseProperty property: Properties from the Kubernetes data controller. + * + * @return the onPremiseProperty value. + */ + public OnPremiseProperty onPremiseProperty() { + return this.onPremiseProperty; + } + + /** + * Set the onPremiseProperty property: Properties from the Kubernetes data controller. + * + * @param onPremiseProperty the onPremiseProperty value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withOnPremiseProperty(OnPremiseProperty onPremiseProperty) { + this.onPremiseProperty = onPremiseProperty; + 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 DataControllerProperties object itself. + */ + public DataControllerProperties withK8SRaw(Object k8SRaw) { + this.k8SRaw = k8SRaw; + return this; + } + + /** + * Get the uploadWatermark property: Properties on upload watermark. Mostly timestamp for each upload data type. + * + * @return the uploadWatermark value. + */ + public UploadWatermark uploadWatermark() { + return this.uploadWatermark; + } + + /** + * Set the uploadWatermark property: Properties on upload watermark. Mostly timestamp for each upload data type. + * + * @param uploadWatermark the uploadWatermark value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withUploadWatermark(UploadWatermark uploadWatermark) { + this.uploadWatermark = uploadWatermark; + 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 DataControllerProperties object itself. + */ + public DataControllerProperties withLastUploadedDate(OffsetDateTime lastUploadedDate) { + this.lastUploadedDate = lastUploadedDate; + return this; + } + + /** + * Get the basicLoginInformation property: Username and password for basic login authentication. + * + * @return the basicLoginInformation value. + */ + public BasicLoginInformation basicLoginInformation() { + return this.basicLoginInformation; + } + + /** + * Set the basicLoginInformation property: Username and password for basic login authentication. + * + * @param basicLoginInformation the basicLoginInformation value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withBasicLoginInformation(BasicLoginInformation basicLoginInformation) { + this.basicLoginInformation = basicLoginInformation; + return this; + } + + /** + * Get the logAnalyticsWorkspaceConfig property: Log analytics workspace id and primary key. + * + * @return the logAnalyticsWorkspaceConfig value. + */ + public LogAnalyticsWorkspaceConfig logAnalyticsWorkspaceConfig() { + return this.logAnalyticsWorkspaceConfig; + } + + /** + * Set the logAnalyticsWorkspaceConfig property: Log analytics workspace id and primary key. + * + * @param logAnalyticsWorkspaceConfig the logAnalyticsWorkspaceConfig value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withLogAnalyticsWorkspaceConfig( + LogAnalyticsWorkspaceConfig logAnalyticsWorkspaceConfig) { + this.logAnalyticsWorkspaceConfig = logAnalyticsWorkspaceConfig; + return this; + } + + /** + * Get the uploadServicePrincipal property: Service principal for uploading billing, metrics and logs. + * + * @return the uploadServicePrincipal value. + */ + public UploadServicePrincipal uploadServicePrincipal() { + return this.uploadServicePrincipal; + } + + /** + * Set the uploadServicePrincipal property: Service principal for uploading billing, metrics and logs. + * + * @param uploadServicePrincipal the uploadServicePrincipal value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withUploadServicePrincipal(UploadServicePrincipal uploadServicePrincipal) { + this.uploadServicePrincipal = uploadServicePrincipal; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterId property: If a CustomLocation is provided, this contains the ARM id of the connected cluster + * the custom location belongs to. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Set the clusterId property: If a CustomLocation is provided, this contains the ARM id of the connected cluster + * the custom location belongs to. + * + * @param clusterId the clusterId value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withClusterId(String clusterId) { + this.clusterId = clusterId; + return this; + } + + /** + * Get the extensionId property: If a CustomLocation is provided, this contains the ARM id of the extension the + * custom location belongs to. + * + * @return the extensionId value. + */ + public String extensionId() { + return this.extensionId; + } + + /** + * Set the extensionId property: If a CustomLocation is provided, this contains the ARM id of the extension the + * custom location belongs to. + * + * @param extensionId the extensionId value to set. + * @return the DataControllerProperties object itself. + */ + public DataControllerProperties withExtensionId(String extensionId) { + this.extensionId = extensionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (onPremiseProperty() != null) { + onPremiseProperty().validate(); + } + if (uploadWatermark() != null) { + uploadWatermark().validate(); + } + if (basicLoginInformation() != null) { + basicLoginInformation().validate(); + } + if (logAnalyticsWorkspaceConfig() != null) { + logAnalyticsWorkspaceConfig().validate(); + } + if (uploadServicePrincipal() != null) { + uploadServicePrincipal().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 new file mode 100644 index 0000000000000..139216842e724 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerResource.java @@ -0,0 +1,235 @@ +// 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.DataControllerResourceInner; +import java.util.Map; + +/** An immutable client-side representation of DataControllerResource. */ +public interface DataControllerResource { + /** + * 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: The data controller's properties. + * + * @return the properties value. + */ + DataControllerProperties properties(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.DataControllerResourceInner object. + * + * @return the inner object. + */ + DataControllerResourceInner innerModel(); + + /** The entirety of the DataControllerResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The DataControllerResource definition stages. */ + interface DefinitionStages { + /** The first stage of the DataControllerResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DataControllerResource 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 DataControllerResource 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 DataControllerResource definition 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. + */ + WithCreate withProperties(DataControllerProperties properties); + } + /** + * The stage of the DataControllerResource 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataControllerResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataControllerResource create(Context context); + } + /** The stage of the DataControllerResource 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 DataControllerResource 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); + } + } + /** + * Begins update for the DataControllerResource resource. + * + * @return the stage of resource update. + */ + DataControllerResource.Update update(); + + /** The template for DataControllerResource update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataControllerResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataControllerResource apply(Context context); + } + /** The DataControllerResource update stages. */ + interface UpdateStages { + /** The stage of the DataControllerResource 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataControllerResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataControllerResource refresh(Context context); +} 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 new file mode 100644 index 0000000000000..0ba784b1c5492 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllerUpdate.java @@ -0,0 +1,51 @@ +// 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.Map; + +/** Used for updating a data controller resource. */ +@Fluent +public final class DataControllerUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataControllerUpdate.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 DataControllerUpdate object itself. + */ + public DataControllerUpdate withTags(Map tags) { + this.tags = tags; + 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/DataControllers.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllers.java new file mode 100644 index 0000000000000..9314e36bfd28d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DataControllers.java @@ -0,0 +1,158 @@ +// 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 DataControllers. */ +public interface DataControllers { + /** + * List dataController 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 the response. + */ + PagedIterable list(); + + /** + * List dataController 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 the response. + */ + PagedIterable list(Context context); + + /** + * List dataController resources in the 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 the response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List dataController resources in the 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 the response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String dataControllerName); + + /** + * Deletes a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String dataControllerName, Context context); + + /** + * Retrieves a dataController resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param dataControllerName The dataControllerName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data controller resource. + */ + DataControllerResource getByResourceGroup(String resourceGroupName, String dataControllerName); + + /** + * 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. + * @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); + + /** + * Retrieves a dataController 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 data controller resource. + */ + DataControllerResource getById(String id); + + /** + * Retrieves a dataController 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 data controller resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a dataController 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 dataController 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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataControllerResource resource. + * + * @param name resource name. + * @return the first stage of the new DataControllerResource definition. + */ + DataControllerResource.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..7ff84b64165d9 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/DefenderStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefenderStatus. */ +public final class DefenderStatus extends ExpandableStringEnum { + /** Static value Protected for DefenderStatus. */ + public static final DefenderStatus PROTECTED = fromString("Protected"); + + /** Static value Unprotected for DefenderStatus. */ + public static final DefenderStatus UNPROTECTED = fromString("Unprotected"); + + /** Static value Unknown for DefenderStatus. */ + public static final DefenderStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a DefenderStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefenderStatus. + */ + @JsonCreator + public static DefenderStatus fromString(String name) { + return fromString(name, DefenderStatus.class); + } + + /** @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 new file mode 100644 index 0000000000000..25c796eb8f333 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/EditionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EditionType. */ +public final class EditionType extends ExpandableStringEnum { + /** Static value Evaluation for EditionType. */ + public static final EditionType EVALUATION = fromString("Evaluation"); + + /** Static value Enterprise for EditionType. */ + public static final EditionType ENTERPRISE = fromString("Enterprise"); + + /** Static value Standard for EditionType. */ + public static final EditionType STANDARD = fromString("Standard"); + + /** Static value Web for EditionType. */ + public static final EditionType WEB = fromString("Web"); + + /** Static value Developer for EditionType. */ + public static final EditionType DEVELOPER = fromString("Developer"); + + /** Static value Express for EditionType. */ + public static final EditionType EXPRESS = fromString("Express"); + + /** + * Creates or finds a EditionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EditionType. + */ + @JsonCreator + public static EditionType fromString(String name) { + return fromString(name, EditionType.class); + } + + /** @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 new file mode 100644 index 0000000000000..cddf67c1c4afc --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocation.java @@ -0,0 +1,76 @@ +// 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; + +/** 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. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + 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/ExtendedLocationTypes.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..a1b6c00434fc4 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ExtendedLocationTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtendedLocationTypes. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value CustomLocation for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes CUSTOM_LOCATION = fromString("CustomLocation"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** @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/Infrastructure.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Infrastructure.java new file mode 100644 index 0000000000000..b5cabc0821604 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Infrastructure.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Infrastructure. */ +public enum Infrastructure { + /** Enum value azure. */ + AZURE("azure"), + + /** Enum value gcp. */ + GCP("gcp"), + + /** Enum value aws. */ + AWS("aws"), + + /** Enum value alibaba. */ + ALIBABA("alibaba"), + + /** Enum value onpremises. */ + ONPREMISES("onpremises"), + + /** Enum value other. */ + OTHER("other"); + + /** The actual serialized value for a Infrastructure instance. */ + private final String value; + + Infrastructure(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Infrastructure instance. + * + * @param value the serialized value to parse. + * @return the parsed Infrastructure object, or null if unable to parse. + */ + @JsonCreator + public static Infrastructure fromString(String value) { + Infrastructure[] items = Infrastructure.values(); + for (Infrastructure item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java new file mode 100644 index 0000000000000..049236bd681f3 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SResourceRequirements.java @@ -0,0 +1,131 @@ +// 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.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 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 + * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. + */ + @JsonProperty(value = "requests") + 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 + * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. + */ + @JsonProperty(value = "limits") + private Map limits; + + /* + * The kubernetes resource limits and requests used to restrict or reserve + * resource usage. + */ + @JsonIgnore private Map additionalProperties; + + /** + * 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 + * '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. + * + * @return the requests value. + */ + public Map requests() { + return this.requests; + } + + /** + * Set 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 + * '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'. + * + * @param requests the requests value to set. + * @return the K8SResourceRequirements object itself. + */ + public K8SResourceRequirements withRequests(Map requests) { + this.requests = requests; + return this; + } + + /** + * Get the limits property: 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'. + * + * @return the limits value. + */ + public Map limits() { + return this.limits; + } + + /** + * Set the limits property: 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'. + * + * @param limits the limits value to set. + * @return the K8SResourceRequirements object itself. + */ + public K8SResourceRequirements withLimits(Map limits) { + this.limits = limits; + return this; + } + + /** + * Get the additionalProperties property: The kubernetes resource limits and requests used to restrict or reserve + * resource usage. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The kubernetes resource limits and requests used to restrict or reserve + * resource usage. + * + * @param additionalProperties the additionalProperties value to set. + * @return the K8SResourceRequirements object itself. + */ + public K8SResourceRequirements 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/K8SScheduling.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SScheduling.java new file mode 100644 index 0000000000000..44acafd387b91 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SScheduling.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.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; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** 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 + */ + @JsonProperty(value = "default") + private K8SSchedulingOptions defaultProperty; + + /* + * The kubernetes scheduling information. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the defaultProperty property: The kubernetes scheduling options. It describes restrictions used to help + * Kubernetes select appropriate nodes to host the database service. + * + * @return the defaultProperty value. + */ + public K8SSchedulingOptions defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The kubernetes scheduling options. It describes restrictions used to help + * Kubernetes select appropriate nodes to host the database service. + * + * @param defaultProperty the defaultProperty value to set. + * @return the K8SScheduling object itself. + */ + public K8SScheduling withDefaultProperty(K8SSchedulingOptions defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the additionalProperties property: The kubernetes scheduling information. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The kubernetes scheduling information. + * + * @param additionalProperties the additionalProperties value to set. + * @return the K8SScheduling object itself. + */ + public K8SScheduling 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() { + if (defaultProperty() != null) { + defaultProperty().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..8fe21837d997f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/K8SSchedulingOptions.java @@ -0,0 +1,100 @@ +// 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.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 kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host + * the database service. + */ +@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. + */ + @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 + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the resources property: The kubernetes resource limits and requests used to restrict or reserve resource + * usage. + * + * @return the resources value. + */ + public K8SResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resources property: The kubernetes resource limits and requests used to restrict or reserve resource + * usage. + * + * @param resources the resources value to set. + * @return the K8SSchedulingOptions object itself. + */ + public K8SSchedulingOptions withResources(K8SResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the additionalProperties property: The kubernetes scheduling options. It describes restrictions used to help + * Kubernetes select appropriate nodes to host the database service. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The kubernetes scheduling options. It describes restrictions used to help + * Kubernetes select appropriate nodes to host the database service. + * + * @param additionalProperties the additionalProperties value to set. + * @return the K8SSchedulingOptions object itself. + */ + public K8SSchedulingOptions 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() { + if (resources() != null) { + resources().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 new file mode 100644 index 0000000000000..52f6ba78ccafd --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/LogAnalyticsWorkspaceConfig.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.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 + */ + @JsonProperty(value = "workspaceId") + private UUID workspaceId; + + /* + * Primary key of the workspace + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspaceId property: Azure Log Analytics workspace ID. + * + * @return the workspaceId value. + */ + public UUID workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: Azure Log Analytics workspace ID. + * + * @param workspaceId the workspaceId value to set. + * @return the LogAnalyticsWorkspaceConfig object itself. + */ + public LogAnalyticsWorkspaceConfig withWorkspaceId(UUID workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the primaryKey property: Primary key of the workspace. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary key of the workspace. + * + * @param primaryKey the primaryKey value to set. + * @return the LogAnalyticsWorkspaceConfig object itself. + */ + public LogAnalyticsWorkspaceConfig withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + 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/ODataError.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ODataError.java new file mode 100644 index 0000000000000..750a06ada079a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ODataError.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.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 new file mode 100644 index 0000000000000..8073a44675bb4 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OnPremiseProperty.java @@ -0,0 +1,120 @@ +// 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.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 + */ + @JsonProperty(value = "id", required = true) + private UUID id; + + /* + * 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 + */ + @JsonProperty(value = "signingCertificateThumbprint") + private String signingCertificateThumbprint; + + /** + * Get the id property: A globally unique ID identifying the associated Kubernetes cluster. + * + * @return the id value. + */ + public UUID id() { + return this.id; + } + + /** + * Set the id property: A globally unique ID identifying the associated Kubernetes cluster. + * + * @param id the id value to set. + * @return the OnPremiseProperty object itself. + */ + public OnPremiseProperty withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get the publicSigningKey property: Certificate that contains the Kubernetes cluster public key used to verify + * signing. + * + * @return the publicSigningKey value. + */ + public String publicSigningKey() { + return this.publicSigningKey; + } + + /** + * Set the publicSigningKey property: Certificate that contains the Kubernetes cluster public key used to verify + * signing. + * + * @param publicSigningKey the publicSigningKey value to set. + * @return the OnPremiseProperty object itself. + */ + public OnPremiseProperty withPublicSigningKey(String publicSigningKey) { + this.publicSigningKey = publicSigningKey; + return this; + } + + /** + * Get the signingCertificateThumbprint property: Unique thumbprint returned to customer to verify the certificate + * being uploaded. + * + * @return the signingCertificateThumbprint value. + */ + public String signingCertificateThumbprint() { + return this.signingCertificateThumbprint; + } + + /** + * Set the signingCertificateThumbprint property: Unique thumbprint returned to customer to verify the certificate + * being uploaded. + * + * @param signingCertificateThumbprint the signingCertificateThumbprint value to set. + * @return the OnPremiseProperty object itself. + */ + public OnPremiseProperty withSigningCertificateThumbprint(String signingCertificateThumbprint) { + this.signingCertificateThumbprint = signingCertificateThumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model OnPremiseProperty")); + } + if (publicSigningKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicSigningKey in model OnPremiseProperty")); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operation.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operation.java new file mode 100644 index 0000000000000..ec2a3d7c4a1e6 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operation.java @@ -0,0 +1,53 @@ +// 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.resourcemanager.azurearcdata.fluent.models.OperationInner; +import java.util.Map; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The localized display information for this particular operation / action. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + OperationOrigin origin(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + boolean isDataAction(); + + /** + * Gets the properties property: Additional descriptions for the operation. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} 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 new file mode 100644 index 0000000000000..900ac0a42440d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationDisplay.java @@ -0,0 +1,149 @@ +// 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; + +/** 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. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /* + * The localized friendly form of the resource type related to this + * action/operation. + */ + @JsonProperty(value = "resource", required = true) + private String resource; + + /* + * The localized friendly name for the operation. + */ + @JsonProperty(value = "operation", required = true) + private String operation; + + /* + * The localized friendly description for the operation. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * Get the provider property: The localized friendly form of the resource provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The localized friendly form of the resource provider name. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The localized friendly form of the resource type related to this action/operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The localized friendly form of the resource type related to this action/operation. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The localized friendly name for the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The localized friendly description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property provider in model OperationDisplay")); + } + if (resource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property resource in model OperationDisplay")); + } + if (operation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property operation in model OperationDisplay")); + } + if (description() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property description in model OperationDisplay")); + } + } +} 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 new file mode 100644 index 0000000000000..79077e77c3214 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationListResult.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.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. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java new file mode 100644 index 0000000000000..2d073d99bf58d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/OperationOrigin.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationOrigin. */ +public final class OperationOrigin extends ExpandableStringEnum { + /** Static value user for OperationOrigin. */ + public static final OperationOrigin USER = fromString("user"); + + /** Static value system for OperationOrigin. */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** + * Creates or finds a OperationOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationOrigin. + */ + @JsonCreator + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** @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 new file mode 100644 index 0000000000000..83a59ffdfc079 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/Operations.java @@ -0,0 +1,31 @@ +// 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.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Azure Data Services on Azure Arc API 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. + */ + PagedIterable list(); + + /** + * Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @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 result of the request to list Azure Data Services on Azure Arc operations. + */ + 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 new file mode 100644 index 0000000000000..444b1b8bf1937 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/PageOfDataControllerResource.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.annotation.Fluent; +import com.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. */ +@Fluent +public final class PageOfDataControllerResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PageOfDataControllerResource.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the PageOfDataControllerResource object itself. + */ + public PageOfDataControllerResource withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to retrieve next page of results. + * + * @param nextLink the nextLink value to set. + * @return the PageOfDataControllerResource object itself. + */ + public PageOfDataControllerResource withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ResourceIdentityType.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..06635620501e4 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/ResourceIdentityType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java new file mode 100644 index 0000000000000..fc3534446c6e8 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstance.java @@ -0,0 +1,253 @@ +// 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.SqlManagedInstanceInner; +import java.util.Map; + +/** An immutable client-side representation of SqlManagedInstance. */ +public interface SqlManagedInstance { + /** + * 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: null. + * + * @return the properties value. + */ + SqlManagedInstanceProperties properties(); + + /** + * Gets the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the sku property: Resource sku. + * + * @return the sku value. + */ + SqlManagedInstanceSku sku(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.SqlManagedInstanceInner object. + * + * @return the inner object. + */ + SqlManagedInstanceInner innerModel(); + + /** The entirety of the SqlManagedInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The SqlManagedInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlManagedInstance definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SqlManagedInstance 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 SqlManagedInstance 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 SqlManagedInstance definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: null. + * + * @param properties null. + * @return the next definition stage. + */ + WithCreate withProperties(SqlManagedInstanceProperties properties); + } + /** + * The stage of the SqlManagedInstance 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. + */ + SqlManagedInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlManagedInstance create(Context context); + } + /** The stage of the SqlManagedInstance 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 SqlManagedInstance 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 SqlManagedInstance definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Resource sku.. + * + * @param sku Resource sku. + * @return the next definition stage. + */ + WithCreate withSku(SqlManagedInstanceSku sku); + } + } + /** + * Begins update for the SqlManagedInstance resource. + * + * @return the stage of resource update. + */ + SqlManagedInstance.Update update(); + + /** The template for SqlManagedInstance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlManagedInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlManagedInstance apply(Context context); + } + /** The SqlManagedInstance update stages. */ + interface UpdateStages { + /** The stage of the SqlManagedInstance 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlManagedInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlManagedInstance refresh(Context context); +} 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 new file mode 100644 index 0000000000000..ea188cdfcb7c4 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SRaw.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.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 raw kubernetes information. */ +@Fluent +public final class SqlManagedInstanceK8SRaw { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceK8SRaw.class); + + /* + * The kubernetes spec information. + */ + @JsonProperty(value = "spec") + private SqlManagedInstanceK8SSpec spec; + + /* + * The raw kubernetes information. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the spec property: The kubernetes spec information. + * + * @return the spec value. + */ + public SqlManagedInstanceK8SSpec spec() { + return this.spec; + } + + /** + * Set the spec property: The kubernetes spec information. + * + * @param spec the spec value to set. + * @return the SqlManagedInstanceK8SRaw object itself. + */ + public SqlManagedInstanceK8SRaw withSpec(SqlManagedInstanceK8SSpec spec) { + this.spec = spec; + return this; + } + + /** + * Get the additionalProperties property: The raw kubernetes information. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The raw kubernetes information. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SqlManagedInstanceK8SRaw object itself. + */ + public SqlManagedInstanceK8SRaw 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() { + if (spec() != null) { + spec().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..b51d71b843f5f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceK8SSpec.java @@ -0,0 +1,125 @@ +// 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.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 kubernetes spec information. */ +@Fluent +public final class SqlManagedInstanceK8SSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceK8SSpec.class); + + /* + * The kubernetes scheduling information. + */ + @JsonProperty(value = "scheduling") + 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'. + */ + @JsonProperty(value = "replicas") + private Integer replicas; + + /* + * The kubernetes spec information. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the scheduling property: The kubernetes scheduling information. + * + * @return the scheduling value. + */ + public K8SScheduling scheduling() { + return this.scheduling; + } + + /** + * Set the scheduling property: The kubernetes scheduling information. + * + * @param scheduling the scheduling value to set. + * @return the SqlManagedInstanceK8SSpec object itself. + */ + public SqlManagedInstanceK8SSpec withScheduling(K8SScheduling scheduling) { + this.scheduling = scheduling; + return this; + } + + /** + * Get the replicas property: 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'. + * + * @return the replicas value. + */ + public Integer replicas() { + return this.replicas; + } + + /** + * Set the replicas property: 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'. + * + * @param replicas the replicas value to set. + * @return the SqlManagedInstanceK8SSpec object itself. + */ + public SqlManagedInstanceK8SSpec withReplicas(Integer replicas) { + this.replicas = replicas; + return this; + } + + /** + * Get the additionalProperties property: The kubernetes spec information. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The kubernetes spec information. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SqlManagedInstanceK8SSpec object itself. + */ + public SqlManagedInstanceK8SSpec 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() { + if (scheduling() != null) { + scheduling().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..8e45487f24d7b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceListResult.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.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. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java new file mode 100644 index 0000000000000..e4151ce5bcee4 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceProperties.java @@ -0,0 +1,313 @@ +// 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.time.OffsetDateTime; + +/** Properties of sqlManagedInstance. */ +@Fluent +public final class SqlManagedInstanceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceProperties.class); + + /* + * null + */ + @JsonProperty(value = "dataControllerId") + private String dataControllerId; + + /* + * The instance admin user + */ + @JsonProperty(value = "admin") + private String admin; + + /* + * The instance start time + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * The instance end time + */ + @JsonProperty(value = "endTime") + private String endTime; + + /* + * The raw kubernetes information + */ + @JsonProperty(value = "k8sRaw") + private SqlManagedInstanceK8SRaw k8SRaw; + + /* + * Username and password for basic authentication. + */ + @JsonProperty(value = "basicLoginInformation") + private BasicLoginInformation basicLoginInformation; + + /* + * Last uploaded date from Kubernetes cluster. Defaults to current date + * time + */ + @JsonProperty(value = "lastUploadedDate") + private OffsetDateTime lastUploadedDate; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The license type to apply for this managed instance. + */ + @JsonProperty(value = "licenseType") + private ArcSqlManagedInstanceLicenseType licenseType; + + /* + * 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. + */ + @JsonProperty(value = "extensionId") + private String extensionId; + + /** + * Get the dataControllerId property: null. + * + * @return the dataControllerId value. + */ + public String dataControllerId() { + return this.dataControllerId; + } + + /** + * Set the dataControllerId property: null. + * + * @param dataControllerId the dataControllerId value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withDataControllerId(String dataControllerId) { + this.dataControllerId = dataControllerId; + return this; + } + + /** + * Get the admin property: The instance admin user. + * + * @return the admin value. + */ + public String admin() { + return this.admin; + } + + /** + * Set the admin property: The instance admin user. + * + * @param admin the admin value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withAdmin(String admin) { + this.admin = admin; + return this; + } + + /** + * Get the startTime property: The instance start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The instance start time. + * + * @param startTime the startTime value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The instance end time. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The instance end time. + * + * @param endTime the endTime value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the k8SRaw property: The raw kubernetes information. + * + * @return the k8SRaw value. + */ + public SqlManagedInstanceK8SRaw k8SRaw() { + return this.k8SRaw; + } + + /** + * Set the k8SRaw property: The raw kubernetes information. + * + * @param k8SRaw the k8SRaw value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withK8SRaw(SqlManagedInstanceK8SRaw k8SRaw) { + this.k8SRaw = k8SRaw; + 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 SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withBasicLoginInformation(BasicLoginInformation basicLoginInformation) { + this.basicLoginInformation = basicLoginInformation; + 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 SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withLastUploadedDate(OffsetDateTime lastUploadedDate) { + this.lastUploadedDate = lastUploadedDate; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the licenseType property: The license type to apply for this managed instance. + * + * @return the licenseType value. + */ + public ArcSqlManagedInstanceLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type to apply for this managed instance. + * + * @param licenseType the licenseType value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withLicenseType(ArcSqlManagedInstanceLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the clusterId property: If a CustomLocation is provided, this contains the ARM id of the connected cluster + * the custom location belongs to. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Set the clusterId property: If a CustomLocation is provided, this contains the ARM id of the connected cluster + * the custom location belongs to. + * + * @param clusterId the clusterId value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withClusterId(String clusterId) { + this.clusterId = clusterId; + return this; + } + + /** + * Get the extensionId property: If a CustomLocation is provided, this contains the ARM id of the extension the + * custom location belongs to. + * + * @return the extensionId value. + */ + public String extensionId() { + return this.extensionId; + } + + /** + * Set the extensionId property: If a CustomLocation is provided, this contains the ARM id of the extension the + * custom location belongs to. + * + * @param extensionId the extensionId value to set. + * @return the SqlManagedInstanceProperties object itself. + */ + public SqlManagedInstanceProperties withExtensionId(String extensionId) { + this.extensionId = extensionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (k8SRaw() != null) { + k8SRaw().validate(); + } + if (basicLoginInformation() != null) { + basicLoginInformation().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 new file mode 100644 index 0000000000000..b3de6cf37336c --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSku.java @@ -0,0 +1,191 @@ +// 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; + +/** 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; + + /* + * The pricing tier for the instance. + */ + @JsonProperty(value = "tier") + private SqlManagedInstanceSkuTier tier; + + /* + * 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; + + /* + * The family property. + */ + @JsonProperty(value = "family") + private String family; + + /* + * The capacity property. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** Creates an instance of SqlManagedInstanceSku class. */ + public SqlManagedInstanceSku() { + name = "vCore"; + } + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. + * + * @param name the name value to set. + * @return the SqlManagedInstanceSku object itself. + */ + public SqlManagedInstanceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The pricing tier for the instance. + * + * @return the tier value. + */ + public SqlManagedInstanceSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The pricing tier for the instance. + * + * @param tier the tier value to set. + * @return the SqlManagedInstanceSku object itself. + */ + public SqlManagedInstanceSku withTier(SqlManagedInstanceSkuTier tier) { + this.tier = tier; + 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 SqlManagedInstanceSku object itself. + */ + public SqlManagedInstanceSku 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 SqlManagedInstanceSku object itself. + */ + public SqlManagedInstanceSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: The family property. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: The family property. + * + * @param family the family value to set. + * @return the SqlManagedInstanceSku object itself. + */ + public SqlManagedInstanceSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: The capacity property. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The capacity property. + * + * @param capacity the capacity value to set. + * @return the SqlManagedInstanceSku object itself. + */ + public SqlManagedInstanceSku withCapacity(Integer capacity) { + this.capacity = capacity; + 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/SqlManagedInstanceSkuTier.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSkuTier.java new file mode 100644 index 0000000000000..fa996f76e3d46 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceSkuTier.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SqlManagedInstanceSkuTier. */ +public enum SqlManagedInstanceSkuTier { + /** Enum value GeneralPurpose. */ + GENERAL_PURPOSE("GeneralPurpose"), + + /** Enum value BusinessCritical. */ + BUSINESS_CRITICAL("BusinessCritical"); + + /** The actual serialized value for a SqlManagedInstanceSkuTier instance. */ + private final String value; + + SqlManagedInstanceSkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SqlManagedInstanceSkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SqlManagedInstanceSkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SqlManagedInstanceSkuTier fromString(String value) { + SqlManagedInstanceSkuTier[] items = SqlManagedInstanceSkuTier.values(); + for (SqlManagedInstanceSkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java new file mode 100644 index 0000000000000..414543d3d9d31 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstanceUpdate.java @@ -0,0 +1,51 @@ +// 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.Map; + +/** An update to a SQL Managed Instance. */ +@Fluent +public final class SqlManagedInstanceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlManagedInstanceUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 SqlManagedInstanceUpdate object itself. + */ + public SqlManagedInstanceUpdate withTags(Map tags) { + this.tags = tags; + 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/SqlManagedInstances.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstances.java new file mode 100644 index 0000000000000..f835c5d339704 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlManagedInstances.java @@ -0,0 +1,158 @@ +// 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 SqlManagedInstances. */ +public interface SqlManagedInstances { + /** + * List sqlManagedInstance 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 SqlManagedInstance. + */ + PagedIterable list(); + + /** + * List sqlManagedInstance 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 SqlManagedInstance. + */ + PagedIterable list(Context context); + + /** + * 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @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 a SqlManagedInstance. + */ + SqlManagedInstance getByResourceGroup(String resourceGroupName, String sqlManagedInstanceName); + + /** + * 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); + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sqlManagedInstanceName); + + /** + * Deletes a SQL Managed Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlManagedInstanceName The name of Sql Managed Instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String sqlManagedInstanceName, Context context); + + /** + * Retrieves a SQL Managed 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 SqlManagedInstance. + */ + SqlManagedInstance getById(String id); + + /** + * Retrieves a SQL Managed 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 SqlManagedInstance. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a SQL Managed 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 SQL Managed 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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlManagedInstance resource. + * + * @param name resource name. + * @return the first stage of the new SqlManagedInstance definition. + */ + SqlManagedInstance.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 new file mode 100644 index 0000000000000..6420ef9d0071f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstance.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.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.SqlServerInstanceInner; +import java.util.Map; + +/** An immutable client-side representation of SqlServerInstance. */ +public interface SqlServerInstance { + /** + * 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: null. + * + * @return the properties value. + */ + SqlServerInstanceProperties properties(); + + /** + * Gets the systemData property: Read only system data. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.azurearcdata.fluent.models.SqlServerInstanceInner object. + * + * @return the inner object. + */ + SqlServerInstanceInner innerModel(); + + /** The entirety of the SqlServerInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SqlServerInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlServerInstance definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SqlServerInstance 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 SqlServerInstance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the Azure resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SqlServerInstance 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlServerInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlServerInstance create(Context context); + } + /** The stage of the SqlServerInstance 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 SqlServerInstance definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: null. + * + * @param properties null. + * @return the next definition stage. + */ + WithCreate withProperties(SqlServerInstanceProperties properties); + } + } + /** + * Begins update for the SqlServerInstance resource. + * + * @return the stage of resource update. + */ + SqlServerInstance.Update update(); + + /** The template for SqlServerInstance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlServerInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlServerInstance apply(Context context); + } + /** The SqlServerInstance update stages. */ + interface UpdateStages { + /** The stage of the SqlServerInstance 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); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlServerInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlServerInstance refresh(Context context); +} 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 new file mode 100644 index 0000000000000..71586691fdf66 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceListResult.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.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. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java new file mode 100644 index 0000000000000..723a53f8a3e32 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceProperties.java @@ -0,0 +1,458 @@ +// 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.time.OffsetDateTime; + +/** Properties of SqlServerInstance. */ +@Fluent +public final class SqlServerInstanceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerInstanceProperties.class); + + /* + * SQL Server version. + */ + @JsonProperty(value = "version") + private SqlVersion version; + + /* + * SQL Server edition. + */ + @JsonProperty(value = "edition") + private EditionType edition; + + /* + * ARM Resource id of the container resource (Azure Arc for Servers). + */ + @JsonProperty(value = "containerResourceId", required = true) + private String containerResourceId; + + /* + * The time when the resource was created. + */ + @JsonProperty(value = "createTime", access = JsonProperty.Access.WRITE_ONLY) + private String createTime; + + /* + * The number of logical processors used by the SQL Server instance. + */ + @JsonProperty(value = "vCore") + private String vCore; + + /* + * The cloud connectivity status. + */ + @JsonProperty(value = "status", required = true) + private ConnectionStatus status; + + /* + * SQL Server update level. + */ + @JsonProperty(value = "patchLevel") + private String patchLevel; + + /* + * SQL Server collation. + */ + @JsonProperty(value = "collation") + private String collation; + + /* + * SQL Server current version. + */ + @JsonProperty(value = "currentVersion") + private String currentVersion; + + /* + * SQL Server instance name. + */ + @JsonProperty(value = "instanceName") + private String instanceName; + + /* + * Dynamic TCP ports used by SQL Server. + */ + @JsonProperty(value = "tcpDynamicPorts") + private String tcpDynamicPorts; + + /* + * Static TCP ports used by SQL Server. + */ + @JsonProperty(value = "tcpStaticPorts") + private String tcpStaticPorts; + + /* + * SQL Server product ID. + */ + @JsonProperty(value = "productId") + private String productId; + + /* + * SQL Server license type. + */ + @JsonProperty(value = "licenseType") + private ArcSqlServerLicenseType licenseType; + + /* + * Timestamp of last Azure Defender status update. + */ + @JsonProperty(value = "azureDefenderStatusLastUpdated") + private OffsetDateTime azureDefenderStatusLastUpdated; + + /* + * Status of Azure Defender. + */ + @JsonProperty(value = "azureDefenderStatus") + private DefenderStatus azureDefenderStatus; + + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the version property: SQL Server version. + * + * @return the version value. + */ + public SqlVersion version() { + return this.version; + } + + /** + * Set the version property: SQL Server version. + * + * @param version the version value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withVersion(SqlVersion version) { + this.version = version; + return this; + } + + /** + * Get the edition property: SQL Server edition. + * + * @return the edition value. + */ + public EditionType edition() { + return this.edition; + } + + /** + * Set the edition property: SQL Server edition. + * + * @param edition the edition value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withEdition(EditionType edition) { + this.edition = edition; + return this; + } + + /** + * Get the containerResourceId property: ARM Resource id of the container resource (Azure Arc for Servers). + * + * @return the containerResourceId value. + */ + public String containerResourceId() { + return this.containerResourceId; + } + + /** + * Set the containerResourceId property: ARM Resource id of the container resource (Azure Arc for Servers). + * + * @param containerResourceId the containerResourceId value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withContainerResourceId(String containerResourceId) { + this.containerResourceId = containerResourceId; + return this; + } + + /** + * Get the createTime property: The time when the resource was created. + * + * @return the createTime value. + */ + public String createTime() { + return this.createTime; + } + + /** + * Get the vCore property: The number of logical processors used by the SQL Server instance. + * + * @return the vCore value. + */ + public String vCore() { + return this.vCore; + } + + /** + * Set the vCore property: The number of logical processors used by the SQL Server instance. + * + * @param vCore the vCore value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withVCore(String vCore) { + this.vCore = vCore; + return this; + } + + /** + * Get the status property: The cloud connectivity status. + * + * @return the status value. + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: The cloud connectivity status. + * + * @param status the status value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withStatus(ConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the patchLevel property: SQL Server update level. + * + * @return the patchLevel value. + */ + public String patchLevel() { + return this.patchLevel; + } + + /** + * Set the patchLevel property: SQL Server update level. + * + * @param patchLevel the patchLevel value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withPatchLevel(String patchLevel) { + this.patchLevel = patchLevel; + return this; + } + + /** + * Get the collation property: SQL Server collation. + * + * @return the collation value. + */ + public String collation() { + return this.collation; + } + + /** + * Set the collation property: SQL Server collation. + * + * @param collation the collation value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get the currentVersion property: SQL Server current version. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Set the currentVersion property: SQL Server current version. + * + * @param currentVersion the currentVersion value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withCurrentVersion(String currentVersion) { + this.currentVersion = currentVersion; + return this; + } + + /** + * Get the instanceName property: SQL Server instance name. + * + * @return the instanceName value. + */ + public String instanceName() { + return this.instanceName; + } + + /** + * Set the instanceName property: SQL Server instance name. + * + * @param instanceName the instanceName value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withInstanceName(String instanceName) { + this.instanceName = instanceName; + return this; + } + + /** + * Get the tcpDynamicPorts property: Dynamic TCP ports used by SQL Server. + * + * @return the tcpDynamicPorts value. + */ + public String tcpDynamicPorts() { + return this.tcpDynamicPorts; + } + + /** + * Set the tcpDynamicPorts property: Dynamic TCP ports used by SQL Server. + * + * @param tcpDynamicPorts the tcpDynamicPorts value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withTcpDynamicPorts(String tcpDynamicPorts) { + this.tcpDynamicPorts = tcpDynamicPorts; + return this; + } + + /** + * Get the tcpStaticPorts property: Static TCP ports used by SQL Server. + * + * @return the tcpStaticPorts value. + */ + public String tcpStaticPorts() { + return this.tcpStaticPorts; + } + + /** + * Set the tcpStaticPorts property: Static TCP ports used by SQL Server. + * + * @param tcpStaticPorts the tcpStaticPorts value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withTcpStaticPorts(String tcpStaticPorts) { + this.tcpStaticPorts = tcpStaticPorts; + return this; + } + + /** + * Get the productId property: SQL Server product ID. + * + * @return the productId value. + */ + public String productId() { + return this.productId; + } + + /** + * Set the productId property: SQL Server product ID. + * + * @param productId the productId value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withProductId(String productId) { + this.productId = productId; + return this; + } + + /** + * Get the licenseType property: SQL Server license type. + * + * @return the licenseType value. + */ + public ArcSqlServerLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: SQL Server license type. + * + * @param licenseType the licenseType value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withLicenseType(ArcSqlServerLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the azureDefenderStatusLastUpdated property: Timestamp of last Azure Defender status update. + * + * @return the azureDefenderStatusLastUpdated value. + */ + public OffsetDateTime azureDefenderStatusLastUpdated() { + return this.azureDefenderStatusLastUpdated; + } + + /** + * Set the azureDefenderStatusLastUpdated property: Timestamp of last Azure Defender status update. + * + * @param azureDefenderStatusLastUpdated the azureDefenderStatusLastUpdated value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withAzureDefenderStatusLastUpdated( + OffsetDateTime azureDefenderStatusLastUpdated) { + this.azureDefenderStatusLastUpdated = azureDefenderStatusLastUpdated; + return this; + } + + /** + * Get the azureDefenderStatus property: Status of Azure Defender. + * + * @return the azureDefenderStatus value. + */ + public DefenderStatus azureDefenderStatus() { + return this.azureDefenderStatus; + } + + /** + * Set the azureDefenderStatus property: Status of Azure Defender. + * + * @param azureDefenderStatus the azureDefenderStatus value to set. + * @return the SqlServerInstanceProperties object itself. + */ + public SqlServerInstanceProperties withAzureDefenderStatus(DefenderStatus azureDefenderStatus) { + this.azureDefenderStatus = azureDefenderStatus; + return this; + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @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 (containerResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property containerResourceId in model SqlServerInstanceProperties")); + } + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model SqlServerInstanceProperties")); + } + } +} 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 new file mode 100644 index 0000000000000..c13e3be0c8927 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstanceUpdate.java @@ -0,0 +1,51 @@ +// 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.Map; + +/** An update to a SQL Server Instance. */ +@Fluent +public final class SqlServerInstanceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerInstanceUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * 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 SqlServerInstanceUpdate object itself. + */ + public SqlServerInstanceUpdate withTags(Map tags) { + this.tags = tags; + 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/SqlServerInstances.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstances.java new file mode 100644 index 0000000000000..c66aef782b2a1 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlServerInstances.java @@ -0,0 +1,158 @@ +// 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 SqlServerInstances. */ +public interface SqlServerInstances { + /** + * List sqlServerInstance 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 SqlServerInstance. + */ + PagedIterable list(); + + /** + * List sqlServerInstance 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 SqlServerInstance. + */ + PagedIterable list(Context context); + + /** + * 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieves a SQL Server Instance resource. + * + * @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 SqlServerInstance. + */ + SqlServerInstance getByResourceGroup(String resourceGroupName, String sqlServerInstanceName); + + /** + * 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); + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sqlServerInstanceName); + + /** + * Deletes a SQL Server Instance resource. + * + * @param resourceGroupName The name of the Azure resource group. + * @param sqlServerInstanceName The name of SQL Server Instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String sqlServerInstanceName, Context context); + + /** + * Retrieves a SQL Server 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 SqlServerInstance. + */ + SqlServerInstance getById(String id); + + /** + * Retrieves a SQL Server 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 SqlServerInstance. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a SQL Server 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 SQL Server 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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlServerInstance resource. + * + * @param name resource name. + * @return the first stage of the new SqlServerInstance definition. + */ + SqlServerInstance.DefinitionStages.Blank define(String name); +} 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 new file mode 100644 index 0000000000000..b51c30bc05bd7 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/SqlVersion.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SqlVersion. */ +public final class SqlVersion extends ExpandableStringEnum { + /** Static value SQL Server 2019 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2019 = fromString("SQL Server 2019"); + + /** Static value SQL Server 2017 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2017 = fromString("SQL Server 2017"); + + /** Static value SQL Server 2016 for SqlVersion. */ + public static final SqlVersion SQL_SERVER_2016 = fromString("SQL Server 2016"); + + /** + * Creates or finds a SqlVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding SqlVersion. + */ + @JsonCreator + public static SqlVersion fromString(String name) { + return fromString(name, SqlVersion.class); + } + + /** @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 new file mode 100644 index 0000000000000..f1f8511ca0e05 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadServicePrincipal.java @@ -0,0 +1,130 @@ +// 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.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. + */ + @JsonProperty(value = "clientId") + private UUID clientId; + + /* + * Tenant ID of the service principal. + */ + @JsonProperty(value = "tenantId") + private UUID tenantId; + + /* + * Authority for the service principal. Example: + * https://login.microsoftonline.com/ + */ + @JsonProperty(value = "authority") + private String authority; + + /* + * Secret of the service principal + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /** + * Get the clientId property: Client ID of the service principal for uploading data. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client ID of the service principal for uploading data. + * + * @param clientId the clientId value to set. + * @return the UploadServicePrincipal object itself. + */ + public UploadServicePrincipal withClientId(UUID clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the tenantId property: Tenant ID of the service principal. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant ID of the service principal. + * + * @param tenantId the tenantId value to set. + * @return the UploadServicePrincipal object itself. + */ + public UploadServicePrincipal withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the authority property: Authority for the service principal. Example: https://login.microsoftonline.com/. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: Authority for the service principal. Example: https://login.microsoftonline.com/. + * + * @param authority the authority value to set. + * @return the UploadServicePrincipal object itself. + */ + public UploadServicePrincipal withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the clientSecret property: Secret of the service principal. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Secret of the service principal. + * + * @param clientSecret the clientSecret value to set. + * @return the UploadServicePrincipal object itself. + */ + public UploadServicePrincipal withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + 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/UploadWatermark.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadWatermark.java new file mode 100644 index 0000000000000..1fee37441a72b --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/UploadWatermark.java @@ -0,0 +1,106 @@ +// 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.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 + */ + @JsonProperty(value = "metrics") + private OffsetDateTime metrics; + + /* + * 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 + */ + @JsonProperty(value = "usages") + private OffsetDateTime usages; + + /** + * Get the metrics property: Last uploaded date for metrics from kubernetes cluster. Defaults to current date time. + * + * @return the metrics value. + */ + public OffsetDateTime metrics() { + return this.metrics; + } + + /** + * Set the metrics property: Last uploaded date for metrics from kubernetes cluster. Defaults to current date time. + * + * @param metrics the metrics value to set. + * @return the UploadWatermark object itself. + */ + public UploadWatermark withMetrics(OffsetDateTime metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the logs property: Last uploaded date for logs from kubernetes cluster. Defaults to current date time. + * + * @return the logs value. + */ + public OffsetDateTime logs() { + return this.logs; + } + + /** + * Set the logs property: Last uploaded date for logs from kubernetes cluster. Defaults to current date time. + * + * @param logs the logs value to set. + * @return the UploadWatermark object itself. + */ + public UploadWatermark withLogs(OffsetDateTime logs) { + this.logs = logs; + return this; + } + + /** + * Get the usages property: Last uploaded date for usages from kubernetes cluster. Defaults to current date time. + * + * @return the usages value. + */ + public OffsetDateTime usages() { + return this.usages; + } + + /** + * Set the usages property: Last uploaded date for usages from kubernetes cluster. Defaults to current date time. + * + * @param usages the usages value to set. + * @return the UploadWatermark object itself. + */ + public UploadWatermark withUsages(OffsetDateTime usages) { + this.usages = usages; + 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/package-info.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/package-info.java new file mode 100644 index 0000000000000..a0367286bf1e9 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for AzureArcDataManagementClient. The AzureArcData management API provides a + * RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ +package com.azure.resourcemanager.azurearcdata.models; diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/package-info.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/package-info.java new file mode 100644 index 0000000000000..8a7b18446621d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for AzureArcDataManagementClient. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ +package com.azure.resourcemanager.azurearcdata; diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/module-info.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/module-info.java new file mode 100644 index 0000000000000..667d73e9b6e2e --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.azurearcdata { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.azurearcdata; + exports com.azure.resourcemanager.azurearcdata.fluent; + exports com.azure.resourcemanager.azurearcdata.fluent.models; + exports com.azure.resourcemanager.azurearcdata.models; + + opens com.azure.resourcemanager.azurearcdata.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.azurearcdata.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java new file mode 100644 index 0000000000000..b8ee56896dfdf --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for DataControllers Delete. */ +public final class DataControllersDeleteSamples { + /** + * Sample code: Delete a dataController. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void deleteADataController( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.dataControllers().deleteWithResponse("testrg", "testdataController", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..f94622c4ce32f --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for DataControllers GetByResourceGroup. */ +public final class DataControllersGetByResourceGroupSamples { + /** + * Sample code: Get a data controller. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void getADataController( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager + .dataControllers() + .getByResourceGroupWithResponse("testrg", "testdataController", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..297f0ec00154a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for DataControllers ListByResourceGroup. */ +public final class DataControllersListByResourceGroupSamples { + /** + * Sample code: Gets all dataControllers in a resource group. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void getsAllDataControllersInAResourceGroup( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.dataControllers().listByResourceGroup("testrg", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java new file mode 100644 index 0000000000000..e92f3d9f4e769 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for DataControllers List. */ +public final class DataControllersListSamples { + /** + * Sample code: Gets all dataControllers in a subscription. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void getsAllDataControllersInASubscription( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.dataControllers().list(Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java new file mode 100644 index 0000000000000..af445f5400916 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPatchDataControllerSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.models.DataControllerResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DataControllers PatchDataController. */ +public final class DataControllersPatchDataControllerSamples { + /** + * Sample code: Updates a dataController tags. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void updatesADataControllerTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + DataControllerResource resource = + azureArcDataManager + .dataControllers() + .getByResourceGroupWithResponse("testrg", "testdataController1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java new file mode 100644 index 0000000000000..1f06741dada7a --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/DataControllersPutDataControllerSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.resourcemanager.azurearcdata.models.BasicLoginInformation; +import com.azure.resourcemanager.azurearcdata.models.DataControllerProperties; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurearcdata.models.Infrastructure; +import com.azure.resourcemanager.azurearcdata.models.LogAnalyticsWorkspaceConfig; +import com.azure.resourcemanager.azurearcdata.models.OnPremiseProperty; +import com.azure.resourcemanager.azurearcdata.models.UploadServicePrincipal; +import com.azure.resourcemanager.azurearcdata.models.UploadWatermark; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** Samples for DataControllers PutDataController. */ +public final class DataControllersPutDataControllerSamples { + /** + * Sample code: Create or update a Data Controller. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void createOrUpdateADataController( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager + .dataControllers() + .define("testdataController") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .withProperties( + new DataControllerProperties() + .withInfrastructure(Infrastructure.ONPREMISES) + .withOnPremiseProperty( + new OnPremiseProperty() + .withId(UUID.fromString("12345678-1234-1234-ab12-1a2b3c4d5e6f")) + .withPublicSigningKey("publicOnPremSigningKey")) + .withUploadWatermark( + new UploadWatermark() + .withMetrics(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) + .withLogs(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z")) + .withUsages(OffsetDateTime.parse("2020-01-01T17:18:19.1234567Z"))) + .withBasicLoginInformation( + new BasicLoginInformation().withUsername("username").withPassword("********")) + .withLogAnalyticsWorkspaceConfig( + new LogAnalyticsWorkspaceConfig() + .withWorkspaceId(UUID.fromString("00000000-1111-2222-3333-444444444444")) + .withPrimaryKey("********")) + .withUploadServicePrincipal( + new UploadServicePrincipal() + .withClientId(UUID.fromString("00000000-1111-2222-3333-444444444444")) + .withTenantId(UUID.fromString("00000000-1111-2222-3333-444444444444")) + .withAuthority("https://login.microsoftonline.com/") + .withClientSecret("********")) + .withClusterId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") + .withExtensionId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s/providers/Microsoft.KubernetesConfiguration/extensions/extension")) + .withTags(mapOf("mytag", "myval")) + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java new file mode 100644 index 0000000000000..e6fb5cdda877d --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /** + * Sample code: Lists all of the available Azure Data Services on Azure Arc API operations. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void listsAllOfTheAvailableAzureDataServicesOnAzureArcAPIOperations( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.operations().list(Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java new file mode 100644 index 0000000000000..ebfbac967d187 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesCreateSamples.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.resourcemanager.azurearcdata.models.ArcSqlManagedInstanceLicenseType; +import com.azure.resourcemanager.azurearcdata.models.BasicLoginInformation; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocation; +import com.azure.resourcemanager.azurearcdata.models.ExtendedLocationTypes; +import com.azure.resourcemanager.azurearcdata.models.K8SResourceRequirements; +import com.azure.resourcemanager.azurearcdata.models.K8SScheduling; +import com.azure.resourcemanager.azurearcdata.models.K8SSchedulingOptions; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SRaw; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceK8SSpec; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceSku; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstanceSkuTier; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlManagedInstances Create. */ +public final class SqlManagedInstancesCreateSamples { + /** + * Sample code: Create or update a SQL Managed Instance. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void createOrUpdateASQLManagedInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager + .sqlManagedInstances() + .define("testsqlManagedInstance") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .withProperties( + new SqlManagedInstanceProperties() + .withAdmin("Admin user") + .withStartTime("Instance start time") + .withEndTime("Instance end time") + .withK8SRaw( + new SqlManagedInstanceK8SRaw() + .withSpec( + new SqlManagedInstanceK8SSpec() + .withScheduling( + new K8SScheduling() + .withDefaultProperty( + new K8SSchedulingOptions() + .withResources( + new K8SResourceRequirements() + .withRequests( + mapOf( + "additionalProperty", + "additionalValue", + "cpu", + "1", + "memory", + "8Gi")) + .withLimits( + mapOf( + "additionalProperty", + "additionalValue", + "cpu", + "1", + "memory", + "8Gi"))))) + .withReplicas(1))) + .withBasicLoginInformation( + new BasicLoginInformation().withUsername("username").withPassword("********")) + .withLicenseType(ArcSqlManagedInstanceLicenseType.LICENSE_INCLUDED) + .withClusterId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s") + .withExtensionId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Kubernetes/connectedClusters/connectedk8s/providers/Microsoft.KubernetesConfiguration/extensions/extension")) + .withTags(mapOf("mytag", "myval")) + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation") + .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) + .withSku(new SqlManagedInstanceSku().withTier(SqlManagedInstanceSkuTier.GENERAL_PURPOSE).withDev(true)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java new file mode 100644 index 0000000000000..6124999fe7d2e --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for SqlManagedInstances Delete. */ +public final class SqlManagedInstancesDeleteSamples { + /** + * Sample code: Delete a SQL Instance. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void deleteASQLInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.sqlManagedInstances().deleteWithResponse("testrg", "testsqlManagedInstance", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..3552150a45aad --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SqlManagedInstances GetByResourceGroup. */ +public final class SqlManagedInstancesGetByResourceGroupSamples { + /** + * Sample code: Updates a SQL Instance tags. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void updatesASQLInstanceTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager + .sqlManagedInstances() + .getByResourceGroupWithResponse("testrg", "testsqlManagedInstance", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..1a4645d715c14 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for SqlManagedInstances ListByResourceGroup. */ +public final class SqlManagedInstancesListByResourceGroupSamples { + /** + * Sample code: Gets all SQL Instance in a resource group. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void getsAllSQLInstanceInAResourceGroup( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.sqlManagedInstances().listByResourceGroup("testrg", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java new file mode 100644 index 0000000000000..4462780774800 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for SqlManagedInstances List. */ +public final class SqlManagedInstancesListSamples { + /** + * Sample code: Gets all SQL Instance in a subscription. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void getsAllSQLInstanceInASubscription( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.sqlManagedInstances().list(Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java new file mode 100644 index 0000000000000..68de4717069f7 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlManagedInstancesUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlManagedInstances Update. */ +public final class SqlManagedInstancesUpdateSamples { + /** + * Sample code: Updates a sql Instance tags. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void updatesASqlInstanceTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + SqlManagedInstance resource = + azureArcDataManager + .sqlManagedInstances() + .getByResourceGroupWithResponse("testrg", "testsqlManagedInstance", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java new file mode 100644 index 0000000000000..773280cdcfecc --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesCreateSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.resourcemanager.azurearcdata.models.ArcSqlServerLicenseType; +import com.azure.resourcemanager.azurearcdata.models.ConnectionStatus; +import com.azure.resourcemanager.azurearcdata.models.DefenderStatus; +import com.azure.resourcemanager.azurearcdata.models.EditionType; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstanceProperties; +import com.azure.resourcemanager.azurearcdata.models.SqlVersion; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlServerInstances Create. */ +public final class SqlServerInstancesCreateSamples { + /** + * Sample code: Updates a SQL Server Instance tags. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void updatesASQLServerInstanceTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager + .sqlServerInstances() + .define("testsqlServerInstance") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .withTags(mapOf("mytag", "myval")) + .withProperties( + new SqlServerInstanceProperties() + .withVersion(SqlVersion.SQL_SERVER_2017) + .withEdition(EditionType.DEVELOPER) + .withContainerResourceId("Arc Machine Name") + .withVCore("4") + .withStatus(ConnectionStatus.CONNECTED) + .withPatchLevel("patchlevel") + .withCollation("collation") + .withCurrentVersion("2008 R2") + .withInstanceName("name of instance") + .withTcpDynamicPorts("1433") + .withTcpStaticPorts("1433") + .withProductId("sql id") + .withLicenseType(ArcSqlServerLicenseType.FREE) + .withAzureDefenderStatusLastUpdated(OffsetDateTime.parse("2020-01-02T17:18:19.1234567Z")) + .withAzureDefenderStatus(DefenderStatus.PROTECTED)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java new file mode 100644 index 0000000000000..08c1bca6668df --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for SqlServerInstances Delete. */ +public final class SqlServerInstancesDeleteSamples { + /** + * Sample code: Delete a SQL Server Instance. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void deleteASQLServerInstance( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.sqlServerInstances().deleteWithResponse("testrg", "testsqlServerInstance", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..4987fe6d689be --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for SqlServerInstances GetByResourceGroup. */ +public final class SqlServerInstancesGetByResourceGroupSamples { + /** + * Sample code: Updates a SQL Server Instance tags. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void updatesASQLServerInstanceTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager + .sqlServerInstances() + .getByResourceGroupWithResponse("testrg", "testsqlServerInstance", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d093757db02d9 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for SqlServerInstances ListByResourceGroup. */ +public final class SqlServerInstancesListByResourceGroupSamples { + /** + * Sample code: Gets all SQL Server Instance in a resource group. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void getsAllSQLServerInstanceInAResourceGroup( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.sqlServerInstances().listByResourceGroup("testrg", Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java new file mode 100644 index 0000000000000..afcc6add64a00 --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; + +/** Samples for SqlServerInstances List. */ +public final class SqlServerInstancesListSamples { + /** + * Sample code: Gets all SQL Server Instance in a subscription. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void getsAllSQLServerInstanceInASubscription( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + azureArcDataManager.sqlServerInstances().list(Context.NONE); + } +} diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java new file mode 100644 index 0000000000000..d99020d21b2ea --- /dev/null +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/samples/java/com/azure/resourcemanager/azurearcdata/SqlServerInstancesUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurearcdata; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurearcdata.models.SqlServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlServerInstances Update. */ +public final class SqlServerInstancesUpdateSamples { + /** + * Sample code: Updates a SQL Server Instance tags. + * + * @param azureArcDataManager Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful + * set of web APIs to manage Azure Data Services on Azure Arc Resources. + */ + public static void updatesASQLServerInstanceTags( + com.azure.resourcemanager.azurearcdata.AzureArcDataManager azureArcDataManager) { + SqlServerInstance resource = + azureArcDataManager + .sqlServerInstances() + .getByResourceGroupWithResponse("testrg", "testsqlServerInstance", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/azurearcdata/ci.yml b/sdk/azurearcdata/ci.yml new file mode 100644 index 0000000000000..6cfc5c2b4b7e2 --- /dev/null +++ b/sdk/azurearcdata/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/azurearcdata/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurearcdata/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurearcdata + Artifacts: + - name: azure-resourcemanager-azurearcdata + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerazurearcdata diff --git a/sdk/azurearcdata/pom.xml b/sdk/azurearcdata/pom.xml new file mode 100644 index 0000000000000..fda4a62ebee88 --- /dev/null +++ b/sdk/azurearcdata/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-azurearcdata-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-azurearcdata + + + +