From 74325127765dbf39603a4ba13f9f9ce2008b399c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 27 Jun 2022 08:01:39 +0000 Subject: [PATCH] CodeGen from PR 19491 in Azure/azure-rest-api-specs Merge c3b630be17bd65bc75e17d878ec1f9e2efcece26 into fda2db441da3f1fab31bb235e97da3e33c8e3903 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 + .../SAMPLE.md | 259 ++ .../pom.xml | 55 + .../resourceconnector/AppliancesManager.java | 282 +++ .../fluent/AppliancesClient.java | 354 +++ .../fluent/AppliancesManagementClient.java | 53 + .../fluent/models/ApplianceInner.java | 214 ++ ...terCustomerUserCredentialResultsInner.java | 69 + .../ApplianceListCredentialResultsInner.java | 61 + .../models/ApplianceOperationInner.java | 119 + .../ApplianceOperationValueDisplay.java | 80 + .../fluent/models/ApplianceProperties.java | 162 ++ .../fluent/models/UpgradeGraphInner.java | 80 + .../fluent/models/package-info.java | 6 + .../fluent/package-info.java | 6 + .../implementation/ApplianceImpl.java | 262 ++ ...sterCustomerUserCredentialResultsImpl.java | 53 + .../ApplianceListCredentialResultsImpl.java | 46 + .../ApplianceOperationImpl.java | 57 + .../implementation/AppliancesClientImpl.java | 2158 +++++++++++++++++ .../implementation/AppliancesImpl.java | 264 ++ .../AppliancesManagementClientBuilder.java | 142 ++ .../AppliancesManagementClientImpl.java | 290 +++ .../implementation/UpgradeGraphImpl.java | 41 + .../implementation/Utils.java | 204 ++ .../implementation/package-info.java | 6 + .../models/AccessProfileType.java | 38 + .../resourceconnector/models/Appliance.java | 355 +++ .../models/ApplianceCredentialKubeconfig.java | 50 + ...tClusterCustomerUserCredentialResults.java | 35 + .../ApplianceListCredentialResults.java | 34 + .../models/ApplianceListResult.java | 55 + .../models/ApplianceOperation.java | 66 + .../models/ApplianceOperationsList.java | 84 + ...pliancePropertiesInfrastructureConfig.java | 46 + .../resourceconnector/models/Appliances.java | 261 ++ .../resourceconnector/models/Distro.java | 35 + .../models/HybridConnectionConfig.java | 80 + .../resourceconnector/models/Identity.java | 76 + .../models/PatchableAppliance.java | 49 + .../resourceconnector/models/Provider.java | 47 + .../models/ResourceIdentityType.java | 38 + .../resourceconnector/models/SshKey.java | 72 + .../resourceconnector/models/Status.java | 87 + .../models/SupportedVersion.java | 53 + .../SupportedVersionCatalogVersion.java | 68 + .../SupportedVersionCatalogVersionData.java | 80 + .../models/SupportedVersionMetadata.java | 38 + .../models/UpgradeGraph.java | 38 + .../models/UpgradeGraphProperties.java | 54 + .../models/package-info.java | 6 + .../resourceconnector/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../AppliancesCreateOrUpdateSamples.java | 31 + .../generated/AppliancesDeleteSamples.java | 22 + .../AppliancesGetByResourceGroupSamples.java | 22 + .../AppliancesGetUpgradeGraphSamples.java | 22 + .../AppliancesListByResourceGroupSamples.java | 23 + ...tClusterCustomerUserCredentialSamples.java | 25 + ...ancesListClusterUserCredentialSamples.java | 23 + .../AppliancesListOperationsSamples.java | 22 + .../generated/AppliancesListSamples.java | 23 + .../generated/AppliancesUpdateSamples.java | 41 + sdk/resourceconnector/ci.yml | 47 + sdk/resourceconnector/pom.xml | 15 + 68 files changed, 7618 insertions(+) create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/CHANGELOG.md create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/README.md create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/SAMPLE.md create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/AppliancesManager.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesClient.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesManagementClient.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceInner.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListClusterCustomerUserCredentialResultsInner.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListCredentialResultsInner.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationInner.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationValueDisplay.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceProperties.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/UpgradeGraphInner.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/package-info.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/package-info.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListClusterCustomerUserCredentialResultsImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListCredentialResultsImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceOperationImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesClientImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientBuilder.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/UpgradeGraphImpl.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/Utils.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/package-info.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AccessProfileType.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliance.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceCredentialKubeconfig.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListClusterCustomerUserCredentialResults.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListCredentialResults.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListResult.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperation.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperationsList.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AppliancePropertiesInfrastructureConfig.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliances.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Distro.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/HybridConnectionConfig.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Identity.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/PatchableAppliance.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Provider.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ResourceIdentityType.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SshKey.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Status.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersion.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersion.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersionData.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionMetadata.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraph.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraphProperties.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/package-info.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/package-info.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/module-info.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesCreateOrUpdateSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesDeleteSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetByResourceGroupSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetUpgradeGraphSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListByResourceGroupSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterCustomerUserCredentialSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterUserCredentialSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListOperationsSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListSamples.java create mode 100644 sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesUpdateSamples.java create mode 100644 sdk/resourceconnector/ci.yml create mode 100644 sdk/resourceconnector/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 698005b335113..2d4854d901d9a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -352,6 +352,7 @@ com.azure.resourcemanager:azure-resourcemanager-deviceupdate;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-machinelearning;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-education;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-orbital;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-resourceconnector;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index f56f4e225eb53..c9bd0b6fd6e8e 100644 --- a/pom.xml +++ b/pom.xml @@ -959,6 +959,7 @@ sdk/redisenterprise sdk/relay sdk/remoterendering + sdk/resourceconnector sdk/resourcegraph sdk/resourcehealth sdk/resourcemanager diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/CHANGELOG.md b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/CHANGELOG.md new file mode 100644 index 0000000000000..18ea71404ce5c --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-06-27) + +- Azure Resource Manager Appliances client library for Java. This package contains Microsoft Azure SDK for Appliances Management SDK. The appliances Rest API spec. Package tag package-2022-04-15-preview. 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/resourceconnector/azure-resourcemanager-resourceconnector/README.md b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/README.md new file mode 100644 index 0000000000000..e29b63153c91c --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Appliances client library for Java + +Azure Resource Manager Appliances client library for Java. + +This package contains Microsoft Azure SDK for Appliances Management SDK. The appliances Rest API spec. Package tag package-2022-04-15-preview. 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-resourceconnector;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-resourceconnector + 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(); +AppliancesManager manager = AppliancesManager + .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/resourceconnector/azure-resourcemanager-resourceconnector/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/resourceconnector/azure-resourcemanager-resourceconnector/SAMPLE.md b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/SAMPLE.md new file mode 100644 index 0000000000000..b109acc9313c7 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/SAMPLE.md @@ -0,0 +1,259 @@ +# Code snippets and samples + + +## Appliances + +- [CreateOrUpdate](#appliances_createorupdate) +- [Delete](#appliances_delete) +- [GetByResourceGroup](#appliances_getbyresourcegroup) +- [GetUpgradeGraph](#appliances_getupgradegraph) +- [List](#appliances_list) +- [ListByResourceGroup](#appliances_listbyresourcegroup) +- [ListClusterCustomerUserCredential](#appliances_listclustercustomerusercredential) +- [ListClusterUserCredential](#appliances_listclusterusercredential) +- [ListOperations](#appliances_listoperations) +- [Update](#appliances_update) +### Appliances_CreateOrUpdate + +```java +import com.azure.resourcemanager.resourceconnector.models.AppliancePropertiesInfrastructureConfig; +import com.azure.resourcemanager.resourceconnector.models.Distro; +import com.azure.resourcemanager.resourceconnector.models.Provider; + +/** Samples for Appliances CreateOrUpdate. */ +public final class AppliancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json + */ + /** + * Sample code: Create/Update Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void createUpdateAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager + .appliances() + .define("appliance01") + .withRegion("West US") + .withExistingResourceGroup("testresourcegroup") + .withDistro(Distro.AKSEDGE) + .withInfrastructureConfig(new AppliancePropertiesInfrastructureConfig().withProvider(Provider.VMWARE)) + .create(); + } +} +``` + +### Appliances_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances Delete. */ +public final class AppliancesDeleteSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesDelete.json + */ + /** + * Sample code: Delete Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void deleteAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().delete("testresourcegroup", "appliance01", Context.NONE); + } +} +``` + +### Appliances_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances GetByResourceGroup. */ +public final class AppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesGet.json + */ + /** + * Sample code: Get Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void getAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().getByResourceGroupWithResponse("testresourcegroup", "appliance01", Context.NONE); + } +} +``` + +### Appliances_GetUpgradeGraph + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances GetUpgradeGraph. */ +public final class AppliancesGetUpgradeGraphSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/UpgradeGraph.json + */ + /** + * Sample code: Get Appliance Upgrade Graph. + * + * @param manager Entry point to AppliancesManager. + */ + public static void getApplianceUpgradeGraph(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().getUpgradeGraphWithResponse("testresourcegroup", "appliance01", "stable", Context.NONE); + } +} +``` + +### Appliances_List + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances List. */ +public final class AppliancesListSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json + */ + /** + * Sample code: List Appliances by subscription. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listAppliancesBySubscription( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().list(Context.NONE); + } +} +``` + +### Appliances_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances ListByResourceGroup. */ +public final class AppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json + */ + /** + * Sample code: List Appliances by resource group. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listAppliancesByResourceGroup( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().listByResourceGroup("testresourcegroup", Context.NONE); + } +} +``` + +### Appliances_ListClusterCustomerUserCredential + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances ListClusterCustomerUserCredential. */ +public final class AppliancesListClusterCustomerUserCredentialSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json + */ + /** + * Sample code: ListClusterCustomerUserCredentialAppliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listClusterCustomerUserCredentialAppliance( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager + .appliances() + .listClusterCustomerUserCredentialWithResponse("testresourcegroup", "appliance01", Context.NONE); + } +} +``` + +### Appliances_ListClusterUserCredential + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances ListClusterUserCredential. */ +public final class AppliancesListClusterUserCredentialSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json + */ + /** + * Sample code: ListClusterUserCredentialAppliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listClusterUserCredentialAppliance( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().listClusterUserCredentialWithResponse("testresourcegroup", "appliance01", Context.NONE); + } +} +``` + +### Appliances_ListOperations + +```java +import com.azure.core.util.Context; + +/** Samples for Appliances ListOperations. */ +public final class AppliancesListOperationsSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListOperations.json + */ + /** + * Sample code: List Appliances operations. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listAppliancesOperations(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().listOperations(Context.NONE); + } +} +``` + +### Appliances_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourceconnector.models.Appliance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Appliances Update. */ +public final class AppliancesUpdateSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesPatch.json + */ + /** + * Sample code: Update Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void updateAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + Appliance resource = + manager + .appliances() + .getByResourceGroupWithResponse("testresourcegroup", "appliance01", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).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/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml new file mode 100644 index 0000000000000..94ed5fd3e7eb9 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-resourceconnector + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Appliances Management + This package contains Microsoft Azure SDK for Appliances Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The appliances Rest API spec. Package tag package-2022-04-15-preview. + 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 + true + + + + com.azure + azure-core + 1.29.1 + + + com.azure + azure-core-management + 1.6.2 + + + diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/AppliancesManager.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/AppliancesManager.java new file mode 100644 index 0000000000000..d6fe69312f14b --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/AppliancesManager.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector; + +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.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourceconnector.fluent.AppliancesManagementClient; +import com.azure.resourcemanager.resourceconnector.implementation.AppliancesImpl; +import com.azure.resourcemanager.resourceconnector.implementation.AppliancesManagementClientBuilder; +import com.azure.resourcemanager.resourceconnector.models.Appliances; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to AppliancesManager. The appliances Rest API spec. */ +public final class AppliancesManager { + private Appliances appliances; + + private final AppliancesManagementClient clientObject; + + private AppliancesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AppliancesManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Appliances service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Appliances service API instance. + */ + public static AppliancesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Appliances service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Appliances service API instance. + */ + public static AppliancesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AppliancesManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create AppliancesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AppliancesManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Appliances service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Appliances service API instance. + */ + public AppliancesManager 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.resourceconnector") + .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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new AppliancesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Appliances. It manages Appliance. + * + * @return Resource collection API of Appliances. + */ + public Appliances appliances() { + if (this.appliances == null) { + this.appliances = new AppliancesImpl(clientObject.getAppliances(), this); + } + return appliances; + } + + /** + * @return Wrapped service client AppliancesManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public AppliancesManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesClient.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesClient.java new file mode 100644 index 0000000000000..a23f919175317 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesClient.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.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.resourceconnector.fluent.models.ApplianceInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListClusterCustomerUserCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.UpgradeGraphInner; +import com.azure.resourcemanager.resourceconnector.models.PatchableAppliance; + +/** An instance of this class provides access to all the operations defined in AppliancesClient. */ +public interface AppliancesClient { + /** + * Lists all available Appliances 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 lists of Appliances operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOperations(); + + /** + * Lists all available Appliances 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 lists of Appliances operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOperations(Context context); + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @throws com.azure.core.management.exception.ManagementException 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 Appliances in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @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 Appliances in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Appliance with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplianceInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 details of an Appliance with a specified resource group and name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of appliances definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ApplianceInner parameters); + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of appliances definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ApplianceInner parameters, Context context); + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplianceInner createOrUpdate(String resourceGroupName, String resourceName, ApplianceInner parameters); + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @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 appliances definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplianceInner createOrUpdate( + String resourceGroupName, String resourceName, ApplianceInner parameters, Context context); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters The updatable fields of an existing Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplianceInner update(String resourceGroupName, String resourceName, PatchableAppliance parameters); + + /** + * Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters The updatable fields of an existing Appliance. + * @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 appliances definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String resourceName, PatchableAppliance parameters, Context context); + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster Customer User Credential Results appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplianceListClusterCustomerUserCredentialResultsInner listClusterCustomerUserCredential( + String resourceGroupName, String resourceName); + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster Customer User Credential Results appliance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterCustomerUserCredentialWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster User Credential appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplianceListCredentialResultsInner listClusterUserCredential(String resourceGroupName, String resourceName); + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster User Credential appliance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterUserCredentialWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade graph of an Appliance with a specified resource group and name and specific release train. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpgradeGraphInner getUpgradeGraph(String resourceGroupName, String resourceName, String upgradeGraph); + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @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 upgrade graph of an Appliance with a specified resource group and name and specific release train + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpgradeGraphWithResponse( + String resourceGroupName, String resourceName, String upgradeGraph, Context context); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesManagementClient.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesManagementClient.java new file mode 100644 index 0000000000000..fab74b0241881 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/AppliancesManagementClient.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.resourceconnector.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AppliancesManagementClient class. */ +public interface AppliancesManagementClient { + /** + * Gets The ID of the target 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 AppliancesClient object to access its operations. + * + * @return the AppliancesClient object. + */ + AppliancesClient getAppliances(); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceInner.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceInner.java new file mode 100644 index 0000000000000..c24346e9b6bfc --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceInner.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.resourceconnector.models.AppliancePropertiesInfrastructureConfig; +import com.azure.resourcemanager.resourceconnector.models.Distro; +import com.azure.resourcemanager.resourceconnector.models.Identity; +import com.azure.resourcemanager.resourceconnector.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Appliances definition. */ +@Fluent +public final class ApplianceInner extends Resource { + /* + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The set of properties specific to an Appliance + */ + @JsonProperty(value = "properties") + private ApplianceProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the ApplianceInner object itself. + */ + public ApplianceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The set of properties specific to an Appliance. + * + * @return the innerProperties value. + */ + private ApplianceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ApplianceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ApplianceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...). + * + * @return the distro value. + */ + public Distro distro() { + return this.innerProperties() == null ? null : this.innerProperties().distro(); + } + + /** + * Set the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...). + * + * @param distro the distro value to set. + * @return the ApplianceInner object itself. + */ + public ApplianceInner withDistro(Distro distro) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplianceProperties(); + } + this.innerProperties().withDistro(distro); + return this; + } + + /** + * Get the infrastructureConfig property: Contains infrastructure information about the Appliance. + * + * @return the infrastructureConfig value. + */ + public AppliancePropertiesInfrastructureConfig infrastructureConfig() { + return this.innerProperties() == null ? null : this.innerProperties().infrastructureConfig(); + } + + /** + * Set the infrastructureConfig property: Contains infrastructure information about the Appliance. + * + * @param infrastructureConfig the infrastructureConfig value to set. + * @return the ApplianceInner object itself. + */ + public ApplianceInner withInfrastructureConfig(AppliancePropertiesInfrastructureConfig infrastructureConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplianceProperties(); + } + this.innerProperties().withInfrastructureConfig(infrastructureConfig); + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publicKey property: Certificates pair used to download MSI certificate from HIS. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.innerProperties() == null ? null : this.innerProperties().publicKey(); + } + + /** + * Set the publicKey property: Certificates pair used to download MSI certificate from HIS. + * + * @param publicKey the publicKey value to set. + * @return the ApplianceInner object itself. + */ + public ApplianceInner withPublicKey(String publicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplianceProperties(); + } + this.innerProperties().withPublicKey(publicKey); + return this; + } + + /** + * Get the status property: Appliance’s health and state of connection to on-prem. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the version property: Version of the Appliance. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Version of the Appliance. + * + * @param version the version value to set. + * @return the ApplianceInner object itself. + */ + public ApplianceInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplianceProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListClusterCustomerUserCredentialResultsInner.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListClusterCustomerUserCredentialResultsInner.java new file mode 100644 index 0000000000000..58dbbdd6978d0 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListClusterCustomerUserCredentialResultsInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.resourceconnector.models.ApplianceCredentialKubeconfig; +import com.azure.resourcemanager.resourceconnector.models.SshKey; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The List Cluster Customer User Credential Results appliance. */ +@Immutable +public final class ApplianceListClusterCustomerUserCredentialResultsInner { + /* + * The list of appliance kubeconfigs. + */ + @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) + private List kubeconfigs; + + /* + * Map of Customer User Public and Private SSH Keys + */ + @JsonProperty(value = "sshKeys", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map sshKeys; + + /** + * Get the kubeconfigs property: The list of appliance kubeconfigs. + * + * @return the kubeconfigs value. + */ + public List kubeconfigs() { + return this.kubeconfigs; + } + + /** + * Get the sshKeys property: Map of Customer User Public and Private SSH Keys. + * + * @return the sshKeys value. + */ + public Map sshKeys() { + return this.sshKeys; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kubeconfigs() != null) { + kubeconfigs().forEach(e -> e.validate()); + } + if (sshKeys() != null) { + sshKeys() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListCredentialResultsInner.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListCredentialResultsInner.java new file mode 100644 index 0000000000000..799f43a42c112 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceListCredentialResultsInner.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.resourceconnector.models.ApplianceCredentialKubeconfig; +import com.azure.resourcemanager.resourceconnector.models.HybridConnectionConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Cluster User Credential appliance. */ +@Immutable +public final class ApplianceListCredentialResultsInner { + /* + * Contains the REP (rendezvous endpoint) and “Listener” access token from + * notification service (NS). + */ + @JsonProperty(value = "hybridConnectionConfig", access = JsonProperty.Access.WRITE_ONLY) + private HybridConnectionConfig hybridConnectionConfig; + + /* + * The list of appliance kubeconfigs. + */ + @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) + private List kubeconfigs; + + /** + * Get the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Listener” access token from + * notification service (NS). + * + * @return the hybridConnectionConfig value. + */ + public HybridConnectionConfig hybridConnectionConfig() { + return this.hybridConnectionConfig; + } + + /** + * Get the kubeconfigs property: The list of appliance kubeconfigs. + * + * @return the kubeconfigs value. + */ + public List kubeconfigs() { + return this.kubeconfigs; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hybridConnectionConfig() != null) { + hybridConnectionConfig().validate(); + } + if (kubeconfigs() != null) { + kubeconfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationInner.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationInner.java new file mode 100644 index 0000000000000..a951a98c8abce --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationInner.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Appliances operation. */ +@Fluent +public final class ApplianceOperationInner { + /* + * Describes the properties of an Appliances Operation Value Display. + */ + @JsonProperty(value = "display") + private ApplianceOperationValueDisplay innerDisplay; + + /* + * Is this Operation a data plane operation + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * The name of the compute operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The origin of the compute operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * Get the innerDisplay property: Describes the properties of an Appliances Operation Value Display. + * + * @return the innerDisplay value. + */ + private ApplianceOperationValueDisplay innerDisplay() { + return this.innerDisplay; + } + + /** + * Get the isDataAction property: Is this Operation a data plane operation. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the name property: The name of the compute operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the origin property: The origin of the compute operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.innerDisplay() == null ? null : this.innerDisplay().description(); + } + + /** + * Get the operation property: The display name of the compute operation. + * + * @return the operation value. + */ + public String operation() { + return this.innerDisplay() == null ? null : this.innerDisplay().operation(); + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.innerDisplay() == null ? null : this.innerDisplay().provider(); + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.innerDisplay() == null ? null : this.innerDisplay().resource(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerDisplay() != null) { + innerDisplay().validate(); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationValueDisplay.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationValueDisplay.java new file mode 100644 index 0000000000000..6c60537657c8e --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceOperationValueDisplay.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of an Appliances Operation Value Display. */ +@Immutable +public final class ApplianceOperationValueDisplay { + /* + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The display name of the compute operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The resource provider for the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the operation property: The display name of the compute operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceProperties.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceProperties.java new file mode 100644 index 0000000000000..b8ca3bc1653ba --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/ApplianceProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resourceconnector.models.AppliancePropertiesInfrastructureConfig; +import com.azure.resourcemanager.resourceconnector.models.Distro; +import com.azure.resourcemanager.resourceconnector.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for an appliance. */ +@Fluent +public final class ApplianceProperties { + /* + * Represents a supported Fabric/Infra. (AKSEdge etc...). + */ + @JsonProperty(value = "distro") + private Distro distro; + + /* + * Contains infrastructure information about the Appliance + */ + @JsonProperty(value = "infrastructureConfig") + private AppliancePropertiesInfrastructureConfig infrastructureConfig; + + /* + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Certificates pair used to download MSI certificate from HIS + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * Appliance’s health and state of connection to on-prem + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * Version of the Appliance + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...). + * + * @return the distro value. + */ + public Distro distro() { + return this.distro; + } + + /** + * Set the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...). + * + * @param distro the distro value to set. + * @return the ApplianceProperties object itself. + */ + public ApplianceProperties withDistro(Distro distro) { + this.distro = distro; + return this; + } + + /** + * Get the infrastructureConfig property: Contains infrastructure information about the Appliance. + * + * @return the infrastructureConfig value. + */ + public AppliancePropertiesInfrastructureConfig infrastructureConfig() { + return this.infrastructureConfig; + } + + /** + * Set the infrastructureConfig property: Contains infrastructure information about the Appliance. + * + * @param infrastructureConfig the infrastructureConfig value to set. + * @return the ApplianceProperties object itself. + */ + public ApplianceProperties withInfrastructureConfig(AppliancePropertiesInfrastructureConfig infrastructureConfig) { + this.infrastructureConfig = infrastructureConfig; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicKey property: Certificates pair used to download MSI certificate from HIS. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: Certificates pair used to download MSI certificate from HIS. + * + * @param publicKey the publicKey value to set. + * @return the ApplianceProperties object itself. + */ + public ApplianceProperties withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the status property: Appliance’s health and state of connection to on-prem. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the version property: Version of the Appliance. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the Appliance. + * + * @param version the version value to set. + * @return the ApplianceProperties object itself. + */ + public ApplianceProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (infrastructureConfig() != null) { + infrastructureConfig().validate(); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/UpgradeGraphInner.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/UpgradeGraphInner.java new file mode 100644 index 0000000000000..1bd6676cd8902 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/UpgradeGraphInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resourceconnector.models.UpgradeGraphProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Upgrade Graph for appliance. */ +@Fluent +public final class UpgradeGraphInner { + /* + * The appliance resource path + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The release train name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The properties of supported version + */ + @JsonProperty(value = "properties") + private UpgradeGraphProperties properties; + + /** + * Get the id property: The appliance resource path. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The release train name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: The properties of supported version. + * + * @return the properties value. + */ + public UpgradeGraphProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of supported version. + * + * @param properties the properties value to set. + * @return the UpgradeGraphInner object itself. + */ + public UpgradeGraphInner withProperties(UpgradeGraphProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/package-info.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/package-info.java new file mode 100644 index 0000000000000..e550769bd6f2c --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// 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 AppliancesManagementClient. The appliances Rest API spec. */ +package com.azure.resourcemanager.resourceconnector.fluent.models; diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/package-info.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/package-info.java new file mode 100644 index 0000000000000..7cddcc84f8f85 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/fluent/package-info.java @@ -0,0 +1,6 @@ +// 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 AppliancesManagementClient. The appliances Rest API spec. */ +package com.azure.resourcemanager.resourceconnector.fluent; diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceImpl.java new file mode 100644 index 0000000000000..0d2d483f26cf9 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceInner; +import com.azure.resourcemanager.resourceconnector.models.Appliance; +import com.azure.resourcemanager.resourceconnector.models.ApplianceListClusterCustomerUserCredentialResults; +import com.azure.resourcemanager.resourceconnector.models.ApplianceListCredentialResults; +import com.azure.resourcemanager.resourceconnector.models.AppliancePropertiesInfrastructureConfig; +import com.azure.resourcemanager.resourceconnector.models.Distro; +import com.azure.resourcemanager.resourceconnector.models.Identity; +import com.azure.resourcemanager.resourceconnector.models.PatchableAppliance; +import com.azure.resourcemanager.resourceconnector.models.Status; +import java.util.Collections; +import java.util.Map; + +public final class ApplianceImpl implements Appliance, Appliance.Definition, Appliance.Update { + private ApplianceInner innerObject; + + private final com.azure.resourcemanager.resourceconnector.AppliancesManager 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 Identity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Distro distro() { + return this.innerModel().distro(); + } + + public AppliancePropertiesInfrastructureConfig infrastructureConfig() { + return this.innerModel().infrastructureConfig(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public Status status() { + return this.innerModel().status(); + } + + public String version() { + return this.innerModel().version(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApplianceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resourceconnector.AppliancesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private PatchableAppliance updateParameters; + + public ApplianceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Appliance create() { + this.innerObject = + serviceManager + .serviceClient() + .getAppliances() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public Appliance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAppliances() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + ApplianceImpl(String name, com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager) { + this.innerObject = new ApplianceInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public ApplianceImpl update() { + this.updateParameters = new PatchableAppliance(); + return this; + } + + public Appliance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAppliances() + .updateWithResponse(resourceGroupName, resourceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Appliance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAppliances() + .updateWithResponse(resourceGroupName, resourceName, updateParameters, context) + .getValue(); + return this; + } + + ApplianceImpl( + ApplianceInner innerObject, com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "appliances"); + } + + public Appliance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAppliances() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public Appliance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAppliances() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public ApplianceListClusterCustomerUserCredentialResults listClusterCustomerUserCredential() { + return serviceManager.appliances().listClusterCustomerUserCredential(resourceGroupName, resourceName); + } + + public Response listClusterCustomerUserCredentialWithResponse( + Context context) { + return serviceManager + .appliances() + .listClusterCustomerUserCredentialWithResponse(resourceGroupName, resourceName, context); + } + + public ApplianceListCredentialResults listClusterUserCredential() { + return serviceManager.appliances().listClusterUserCredential(resourceGroupName, resourceName); + } + + public Response listClusterUserCredentialWithResponse(Context context) { + return serviceManager + .appliances() + .listClusterUserCredentialWithResponse(resourceGroupName, resourceName, context); + } + + public ApplianceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApplianceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApplianceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ApplianceImpl withIdentity(Identity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ApplianceImpl withDistro(Distro distro) { + this.innerModel().withDistro(distro); + return this; + } + + public ApplianceImpl withInfrastructureConfig(AppliancePropertiesInfrastructureConfig infrastructureConfig) { + this.innerModel().withInfrastructureConfig(infrastructureConfig); + return this; + } + + public ApplianceImpl withPublicKey(String publicKey) { + this.innerModel().withPublicKey(publicKey); + return this; + } + + public ApplianceImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListClusterCustomerUserCredentialResultsImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListClusterCustomerUserCredentialResultsImpl.java new file mode 100644 index 0000000000000..7f283e681f71e --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListClusterCustomerUserCredentialResultsImpl.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.resourceconnector.implementation; + +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListClusterCustomerUserCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.models.ApplianceCredentialKubeconfig; +import com.azure.resourcemanager.resourceconnector.models.ApplianceListClusterCustomerUserCredentialResults; +import com.azure.resourcemanager.resourceconnector.models.SshKey; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ApplianceListClusterCustomerUserCredentialResultsImpl + implements ApplianceListClusterCustomerUserCredentialResults { + private ApplianceListClusterCustomerUserCredentialResultsInner innerObject; + + private final com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager; + + ApplianceListClusterCustomerUserCredentialResultsImpl( + ApplianceListClusterCustomerUserCredentialResultsInner innerObject, + com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List kubeconfigs() { + List inner = this.innerModel().kubeconfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map sshKeys() { + Map inner = this.innerModel().sshKeys(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ApplianceListClusterCustomerUserCredentialResultsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resourceconnector.AppliancesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListCredentialResultsImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListCredentialResultsImpl.java new file mode 100644 index 0000000000000..59f46b745efe0 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceListCredentialResultsImpl.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.resourceconnector.implementation; + +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.models.ApplianceCredentialKubeconfig; +import com.azure.resourcemanager.resourceconnector.models.ApplianceListCredentialResults; +import com.azure.resourcemanager.resourceconnector.models.HybridConnectionConfig; +import java.util.Collections; +import java.util.List; + +public final class ApplianceListCredentialResultsImpl implements ApplianceListCredentialResults { + private ApplianceListCredentialResultsInner innerObject; + + private final com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager; + + ApplianceListCredentialResultsImpl( + ApplianceListCredentialResultsInner innerObject, + com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public HybridConnectionConfig hybridConnectionConfig() { + return this.innerModel().hybridConnectionConfig(); + } + + public List kubeconfigs() { + List inner = this.innerModel().kubeconfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplianceListCredentialResultsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resourceconnector.AppliancesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceOperationImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceOperationImpl.java new file mode 100644 index 0000000000000..b5e8edaf49a3a --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/ApplianceOperationImpl.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.resourceconnector.implementation; + +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner; +import com.azure.resourcemanager.resourceconnector.models.ApplianceOperation; + +public final class ApplianceOperationImpl implements ApplianceOperation { + private ApplianceOperationInner innerObject; + + private final com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager; + + ApplianceOperationImpl( + ApplianceOperationInner innerObject, + com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public String name() { + return this.innerModel().name(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public String description() { + return this.innerModel().description(); + } + + public String operation() { + return this.innerModel().operation(); + } + + public String provider() { + return this.innerModel().provider(); + } + + public String resource() { + return this.innerModel().resource(); + } + + public ApplianceOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resourceconnector.AppliancesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesClientImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesClientImpl.java new file mode 100644 index 0000000000000..dcb3d4a81f116 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesClientImpl.java @@ -0,0 +1,2158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.resourceconnector.fluent.AppliancesClient; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListClusterCustomerUserCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.UpgradeGraphInner; +import com.azure.resourcemanager.resourceconnector.models.ApplianceListResult; +import com.azure.resourcemanager.resourceconnector.models.ApplianceOperationsList; +import com.azure.resourcemanager.resourceconnector.models.PatchableAppliance; +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 AppliancesClient. */ +public final class AppliancesClientImpl implements AppliancesClient { + /** The proxy service used to perform REST calls. */ + private final AppliancesService service; + + /** The service client containing this operation class. */ + private final AppliancesManagementClientImpl client; + + /** + * Initializes an instance of AppliancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppliancesClientImpl(AppliancesManagementClientImpl client) { + this.service = + RestProxy.create(AppliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppliancesManagementClientAppliances to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppliancesManagement") + private interface AppliancesService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ResourceConnector/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOperations( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ResourceConnector/appliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") ApplianceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances/{resourceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") PatchableAppliance parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances/{resourceName}/listClusterCustomerUserCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterCustomerUserCredential( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances/{resourceName}/listClusterUserCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterUserCredential( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector" + + "/appliances/{resourceName}/upgradeGraphs/{upgradeGraph}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUpgradeGraph( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("upgradeGraph") String upgradeGraph, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOperationsNext( + @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> listBySubscriptionNext( + @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); + } + + /** + * Lists all available Appliances 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 lists of Appliances operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOperationsSinglePageAsync() { + 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.listOperations(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 available Appliances 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 lists of Appliances operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOperationsSinglePageAsync(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 + .listOperations(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 available Appliances 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 lists of Appliances operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOperationsAsync() { + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(), nextLink -> listOperationsNextSinglePageAsync(nextLink)); + } + + /** + * Lists all available Appliances 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 lists of Appliances operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOperationsAsync(Context context) { + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(context), + nextLink -> listOperationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all available Appliances 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 lists of Appliances operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperations() { + return new PagedIterable<>(listOperationsAsync()); + } + + /** + * Lists all available Appliances 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 lists of Appliances operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperations(Context context) { + return new PagedIterable<>(listOperationsAsync(context)); + } + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @throws ManagementException 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 Appliances in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + 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 a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @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 Appliances in the specified subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @throws ManagementException 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 Appliances in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @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 Appliances in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @throws ManagementException 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 Appliances in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @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 Appliances in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Appliances in the specified subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + 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 a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Appliances in the specified subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Appliance with a specified resource group and name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 details of an Appliance with a specified resource group and name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Appliance with a specified resource group and name on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Appliance with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplianceInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 details of an Appliance with a specified resource group and name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, ApplianceInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @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 appliances definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, ApplianceInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of appliances definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplianceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, ApplianceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplianceInner.class, + ApplianceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of appliances definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplianceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, ApplianceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplianceInner.class, ApplianceInner.class, context); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of appliances definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ApplianceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of appliances definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ApplianceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, ApplianceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @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 appliances definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, ApplianceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplianceInner createOrUpdate(String resourceGroupName, String resourceName, ApplianceInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Creates or updates an Appliance in the specified Subscription and Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters Parameters supplied to create or update an Appliance. + * @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 appliances definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplianceInner createOrUpdate( + String resourceGroupName, String resourceName, ApplianceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Context context) { + deleteAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters The updatable fields of an existing Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String resourceName, PatchableAppliance 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters The updatable fields of an existing Appliance. + * @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 appliances definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String resourceName, PatchableAppliance 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters The updatable fields of an existing Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String resourceName, PatchableAppliance parameters) { + return updateWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters The updatable fields of an existing Appliance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appliances definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplianceInner update(String resourceGroupName, String resourceName, PatchableAppliance parameters) { + return updateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param parameters The updatable fields of an existing Appliance. + * @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 appliances definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String resourceName, PatchableAppliance parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster Customer User Credential Results appliance along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listClusterCustomerUserCredentialWithResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterCustomerUserCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster Customer User Credential Results appliance along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listClusterCustomerUserCredentialWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterCustomerUserCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster Customer User Credential Results appliance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterCustomerUserCredentialAsync( + String resourceGroupName, String resourceName) { + return listClusterCustomerUserCredentialWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster Customer User Credential Results appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplianceListClusterCustomerUserCredentialResultsInner listClusterCustomerUserCredential( + String resourceGroupName, String resourceName) { + return listClusterCustomerUserCredentialAsync(resourceGroupName, resourceName).block(); + } + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster Customer User Credential Results appliance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listClusterCustomerUserCredentialWithResponse(String resourceGroupName, String resourceName, Context context) { + return listClusterCustomerUserCredentialWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster User Credential appliance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterUserCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster User Credential appliance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterUserCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster User Credential appliance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialAsync( + String resourceGroupName, String resourceName) { + return listClusterUserCredentialWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster User Credential appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplianceListCredentialResultsInner listClusterUserCredential( + String resourceGroupName, String resourceName) { + return listClusterUserCredentialAsync(resourceGroupName, resourceName).block(); + } + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster User Credential appliance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialWithResponse( + String resourceGroupName, String resourceName, Context context) { + return listClusterUserCredentialWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade graph of an Appliance with a specified resource group and name and specific release train + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpgradeGraphWithResponseAsync( + String resourceGroupName, String resourceName, String upgradeGraph) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (upgradeGraph == null) { + return Mono.error(new IllegalArgumentException("Parameter upgradeGraph is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getUpgradeGraph( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + upgradeGraph, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @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 upgrade graph of an Appliance with a specified resource group and name and specific release train + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpgradeGraphWithResponseAsync( + String resourceGroupName, String resourceName, String upgradeGraph, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (upgradeGraph == null) { + return Mono.error(new IllegalArgumentException("Parameter upgradeGraph is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getUpgradeGraph( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + upgradeGraph, + accept, + context); + } + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade graph of an Appliance with a specified resource group and name and specific release train on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpgradeGraphAsync( + String resourceGroupName, String resourceName, String upgradeGraph) { + return getUpgradeGraphWithResponseAsync(resourceGroupName, resourceName, upgradeGraph) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade graph of an Appliance with a specified resource group and name and specific release train. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpgradeGraphInner getUpgradeGraph(String resourceGroupName, String resourceName, String upgradeGraph) { + return getUpgradeGraphAsync(resourceGroupName, resourceName, upgradeGraph).block(); + } + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @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 upgrade graph of an Appliance with a specified resource group and name and specific release train + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpgradeGraphWithResponse( + String resourceGroupName, String resourceName, String upgradeGraph, Context context) { + return getUpgradeGraphWithResponseAsync(resourceGroupName, resourceName, upgradeGraph, 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 lists of Appliances operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOperationsNextSinglePageAsync(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.listOperationsNext(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 lists of Appliances operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOperationsNextSinglePageAsync( + 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 + .listOperationsNext(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 List Appliances operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 List Appliances operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + 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 + .listBySubscriptionNext(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 List Appliances operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Appliances operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesImpl.java new file mode 100644 index 0000000000000..08e72e5358fbd --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesImpl.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.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.resourceconnector.fluent.AppliancesClient; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListClusterCustomerUserCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListCredentialResultsInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner; +import com.azure.resourcemanager.resourceconnector.fluent.models.UpgradeGraphInner; +import com.azure.resourcemanager.resourceconnector.models.Appliance; +import com.azure.resourcemanager.resourceconnector.models.ApplianceListClusterCustomerUserCredentialResults; +import com.azure.resourcemanager.resourceconnector.models.ApplianceListCredentialResults; +import com.azure.resourcemanager.resourceconnector.models.ApplianceOperation; +import com.azure.resourcemanager.resourceconnector.models.Appliances; +import com.azure.resourcemanager.resourceconnector.models.UpgradeGraph; + +public final class AppliancesImpl implements Appliances { + private static final ClientLogger LOGGER = new ClientLogger(AppliancesImpl.class); + + private final AppliancesClient innerClient; + + private final com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager; + + public AppliancesImpl( + AppliancesClient innerClient, com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listOperations() { + PagedIterable inner = this.serviceClient().listOperations(); + return Utils.mapPage(inner, inner1 -> new ApplianceOperationImpl(inner1, this.manager())); + } + + public PagedIterable listOperations(Context context) { + PagedIterable inner = this.serviceClient().listOperations(context); + return Utils.mapPage(inner, inner1 -> new ApplianceOperationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ApplianceImpl(inner1, this.manager())); + } + + public Appliance getByResourceGroup(String resourceGroupName, String resourceName) { + ApplianceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new ApplianceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplianceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); + } + + public ApplianceListClusterCustomerUserCredentialResults listClusterCustomerUserCredential( + String resourceGroupName, String resourceName) { + ApplianceListClusterCustomerUserCredentialResultsInner inner = + this.serviceClient().listClusterCustomerUserCredential(resourceGroupName, resourceName); + if (inner != null) { + return new ApplianceListClusterCustomerUserCredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterCustomerUserCredentialWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this + .serviceClient() + .listClusterCustomerUserCredentialWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplianceListClusterCustomerUserCredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplianceListCredentialResults listClusterUserCredential(String resourceGroupName, String resourceName) { + ApplianceListCredentialResultsInner inner = + this.serviceClient().listClusterUserCredential(resourceGroupName, resourceName); + if (inner != null) { + return new ApplianceListCredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterUserCredentialWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().listClusterUserCredentialWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplianceListCredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UpgradeGraph getUpgradeGraph(String resourceGroupName, String resourceName, String upgradeGraph) { + UpgradeGraphInner inner = this.serviceClient().getUpgradeGraph(resourceGroupName, resourceName, upgradeGraph); + if (inner != null) { + return new UpgradeGraphImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getUpgradeGraphWithResponse( + String resourceGroupName, String resourceName, String upgradeGraph, Context context) { + Response inner = + this.serviceClient().getUpgradeGraphWithResponse(resourceGroupName, resourceName, upgradeGraph, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpgradeGraphImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Appliance 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 resourceName = Utils.getValueFromIdByName(id, "appliances"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appliances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "appliances"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appliances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "appliances"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appliances'.", id))); + } + this.delete(resourceGroupName, resourceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "appliances"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appliances'.", id))); + } + this.delete(resourceGroupName, resourceName, context); + } + + private AppliancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resourceconnector.AppliancesManager manager() { + return this.serviceManager; + } + + public ApplianceImpl define(String name) { + return new ApplianceImpl(name, this.manager()); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientBuilder.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientBuilder.java new file mode 100644 index 0000000000000..9e6c13c1262a7 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientBuilder.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.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.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 AppliancesManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {AppliancesManagementClientImpl.class}) +public final class AppliancesManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AppliancesManagementClientBuilder. + */ + public AppliancesManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AppliancesManagementClientBuilder. + */ + public AppliancesManagementClientBuilder 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 AppliancesManagementClientBuilder. + */ + public AppliancesManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + 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 AppliancesManagementClientBuilder. + */ + public AppliancesManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + 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 AppliancesManagementClientBuilder. + */ + public AppliancesManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + 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 AppliancesManagementClientBuilder. + */ + public AppliancesManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AppliancesManagementClientImpl with the provided parameters. + * + * @return an instance of AppliancesManagementClientImpl. + */ + public AppliancesManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + AppliancesManagementClientImpl client = + new AppliancesManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientImpl.java new file mode 100644 index 0000000000000..0eb8d11136d08 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/AppliancesManagementClientImpl.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resourceconnector.fluent.AppliancesClient; +import com.azure.resourcemanager.resourceconnector.fluent.AppliancesManagementClient; +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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AppliancesManagementClientImpl type. */ +@ServiceClient(builder = AppliancesManagementClientBuilder.class) +public final class AppliancesManagementClientImpl implements AppliancesManagementClient { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target 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 AppliancesClient object to access its operations. */ + private final AppliancesClient appliances; + + /** + * Gets the AppliancesClient object to access its operations. + * + * @return the AppliancesClient object. + */ + public AppliancesClient getAppliances() { + return this.appliances; + } + + /** + * Initializes an instance of AppliancesManagementClient 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 target subscription. + * @param endpoint server parameter. + */ + AppliancesManagementClientImpl( + 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 = "2022-04-15-preview"; + this.appliances = new AppliancesClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AppliancesManagementClientImpl.class); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/UpgradeGraphImpl.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/UpgradeGraphImpl.java new file mode 100644 index 0000000000000..090e602fd2ac4 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/UpgradeGraphImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.implementation; + +import com.azure.resourcemanager.resourceconnector.fluent.models.UpgradeGraphInner; +import com.azure.resourcemanager.resourceconnector.models.UpgradeGraph; +import com.azure.resourcemanager.resourceconnector.models.UpgradeGraphProperties; + +public final class UpgradeGraphImpl implements UpgradeGraph { + private UpgradeGraphInner innerObject; + + private final com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager; + + UpgradeGraphImpl( + UpgradeGraphInner innerObject, com.azure.resourcemanager.resourceconnector.AppliancesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public UpgradeGraphProperties properties() { + return this.innerModel().properties(); + } + + public UpgradeGraphInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resourceconnector.AppliancesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/Utils.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/Utils.java new file mode 100644 index 0000000000000..2bd9fb9160dc9 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/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.resourceconnector.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/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/package-info.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/package-info.java new file mode 100644 index 0000000000000..28464e7c6540c --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/implementation/package-info.java @@ -0,0 +1,6 @@ +// 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 AppliancesManagementClient. The appliances Rest API spec. */ +package com.azure.resourcemanager.resourceconnector.implementation; diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AccessProfileType.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AccessProfileType.java new file mode 100644 index 0000000000000..81a14a94a1bfc --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AccessProfileType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessProfileType. */ +public final class AccessProfileType extends ExpandableStringEnum { + /** Static value clusterUser for AccessProfileType. */ + public static final AccessProfileType CLUSTER_USER = fromString("clusterUser"); + + /** Static value clusterCustomerUser for AccessProfileType. */ + public static final AccessProfileType CLUSTER_CUSTOMER_USER = fromString("clusterCustomerUser"); + + /** + * Creates or finds a AccessProfileType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessProfileType. + */ + @JsonCreator + public static AccessProfileType fromString(String name) { + return fromString(name, AccessProfileType.class); + } + + /** + * Gets known AccessProfileType values. + * + * @return known AccessProfileType values. + */ + public static Collection values() { + return values(AccessProfileType.class); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliance.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliance.java new file mode 100644 index 0000000000000..83d53a0b2f9bd --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliance.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceInner; +import java.util.Map; + +/** An immutable client-side representation of Appliance. */ +public interface Appliance { + /** + * 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 identity property: Identity for the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...). + * + * @return the distro value. + */ + Distro distro(); + + /** + * Gets the infrastructureConfig property: Contains infrastructure information about the Appliance. + * + * @return the infrastructureConfig value. + */ + AppliancePropertiesInfrastructureConfig infrastructureConfig(); + + /** + * Gets the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the publicKey property: Certificates pair used to download MSI certificate from HIS. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the status property: Appliance’s health and state of connection to on-prem. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the version property: Version of the Appliance. + * + * @return the version value. + */ + String version(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceInner object. + * + * @return the inner object. + */ + ApplianceInner innerModel(); + + /** The entirety of the Appliance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Appliance definition stages. */ + interface DefinitionStages { + /** The first stage of the Appliance definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Appliance 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 Appliance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Appliance 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.WithIdentity, + DefinitionStages.WithDistro, + DefinitionStages.WithInfrastructureConfig, + DefinitionStages.WithPublicKey, + DefinitionStages.WithVersion { + /** + * Executes the create request. + * + * @return the created resource. + */ + Appliance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Appliance create(Context context); + } + /** The stage of the Appliance 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 Appliance definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity for the resource.. + * + * @param identity Identity for the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** The stage of the Appliance definition allowing to specify distro. */ + interface WithDistro { + /** + * Specifies the distro property: Represents a supported Fabric/Infra. (AKSEdge etc...).. + * + * @param distro Represents a supported Fabric/Infra. (AKSEdge etc...). + * @return the next definition stage. + */ + WithCreate withDistro(Distro distro); + } + /** The stage of the Appliance definition allowing to specify infrastructureConfig. */ + interface WithInfrastructureConfig { + /** + * Specifies the infrastructureConfig property: Contains infrastructure information about the Appliance. + * + * @param infrastructureConfig Contains infrastructure information about the Appliance. + * @return the next definition stage. + */ + WithCreate withInfrastructureConfig(AppliancePropertiesInfrastructureConfig infrastructureConfig); + } + /** The stage of the Appliance definition allowing to specify publicKey. */ + interface WithPublicKey { + /** + * Specifies the publicKey property: Certificates pair used to download MSI certificate from HIS. + * + * @param publicKey Certificates pair used to download MSI certificate from HIS. + * @return the next definition stage. + */ + WithCreate withPublicKey(String publicKey); + } + /** The stage of the Appliance definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Version of the Appliance. + * + * @param version Version of the Appliance. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + } + /** + * Begins update for the Appliance resource. + * + * @return the stage of resource update. + */ + Appliance.Update update(); + + /** The template for Appliance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Appliance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Appliance apply(Context context); + } + /** The Appliance update stages. */ + interface UpdateStages { + /** The stage of the Appliance 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. + */ + Appliance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Appliance refresh(Context context); + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster Customer User Credential Results appliance. + */ + ApplianceListClusterCustomerUserCredentialResults listClusterCustomerUserCredential(); + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @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 List Cluster Customer User Credential Results appliance along with {@link Response}. + */ + Response listClusterCustomerUserCredentialWithResponse( + Context context); + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster User Credential appliance. + */ + ApplianceListCredentialResults listClusterUserCredential(); + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @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 List Cluster User Credential appliance along with {@link Response}. + */ + Response listClusterUserCredentialWithResponse(Context context); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceCredentialKubeconfig.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceCredentialKubeconfig.java new file mode 100644 index 0000000000000..09cafd029ee35 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceCredentialKubeconfig.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster User Credential appliance. */ +@Immutable +public final class ApplianceCredentialKubeconfig { + /* + * Name which contains the role of the kubeconfig. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private AccessProfileType name; + + /* + * Contains the kubeconfig value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: Name which contains the role of the kubeconfig. + * + * @return the name value. + */ + public AccessProfileType name() { + return this.name; + } + + /** + * Get the value property: Contains the kubeconfig value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListClusterCustomerUserCredentialResults.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListClusterCustomerUserCredentialResults.java new file mode 100644 index 0000000000000..c8ff915ea4ad5 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListClusterCustomerUserCredentialResults.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListClusterCustomerUserCredentialResultsInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ApplianceListClusterCustomerUserCredentialResults. */ +public interface ApplianceListClusterCustomerUserCredentialResults { + /** + * Gets the kubeconfigs property: The list of appliance kubeconfigs. + * + * @return the kubeconfigs value. + */ + List kubeconfigs(); + + /** + * Gets the sshKeys property: Map of Customer User Public and Private SSH Keys. + * + * @return the sshKeys value. + */ + Map sshKeys(); + + /** + * Gets the inner + * com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListClusterCustomerUserCredentialResultsInner + * object. + * + * @return the inner object. + */ + ApplianceListClusterCustomerUserCredentialResultsInner innerModel(); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListCredentialResults.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListCredentialResults.java new file mode 100644 index 0000000000000..d88826884d4d1 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListCredentialResults.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.resourceconnector.models; + +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListCredentialResultsInner; +import java.util.List; + +/** An immutable client-side representation of ApplianceListCredentialResults. */ +public interface ApplianceListCredentialResults { + /** + * Gets the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Listener” access token from + * notification service (NS). + * + * @return the hybridConnectionConfig value. + */ + HybridConnectionConfig hybridConnectionConfig(); + + /** + * Gets the kubeconfigs property: The list of appliance kubeconfigs. + * + * @return the kubeconfigs value. + */ + List kubeconfigs(); + + /** + * Gets the inner com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceListCredentialResultsInner + * object. + * + * @return the inner object. + */ + ApplianceListCredentialResultsInner innerModel(); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListResult.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListResult.java new file mode 100644 index 0000000000000..730daa62a92fc --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Appliances operation response. */ +@Immutable +public final class ApplianceListResult { + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * The list of Appliances. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: The list of Appliances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperation.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperation.java new file mode 100644 index 0000000000000..6b5dd3933316c --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperation.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner; + +/** An immutable client-side representation of ApplianceOperation. */ +public interface ApplianceOperation { + /** + * Gets the isDataAction property: Is this Operation a data plane operation. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the name property: The name of the compute operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the origin property: The origin of the compute operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the description property: The description of the operation. + * + * @return the description value. + */ + String description(); + + /** + * Gets the operation property: The display name of the compute operation. + * + * @return the operation value. + */ + String operation(); + + /** + * Gets the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + String provider(); + + /** + * Gets the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + String resource(); + + /** + * Gets the inner com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner object. + * + * @return the inner object. + */ + ApplianceOperationInner innerModel(); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperationsList.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperationsList.java new file mode 100644 index 0000000000000..83b539ae1fd5b --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ApplianceOperationsList.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resourceconnector.fluent.models.ApplianceOperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Lists of Appliances operations. */ +@Fluent +public final class ApplianceOperationsList { + /* + * Next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * Array of applianceOperation + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the nextLink property: Next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the ApplianceOperationsList object itself. + */ + public ApplianceOperationsList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: Array of applianceOperation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of applianceOperation. + * + * @param value the value value to set. + * @return the ApplianceOperationsList object itself. + */ + public ApplianceOperationsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ApplianceOperationsList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplianceOperationsList.class); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AppliancePropertiesInfrastructureConfig.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AppliancePropertiesInfrastructureConfig.java new file mode 100644 index 0000000000000..1256b67c74326 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/AppliancePropertiesInfrastructureConfig.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.resourceconnector.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains infrastructure information about the Appliance. */ +@Fluent +public final class AppliancePropertiesInfrastructureConfig { + /* + * Information about the connected appliance. + */ + @JsonProperty(value = "provider") + private Provider provider; + + /** + * Get the provider property: Information about the connected appliance. + * + * @return the provider value. + */ + public Provider provider() { + return this.provider; + } + + /** + * Set the provider property: Information about the connected appliance. + * + * @param provider the provider value to set. + * @return the AppliancePropertiesInfrastructureConfig object itself. + */ + public AppliancePropertiesInfrastructureConfig withProvider(Provider provider) { + this.provider = provider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliances.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliances.java new file mode 100644 index 0000000000000..2d0fd88d52d82 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Appliances.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.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 Appliances. */ +public interface Appliances { + /** + * Lists all available Appliances 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 lists of Appliances operations as paginated response with {@link PagedIterable}. + */ + PagedIterable listOperations(); + + /** + * Lists all available Appliances 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 lists of Appliances operations as paginated response with {@link PagedIterable}. + */ + PagedIterable listOperations(Context context); + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @throws com.azure.core.management.exception.ManagementException 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 Appliances in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance. + * + * @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 Appliances in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of + * each Appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Appliances in the specified subscription and resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of an Appliance with a specified resource group and name. + */ + Appliance getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 details of an Appliance with a specified resource group and name along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster Customer User Credential Results appliance. + */ + ApplianceListClusterCustomerUserCredentialResults listClusterCustomerUserCredential( + String resourceGroupName, String resourceName); + + /** + * Returns the cluster customer user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster Customer User Credential Results appliance along with {@link Response}. + */ + Response listClusterCustomerUserCredentialWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster User Credential appliance. + */ + ApplianceListCredentialResults listClusterUserCredential(String resourceGroupName, String resourceName); + + /** + * Returns the cluster user credentials for the dedicated appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @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 List Cluster User Credential appliance along with {@link Response}. + */ + Response listClusterUserCredentialWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upgrade graph of an Appliance with a specified resource group and name and specific release train. + */ + UpgradeGraph getUpgradeGraph(String resourceGroupName, String resourceName, String upgradeGraph); + + /** + * Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName Appliances name. + * @param upgradeGraph Upgrade graph version, ex - stable. + * @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 upgrade graph of an Appliance with a specified resource group and name and specific release train + * along with {@link Response}. + */ + Response getUpgradeGraphWithResponse( + String resourceGroupName, String resourceName, String upgradeGraph, Context context); + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @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 the details of an Appliance with a specified resource group and name along with {@link Response}. + */ + Appliance getById(String id); + + /** + * Gets the details of an Appliance with a specified resource group and name. + * + * @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 details of an Appliance with a specified resource group and name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Appliance resource. + * + * @param name resource name. + * @return the first stage of the new Appliance definition. + */ + Appliance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Distro.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Distro.java new file mode 100644 index 0000000000000..b493c7df86891 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Distro.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Distro. */ +public final class Distro extends ExpandableStringEnum { + /** Static value AKSEdge for Distro. */ + public static final Distro AKSEDGE = fromString("AKSEdge"); + + /** + * Creates or finds a Distro from its string representation. + * + * @param name a name to look for. + * @return the corresponding Distro. + */ + @JsonCreator + public static Distro fromString(String name) { + return fromString(name, Distro.class); + } + + /** + * Gets known Distro values. + * + * @return known Distro values. + */ + public static Collection values() { + return values(Distro.class); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/HybridConnectionConfig.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/HybridConnectionConfig.java new file mode 100644 index 0000000000000..db8db251e24cd --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/HybridConnectionConfig.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). */ +@Immutable +public final class HybridConnectionConfig { + /* + * Timestamp when this token will be expired. + */ + @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) + private Long expirationTime; + + /* + * Name of the connection + */ + @JsonProperty(value = "hybridConnectionName", access = JsonProperty.Access.WRITE_ONLY) + private String hybridConnectionName; + + /* + * Name of the notification service. + */ + @JsonProperty(value = "relay", access = JsonProperty.Access.WRITE_ONLY) + private String relay; + + /* + * Listener access token + */ + @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) + private String token; + + /** + * Get the expirationTime property: Timestamp when this token will be expired. + * + * @return the expirationTime value. + */ + public Long expirationTime() { + return this.expirationTime; + } + + /** + * Get the hybridConnectionName property: Name of the connection. + * + * @return the hybridConnectionName value. + */ + public String hybridConnectionName() { + return this.hybridConnectionName; + } + + /** + * Get the relay property: Name of the notification service. + * + * @return the relay value. + */ + public String relay() { + return this.relay; + } + + /** + * Get the token property: Listener access token. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Identity.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Identity.java new file mode 100644 index 0000000000000..0f3b4e06a9a34 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Identity.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.resourceconnector.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity for the resource. */ +@Fluent +public class Identity { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType 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/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/PatchableAppliance.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/PatchableAppliance.java new file mode 100644 index 0000000000000..0129c57e159d7 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/PatchableAppliance.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Appliances patchable resource definition. */ +@Fluent +public final class PatchableAppliance { + /* + * Resource tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 PatchableAppliance object itself. + */ + public PatchableAppliance 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/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Provider.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Provider.java new file mode 100644 index 0000000000000..a070740152e05 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Provider.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.resourceconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Provider. */ +public final class Provider extends ExpandableStringEnum { + /** Static value VMWare for Provider. */ + public static final Provider VMWARE = fromString("VMWare"); + + /** Static value HCI for Provider. */ + public static final Provider HCI = fromString("HCI"); + + /** Static value SCVMM for Provider. */ + public static final Provider SCVMM = fromString("SCVMM"); + + /** Static value KubeVirt for Provider. */ + public static final Provider KUBE_VIRT = fromString("KubeVirt"); + + /** Static value OpenStack for Provider. */ + public static final Provider OPEN_STACK = fromString("OpenStack"); + + /** + * Creates or finds a Provider from its string representation. + * + * @param name a name to look for. + * @return the corresponding Provider. + */ + @JsonCreator + public static Provider fromString(String name) { + return fromString(name, Provider.class); + } + + /** + * Gets known Provider values. + * + * @return known Provider values. + */ + public static Collection values() { + return values(Provider.class); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ResourceIdentityType.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..c6d6be8c12ea2 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/ResourceIdentityType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceIdentityType. */ +public final class ResourceIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for ResourceIdentityType. */ + public static final ResourceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value None for ResourceIdentityType. */ + public static final ResourceIdentityType NONE = fromString("None"); + + /** + * Creates or finds a ResourceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceIdentityType. + */ + @JsonCreator + public static ResourceIdentityType fromString(String name) { + return fromString(name, ResourceIdentityType.class); + } + + /** + * Gets known ResourceIdentityType values. + * + * @return known ResourceIdentityType values. + */ + public static Collection values() { + return values(ResourceIdentityType.class); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SshKey.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SshKey.java new file mode 100644 index 0000000000000..4decad5875ef5 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SshKey.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Appliance SSHKey definition. */ +@Fluent +public final class SshKey { + /* + * User Private Key. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * User Public Key. + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /** + * Get the privateKey property: User Private Key. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: User Private Key. + * + * @param privateKey the privateKey value to set. + * @return the SshKey object itself. + */ + public SshKey withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the publicKey property: User Public Key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: User Public Key. + * + * @param publicKey the publicKey value to set. + * @return the SshKey object itself. + */ + public SshKey withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Status.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Status.java new file mode 100644 index 0000000000000..03c8008de3a5e --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/Status.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Status. */ +public final class Status extends ExpandableStringEnum { + /** Static value WaitingForHeartbeat for Status. */ + public static final Status WAITING_FOR_HEARTBEAT = fromString("WaitingForHeartbeat"); + + /** Static value Validating for Status. */ + public static final Status VALIDATING = fromString("Validating"); + + /** Static value Connecting for Status. */ + public static final Status CONNECTING = fromString("Connecting"); + + /** Static value Connected for Status. */ + public static final Status CONNECTED = fromString("Connected"); + + /** Static value Running for Status. */ + public static final Status RUNNING = fromString("Running"); + + /** Static value PreparingForUpgrade for Status. */ + public static final Status PREPARING_FOR_UPGRADE = fromString("PreparingForUpgrade"); + + /** Static value UpgradePrerequisitesCompleted for Status. */ + public static final Status UPGRADE_PREREQUISITES_COMPLETED = fromString("UpgradePrerequisitesCompleted"); + + /** Static value PreUpgrade for Status. */ + public static final Status PRE_UPGRADE = fromString("PreUpgrade"); + + /** Static value UpdatingCloudOperator for Status. */ + public static final Status UPDATING_CLOUD_OPERATOR = fromString("UpdatingCloudOperator"); + + /** Static value WaitingForCloudOperator for Status. */ + public static final Status WAITING_FOR_CLOUD_OPERATOR = fromString("WaitingForCloudOperator"); + + /** Static value UpdatingCAPI for Status. */ + public static final Status UPDATING_CAPI = fromString("UpdatingCAPI"); + + /** Static value UpdatingCluster for Status. */ + public static final Status UPDATING_CLUSTER = fromString("UpdatingCluster"); + + /** Static value PostUpgrade for Status. */ + public static final Status POST_UPGRADE = fromString("PostUpgrade"); + + /** Static value UpgradeComplete for Status. */ + public static final Status UPGRADE_COMPLETE = fromString("UpgradeComplete"); + + /** Static value UpgradeClusterExtensionFailedToDelete for Status. */ + public static final Status UPGRADE_CLUSTER_EXTENSION_FAILED_TO_DELETE = + fromString("UpgradeClusterExtensionFailedToDelete"); + + /** Static value UpgradeFailed for Status. */ + public static final Status UPGRADE_FAILED = fromString("UpgradeFailed"); + + /** Static value Offline for Status. */ + public static final Status OFFLINE = fromString("Offline"); + + /** Static value None for Status. */ + public static final Status NONE = fromString("None"); + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersion.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersion.java new file mode 100644 index 0000000000000..3db91d0f86a34 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersion.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.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SupportedVersion object for appliance. */ +@Immutable +public final class SupportedVersion { + /* + * This is the metadata of the supported newer version. + */ + @JsonProperty(value = "metadata", access = JsonProperty.Access.WRITE_ONLY) + private SupportedVersionMetadata metadata; + + /* + * The newer version available for upgrade. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Get the metadata property: This is the metadata of the supported newer version. + * + * @return the metadata value. + */ + public SupportedVersionMetadata metadata() { + return this.metadata; + } + + /** + * Get the version property: The newer version available for upgrade. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().validate(); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersion.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersion.java new file mode 100644 index 0000000000000..305b7ec7dc854 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersion.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SupportedVersionCatalogVersion object for appliance. */ +@Immutable +public final class SupportedVersionCatalogVersion { + /* + * The newer supported version catalog version data. + */ + @JsonProperty(value = "data", access = JsonProperty.Access.WRITE_ONLY) + private SupportedVersionCatalogVersionData data; + + /* + * The catalog version name for the version available for upgrade. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The catalog version namespace for the version available for upgrade. + */ + @JsonProperty(value = "namespace", access = JsonProperty.Access.WRITE_ONLY) + private String namespace; + + /** + * Get the data property: The newer supported version catalog version data. + * + * @return the data value. + */ + public SupportedVersionCatalogVersionData data() { + return this.data; + } + + /** + * Get the name property: The catalog version name for the version available for upgrade. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the namespace property: The catalog version namespace for the version available for upgrade. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (data() != null) { + data().validate(); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersionData.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersionData.java new file mode 100644 index 0000000000000..dbde7e8ec6274 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionCatalogVersionData.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SupportedVersionCatalogVersionData object for appliance. */ +@Immutable +public final class SupportedVersionCatalogVersionData { + /* + * The image audience name for the version available for upgrade. + */ + @JsonProperty(value = "audience", access = JsonProperty.Access.WRITE_ONLY) + private String audience; + + /* + * The image catalog name for the version available for upgrade. + */ + @JsonProperty(value = "catalog", access = JsonProperty.Access.WRITE_ONLY) + private String catalog; + + /* + * The image offer name for the version available for upgrade. + */ + @JsonProperty(value = "offer", access = JsonProperty.Access.WRITE_ONLY) + private String offer; + + /* + * The image version for the version available for upgrade. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Get the audience property: The image audience name for the version available for upgrade. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Get the catalog property: The image catalog name for the version available for upgrade. + * + * @return the catalog value. + */ + public String catalog() { + return this.catalog; + } + + /** + * Get the offer property: The image offer name for the version available for upgrade. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Get the version property: The image version for the version available for upgrade. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionMetadata.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionMetadata.java new file mode 100644 index 0000000000000..09bd9eb290367 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/SupportedVersionMetadata.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SupportedVersionMetadata object for appliance. */ +@Immutable +public final class SupportedVersionMetadata { + /* + * The newer supported version catalog version. + */ + @JsonProperty(value = "catalogVersion", access = JsonProperty.Access.WRITE_ONLY) + private SupportedVersionCatalogVersion catalogVersion; + + /** + * Get the catalogVersion property: The newer supported version catalog version. + * + * @return the catalogVersion value. + */ + public SupportedVersionCatalogVersion catalogVersion() { + return this.catalogVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (catalogVersion() != null) { + catalogVersion().validate(); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraph.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraph.java new file mode 100644 index 0000000000000..dd3987f12b3dd --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraph.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.resourcemanager.resourceconnector.fluent.models.UpgradeGraphInner; + +/** An immutable client-side representation of UpgradeGraph. */ +public interface UpgradeGraph { + /** + * Gets the id property: The appliance resource path. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The release train name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the properties property: The properties of supported version. + * + * @return the properties value. + */ + UpgradeGraphProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.resourceconnector.fluent.models.UpgradeGraphInner object. + * + * @return the inner object. + */ + UpgradeGraphInner innerModel(); +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraphProperties.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraphProperties.java new file mode 100644 index 0000000000000..7ca75875bf843 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/UpgradeGraphProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Upgrade Graph Properties for appliance. */ +@Immutable +public final class UpgradeGraphProperties { + /* + * The current appliance version + */ + @JsonProperty(value = "applianceVersion", access = JsonProperty.Access.WRITE_ONLY) + private String applianceVersion; + + /* + * This contains the current version and supported upgrade versions. + */ + @JsonProperty(value = "supportedVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedVersions; + + /** + * Get the applianceVersion property: The current appliance version. + * + * @return the applianceVersion value. + */ + public String applianceVersion() { + return this.applianceVersion; + } + + /** + * Get the supportedVersions property: This contains the current version and supported upgrade versions. + * + * @return the supportedVersions value. + */ + public List supportedVersions() { + return this.supportedVersions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedVersions() != null) { + supportedVersions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/package-info.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/package-info.java new file mode 100644 index 0000000000000..be3c9e91a5df1 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/models/package-info.java @@ -0,0 +1,6 @@ +// 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 AppliancesManagementClient. The appliances Rest API spec. */ +package com.azure.resourcemanager.resourceconnector.models; diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/package-info.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/package-info.java new file mode 100644 index 0000000000000..3ec1843a0e7de --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/com/azure/resourcemanager/resourceconnector/package-info.java @@ -0,0 +1,6 @@ +// 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 AppliancesManagementClient. The appliances Rest API spec. */ +package com.azure.resourcemanager.resourceconnector; diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/module-info.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/main/java/module-info.java new file mode 100644 index 0000000000000..d6db277e2f13f --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/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.resourceconnector { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.resourceconnector; + exports com.azure.resourcemanager.resourceconnector.fluent; + exports com.azure.resourcemanager.resourceconnector.fluent.models; + exports com.azure.resourcemanager.resourceconnector.models; + + opens com.azure.resourcemanager.resourceconnector.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.resourceconnector.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesCreateOrUpdateSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..95f87d46f2956 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesCreateOrUpdateSamples.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.resourceconnector.generated; + +import com.azure.resourcemanager.resourceconnector.models.AppliancePropertiesInfrastructureConfig; +import com.azure.resourcemanager.resourceconnector.models.Distro; +import com.azure.resourcemanager.resourceconnector.models.Provider; + +/** Samples for Appliances CreateOrUpdate. */ +public final class AppliancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json + */ + /** + * Sample code: Create/Update Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void createUpdateAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager + .appliances() + .define("appliance01") + .withRegion("West US") + .withExistingResourceGroup("testresourcegroup") + .withDistro(Distro.AKSEDGE) + .withInfrastructureConfig(new AppliancePropertiesInfrastructureConfig().withProvider(Provider.VMWARE)) + .create(); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesDeleteSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesDeleteSamples.java new file mode 100644 index 0000000000000..f45091586743d --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances Delete. */ +public final class AppliancesDeleteSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesDelete.json + */ + /** + * Sample code: Delete Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void deleteAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().delete("testresourcegroup", "appliance01", Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetByResourceGroupSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..580b492720143 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances GetByResourceGroup. */ +public final class AppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesGet.json + */ + /** + * Sample code: Get Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void getAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().getByResourceGroupWithResponse("testresourcegroup", "appliance01", Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetUpgradeGraphSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetUpgradeGraphSamples.java new file mode 100644 index 0000000000000..4475ffa424c32 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesGetUpgradeGraphSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances GetUpgradeGraph. */ +public final class AppliancesGetUpgradeGraphSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/UpgradeGraph.json + */ + /** + * Sample code: Get Appliance Upgrade Graph. + * + * @param manager Entry point to AppliancesManager. + */ + public static void getApplianceUpgradeGraph(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().getUpgradeGraphWithResponse("testresourcegroup", "appliance01", "stable", Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListByResourceGroupSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0065523ac0c7d --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListByResourceGroupSamples.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.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances ListByResourceGroup. */ +public final class AppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json + */ + /** + * Sample code: List Appliances by resource group. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listAppliancesByResourceGroup( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().listByResourceGroup("testresourcegroup", Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterCustomerUserCredentialSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterCustomerUserCredentialSamples.java new file mode 100644 index 0000000000000..6900ff53f9d20 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterCustomerUserCredentialSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances ListClusterCustomerUserCredential. */ +public final class AppliancesListClusterCustomerUserCredentialSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json + */ + /** + * Sample code: ListClusterCustomerUserCredentialAppliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listClusterCustomerUserCredentialAppliance( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager + .appliances() + .listClusterCustomerUserCredentialWithResponse("testresourcegroup", "appliance01", Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterUserCredentialSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterUserCredentialSamples.java new file mode 100644 index 0000000000000..6a895435769a8 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListClusterUserCredentialSamples.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.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances ListClusterUserCredential. */ +public final class AppliancesListClusterUserCredentialSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json + */ + /** + * Sample code: ListClusterUserCredentialAppliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listClusterUserCredentialAppliance( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().listClusterUserCredentialWithResponse("testresourcegroup", "appliance01", Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListOperationsSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListOperationsSamples.java new file mode 100644 index 0000000000000..77f6cf0ebb256 --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListOperationsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances ListOperations. */ +public final class AppliancesListOperationsSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListOperations.json + */ + /** + * Sample code: List Appliances operations. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listAppliancesOperations(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().listOperations(Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListSamples.java new file mode 100644 index 0000000000000..8bb963334e79f --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesListSamples.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.resourceconnector.generated; + +import com.azure.core.util.Context; + +/** Samples for Appliances List. */ +public final class AppliancesListSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json + */ + /** + * Sample code: List Appliances by subscription. + * + * @param manager Entry point to AppliancesManager. + */ + public static void listAppliancesBySubscription( + com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + manager.appliances().list(Context.NONE); + } +} diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesUpdateSamples.java b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesUpdateSamples.java new file mode 100644 index 0000000000000..764fa69ef593b --- /dev/null +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/src/samples/java/com/azure/resourcemanager/resourceconnector/generated/AppliancesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resourceconnector.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.resourceconnector.models.Appliance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Appliances Update. */ +public final class AppliancesUpdateSamples { + /* + * x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesPatch.json + */ + /** + * Sample code: Update Appliance. + * + * @param manager Entry point to AppliancesManager. + */ + public static void updateAppliance(com.azure.resourcemanager.resourceconnector.AppliancesManager manager) { + Appliance resource = + manager + .appliances() + .getByResourceGroupWithResponse("testresourcegroup", "appliance01", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).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/resourceconnector/ci.yml b/sdk/resourceconnector/ci.yml new file mode 100644 index 0000000000000..72c4f8189d924 --- /dev/null +++ b/sdk/resourceconnector/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.yml + - sdk/resourceconnector/azure-resourcemanager-resourceconnector/ + exclude: + - sdk/resourceconnector/pom.xml + - sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.yml + - sdk/resourceconnector/azure-resourcemanager-resourceconnector/ + exclude: + - sdk/resourceconnector/pom.xml + - sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml + +parameters: + - name: release_azureresourcemanagerresourceconnector + displayName: azure-resourcemanager-resourceconnector + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: resourceconnector + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-resourceconnector + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerresourceconnector + releaseInBatch: ${{ parameters.release_azureresourcemanagerresourceconnector }} diff --git a/sdk/resourceconnector/pom.xml b/sdk/resourceconnector/pom.xml new file mode 100644 index 0000000000000..426e5fbbd17ff --- /dev/null +++ b/sdk/resourceconnector/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-resourceconnector-service + pom + 1.0.0 + + + azure-resourcemanager-resourceconnector + +