From 2f21562a876a8c3a05ab486cfa8fe834cb2d876b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 9 Dec 2020 06:36:47 +0000 Subject: [PATCH] CodeGen from PR 12023 in Azure/azure-rest-api-specs Merge 2722d7e9513ac25f2f471244478b7f887f845cc4 into 374b0d5b50bac54a51a42cb2aa3666f85d4ed96d --- eng/versioning/external_dependencies.txt | 1 + eng/versioning/version_client.txt | 25 +- pom.xml | 12 +- .../CHANGELOG.md | 5 + .../README.md | 84 + .../pom.xml | 62 + .../HybridKubernetesManager.java | 212 +++ .../fluent/ConnectedClustersClient.java | 275 +++ .../HybridKubernetesManagementClient.java | 60 + .../fluent/OperationsClient.java | 36 + .../fluent/models/ConnectedClusterInner.java | 365 ++++ .../fluent/models/CredentialResultsInner.java | 63 + .../fluent/models/OperationInner.java | 58 + .../fluent/models/package-info.java | 6 + .../hybridkubernetes/fluent/package-info.java | 6 + .../implementation/ConnectedClusterImpl.java | 274 +++ .../ConnectedClustersClientImpl.java | 1682 +++++++++++++++++ .../implementation/ConnectedClustersImpl.java | 213 +++ .../implementation/CredentialResultsImpl.java | 45 + ...bridKubernetesManagementClientBuilder.java | 146 ++ .../HybridKubernetesManagementClientImpl.java | 307 +++ .../implementation/OperationImpl.java | 37 + .../implementation/OperationsClientImpl.java | 269 +++ .../implementation/OperationsImpl.java | 46 + .../implementation/Utils.java | 31 + .../implementation/package-info.java | 6 + .../models/AuthenticationDetails.java | 89 + .../models/AuthenticationDetailsValue.java | 50 + .../models/AuthenticationMethod.java | 31 + .../models/ConnectedCluster.java | 388 ++++ .../models/ConnectedClusterAadProfile.java | 120 ++ .../models/ConnectedClusterIdentity.java | 93 + .../models/ConnectedClusterList.java | 81 + .../models/ConnectedClusterPatch.java | 82 + .../models/ConnectedClusters.java | 192 ++ .../models/ConnectivityStatus.java | 40 + .../models/CredentialResult.java | 55 + .../models/CredentialResults.java | 32 + .../models/ErrorAdditionalInfo.java | 54 + .../models/HybridConnectionConfig.java | 84 + .../hybridkubernetes/models/Operation.java | 31 + .../models/OperationDisplay.java | 128 ++ .../models/OperationList.java | 70 + .../hybridkubernetes/models/Operations.java | 31 + .../models/ProvisioningState.java | 49 + .../models/ResourceIdentityType.java | 47 + .../hybridkubernetes/models/package-info.java | 6 + .../hybridkubernetes/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/hybridkubernetes/ci.yml | 31 + sdk/hybridkubernetes/pom.xml | 14 + 51 files changed, 6133 insertions(+), 16 deletions(-) create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/package-info.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/package-info.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/package-info.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetails.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetailsValue.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterAadProfile.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/package-info.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/package-info.java create mode 100644 sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/module-info.java create mode 100644 sdk/hybridkubernetes/ci.yml create mode 100644 sdk/hybridkubernetes/pom.xml diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 62906a566fee..464bc9b7cf1a 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -110,6 +110,7 @@ org.springframework.kafka:spring-kafka;2.5.7.RELEASE org.springframework.security:spring-security-config;5.3.5.RELEASE org.springframework.security:spring-security-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-client;5.3.5.RELEASE +org.springframework.security:spring-security-oauth2-resource-server;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-jose;5.3.5.RELEASE org.springframework.security:spring-security-web;5.3.5.RELEASE diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fa2e6238ee36..6e1e0c6e0b47 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -40,17 +40,22 @@ com.azure:azure-ai-anomalydetector;3.0.0-beta.1;3.0.0-beta.2 com.azure:azure-ai-formrecognizer;3.0.3;3.1.0-beta.2 com.azure:azure-ai-metricsadvisor;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-ai-textanalytics;5.0.1;5.1.0-beta.4 +com.azure:azure-analytics-synapse-accesscontrol;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-spark;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-chat;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-common;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-administration;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-sms;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-core;1.10.0;1.11.0 -com.azure:azure-core-amqp;1.6.0;1.7.0-beta.3 +com.azure:azure-core;1.11.0;1.12.0-beta.1 +com.azure:azure-core-amqp;2.0.0;2.1.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.8;1.0.0-beta.9 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.6.3;1.7.0 -com.azure:azure-core-http-okhttp;1.3.3;1.4.0 +com.azure:azure-core-http-netty;1.7.0;1.8.0-beta.1 +com.azure:azure-core-http-okhttp;1.4.0;1.5.0-beta.1 com.azure:azure-core-management;1.0.0;1.1.0-beta.1 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 @@ -68,12 +73,12 @@ com.azure:azure-data-schemaregistry-avro;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-data-tables;12.0.0-beta.3;12.0.0-beta.4 com.azure:azure-digitaltwins-core;1.0.1;1.1.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.2.0;1.3.0-beta.1 +com.azure:azure-identity;1.2.0;1.2.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventgrid;2.0.0-beta.3;2.0.0-beta.4 com.azure:azure-messaging-eventhubs;5.3.1;5.4.0-beta.2 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.3.1;1.4.0-beta.2 -com.azure:azure-messaging-servicebus;7.0.0-beta.7;7.0.0-beta.8 +com.azure:azure-messaging-servicebus;7.0.0;7.1.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-search-documents;11.1.2;11.2.0-beta.4 @@ -94,7 +99,7 @@ com.azure:azure-storage-blob-nio;12.0.0-beta.2;12.0.0-beta.3 com.azure:azure-storage-common;12.9.0;12.10.0-beta.1 com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.1 com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.1 -com.azure:azure-storage-internal-avro;12.0.1;12.1.0-beta.1 +com.azure:azure-storage-internal-avro;12.0.1;12.0.2-beta.1 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-storage-queue;12.7.0;12.8.0-beta.1 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 @@ -168,6 +173,7 @@ com.azure.resourcemanager:azure-resourcemanager-sql;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storage;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.1;2.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-hybridkubernetes;1.0.0-beta.1;1.0.0-beta.1 com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-beta.2 @@ -176,9 +182,7 @@ com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-b # Format; # unreleased_:;dependency-version # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. -unreleased_com.azure:azure-core;1.11.0 -unreleased_com.azure:azure-core-amqp;1.7.0-beta.3 -unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 +unreleased_com.azure:azure-messaging-servicebus;7.0.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid @@ -188,4 +192,3 @@ unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 # beta_:;dependency-version # note: Released beta versions will not be manipulated with the automatic PR creation code. beta_com.azure:azure-security-keyvault-keys;4.3.0-beta.1 -beta_com.azure:azure-core-amqp;1.7.0-beta.2 diff --git a/pom.xml b/pom.xml index d97614e5dba3..f4d7ee0367aa 100644 --- a/pom.xml +++ b/pom.xml @@ -9,35 +9,37 @@ 1.0.0 common/perf-test-core - eng/jacoco-test-coverage eng/code-quality-reports + eng/jacoco-test-coverage sdk/anomalydetector sdk/appconfiguration sdk/authorization sdk/batch sdk/boms - sdk/core - sdk/cosmos sdk/cognitiveservices sdk/communication + sdk/core + sdk/cosmos sdk/digitaltwins sdk/eventgrid sdk/eventhubs sdk/formrecognizer + sdk/hybridkubernetes sdk/identity sdk/keyvault sdk/loganalytics sdk/mediaservices - sdk/monitor sdk/metricsadvisor + sdk/monitor sdk/resourcemanager sdk/schemaregistry sdk/search sdk/servicebus + sdk/spring sdk/storage + sdk/synapse sdk/tables sdk/template sdk/textanalytics - sdk/spring diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md new file mode 100644 index 000000000000..6b1cf55226b8 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2020-12-09) + +- Azure Resource Manager HybridKubernetes client library for Java. This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2020-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md new file mode 100644 index 000000000000..54fd8667de79 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md @@ -0,0 +1,84 @@ +# Azure Resource Manager HybridKubernetes client library for Java + +Azure Resource Manager HybridKubernetes client library for Java. + +This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2020-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +```xml + + com.azure.resourcemanager + azure-resourcemanager-hybridkubernetes + 1.0.0-beta.1 + +``` + +### 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: + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-hybridkubernetes;current}) +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +HybridKubernetesManager manager = HybridKubernetesManager + .authenticate(credential, profile); +``` +[//]: # ({x-version-update-end}) + +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 + +## Troubleshooting + +## Next steps + +## Contributing + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft +Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +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 + + +[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/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml new file mode 100644 index 000000000000..d5a36787195f --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-hybridkubernetes + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for HybridKubernetes Management + This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2020-01-01-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core-management + 1.0.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java new file mode 100644 index 000000000000..9be04847d4ff --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.fluent.HybridKubernetesManagementClient; +import com.azure.resourcemanager.hybridkubernetes.implementation.ConnectedClustersImpl; +import com.azure.resourcemanager.hybridkubernetes.implementation.HybridKubernetesManagementClientBuilder; +import com.azure.resourcemanager.hybridkubernetes.implementation.OperationsImpl; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusters; +import com.azure.resourcemanager.hybridkubernetes.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to HybridKubernetesManager. Hybrid Kubernetes Client. */ +public final class HybridKubernetesManager { + private ConnectedClusters connectedClusters; + + private Operations operations; + + private final HybridKubernetesManagementClient clientObject; + + private HybridKubernetesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new HybridKubernetesManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of HybridKubernetes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HybridKubernetes service API instance. + */ + public static HybridKubernetesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create HybridKubernetesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new HybridKubernetesManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of HybridKubernetes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HybridKubernetes service API instance. + */ + public HybridKubernetesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.hybridkubernetes", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new HybridKubernetesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of ConnectedClusters. */ + public ConnectedClusters connectedClusters() { + if (this.connectedClusters == null) { + this.connectedClusters = new ConnectedClustersImpl(clientObject.getConnectedClusters(), this); + } + return connectedClusters; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * @return Wrapped service client HybridKubernetesManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public HybridKubernetesManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java new file mode 100644 index 000000000000..e8d4c67a7c69 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.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.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationDetails; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; + +/** An instance of this class provides access to all the operations defined in ConnectedClustersClient. */ +public interface ConnectedClustersClient { + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedClusterInner> beginCreate( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster); + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedClusterInner> beginCreate( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context); + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedClusterInner create(String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster); + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedClusterInner create( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context); + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Object containing updates for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedClusterInner update( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch); + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Object containing updates for patch 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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context); + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @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 clusterName, Context context); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String clusterName); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param clientProxy Parameter to indicate whether the request is for client side proxy or not. + * @param clientAuthenticationDetails Authentication details of the user. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, + String clusterName, + Boolean clientProxy, + AuthenticationDetails clientAuthenticationDetails, + Context context); + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java new file mode 100644 index 000000000000..c31dc9e5b5dd --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/HybridKubernetesManagementClient.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for HybridKubernetesManagementClient class. */ +public interface HybridKubernetesManagementClient { + /** + * 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 ConnectedClustersClient object to access its operations. + * + * @return the ConnectedClustersClient object. + */ + ConnectedClustersClient getConnectedClusters(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java new file mode 100644 index 000000000000..e00a1cdacef7 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get(); + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get(Context context); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java new file mode 100644 index 000000000000..be95e6a8bc7b --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterAadProfile; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; +import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Represents a connected cluster. */ +@JsonFlatten +@Fluent +public class ConnectedClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedClusterInner.class); + + /* + * The identity of the connected cluster. + */ + @JsonProperty(value = "identity", required = true) + private ConnectedClusterIdentity identity; + + /* + * Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + */ + @JsonProperty(value = "properties.agentPublicKeyCertificate", required = true) + private String agentPublicKeyCertificate; + + /* + * AAD profile of the connected cluster. + */ + @JsonProperty(value = "properties.aadProfile", required = true) + private ConnectedClusterAadProfile aadProfile; + + /* + * The Kubernetes version of the connected cluster resource + */ + @JsonProperty(value = "properties.kubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kubernetesVersion; + + /* + * Number of nodes present in the connected cluster resource + */ + @JsonProperty(value = "properties.totalNodeCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalNodeCount; + + /* + * Number of CPU cores present in the connected cluster resource + */ + @JsonProperty(value = "properties.totalCoreCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalCoreCount; + + /* + * Version of the agent running on the connected cluster resource + */ + @JsonProperty(value = "properties.agentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentVersion; + + /* + * Provisioning state of the connected cluster resource. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /* + * The Kubernetes distribution running on this connected cluster. + */ + @JsonProperty(value = "properties.distribution") + private String distribution; + + /* + * The infrastructure on which the Kubernetes cluster represented by this + * connected cluster is running on. + */ + @JsonProperty(value = "properties.infrastructure") + private String infrastructure; + + /* + * Connected cluster offering + */ + @JsonProperty(value = "properties.offering", access = JsonProperty.Access.WRITE_ONLY) + private String offering; + + /* + * Expiration time of the managed identity certificate + */ + @JsonProperty( + value = "properties.managedIdentityCertificateExpirationTime", + access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime managedIdentityCertificateExpirationTime; + + /* + * Time representing the last instance when heart beat was received from + * the cluster + */ + @JsonProperty(value = "properties.lastConnectivityTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastConnectivityTime; + + /* + * Represents the connectivity status of the connected cluster. + */ + @JsonProperty(value = "properties.connectivityStatus") + private ConnectivityStatus connectivityStatus; + + /** + * Get the identity property: The identity of the connected cluster. + * + * @return the identity value. + */ + public ConnectedClusterIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the connected cluster. + * + * @param identity the identity value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withIdentity(ConnectedClusterIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + * + * @return the agentPublicKeyCertificate value. + */ + public String agentPublicKeyCertificate() { + return this.agentPublicKeyCertificate; + } + + /** + * Set the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + * + * @param agentPublicKeyCertificate the agentPublicKeyCertificate value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withAgentPublicKeyCertificate(String agentPublicKeyCertificate) { + this.agentPublicKeyCertificate = agentPublicKeyCertificate; + return this; + } + + /** + * Get the aadProfile property: AAD profile of the connected cluster. + * + * @return the aadProfile value. + */ + public ConnectedClusterAadProfile aadProfile() { + return this.aadProfile; + } + + /** + * Set the aadProfile property: AAD profile of the connected cluster. + * + * @param aadProfile the aadProfile value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withAadProfile(ConnectedClusterAadProfile aadProfile) { + this.aadProfile = aadProfile; + return this; + } + + /** + * Get the kubernetesVersion property: The Kubernetes version of the connected cluster resource. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the totalNodeCount property: Number of nodes present in the connected cluster resource. + * + * @return the totalNodeCount value. + */ + public Integer totalNodeCount() { + return this.totalNodeCount; + } + + /** + * Get the totalCoreCount property: Number of CPU cores present in the connected cluster resource. + * + * @return the totalCoreCount value. + */ + public Integer totalCoreCount() { + return this.totalCoreCount; + } + + /** + * Get the agentVersion property: Version of the agent running on the connected cluster resource. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Get the provisioningState property: Provisioning state of the connected cluster resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the connected cluster resource. + * + * @param provisioningState the provisioningState value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the distribution property: The Kubernetes distribution running on this connected cluster. + * + * @return the distribution value. + */ + public String distribution() { + return this.distribution; + } + + /** + * Set the distribution property: The Kubernetes distribution running on this connected cluster. + * + * @param distribution the distribution value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withDistribution(String distribution) { + this.distribution = distribution; + return this; + } + + /** + * Get the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this connected + * cluster is running on. + * + * @return the infrastructure value. + */ + public String infrastructure() { + return this.infrastructure; + } + + /** + * Set the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this connected + * cluster is running on. + * + * @param infrastructure the infrastructure value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withInfrastructure(String infrastructure) { + this.infrastructure = infrastructure; + return this; + } + + /** + * Get the offering property: Connected cluster offering. + * + * @return the offering value. + */ + public String offering() { + return this.offering; + } + + /** + * Get the managedIdentityCertificateExpirationTime property: Expiration time of the managed identity certificate. + * + * @return the managedIdentityCertificateExpirationTime value. + */ + public OffsetDateTime managedIdentityCertificateExpirationTime() { + return this.managedIdentityCertificateExpirationTime; + } + + /** + * Get the lastConnectivityTime property: Time representing the last instance when heart beat was received from the + * cluster. + * + * @return the lastConnectivityTime value. + */ + public OffsetDateTime lastConnectivityTime() { + return this.lastConnectivityTime; + } + + /** + * Get the connectivityStatus property: Represents the connectivity status of the connected cluster. + * + * @return the connectivityStatus value. + */ + public ConnectivityStatus connectivityStatus() { + return this.connectivityStatus; + } + + /** + * Set the connectivityStatus property: Represents the connectivity status of the connected cluster. + * + * @param connectivityStatus the connectivityStatus value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withConnectivityStatus(ConnectivityStatus connectivityStatus) { + this.connectivityStatus = connectivityStatus; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectedClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectedClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property identity in model ConnectedClusterInner")); + } else { + identity().validate(); + } + if (agentPublicKeyCertificate() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property agentPublicKeyCertificate in model ConnectedClusterInner")); + } + if (aadProfile() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aadProfile in model ConnectedClusterInner")); + } else { + aadProfile().validate(); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java new file mode 100644 index 000000000000..2e6869c986f3 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResult; +import com.azure.resourcemanager.hybridkubernetes.models.HybridConnectionConfig; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of credential result response. */ +@Immutable +public final class CredentialResultsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResultsInner.class); + + /* + * Contains the REP (rendezvous endpoint) and “Sender” access token. + */ + @JsonProperty(value = "hybridConnectionConfig", access = JsonProperty.Access.WRITE_ONLY) + private HybridConnectionConfig hybridConnectionConfig; + + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) + private List kubeconfigs; + + /** + * Get the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. + * + * @return the hybridConnectionConfig value. + */ + public HybridConnectionConfig hybridConnectionConfig() { + return this.hybridConnectionConfig; + } + + /** + * Get the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @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/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java new file mode 100644 index 000000000000..6bd0e512524f --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/OperationInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Connected cluster API operation. */ +@Immutable +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {Microsoft.Kubernetes}/{resource}/{operation} + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Get the name property: Operation name: {Microsoft.Kubernetes}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/package-info.java new file mode 100644 index 000000000000..92666e60ba3e --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/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 HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +package com.azure.resourcemanager.hybridkubernetes.fluent.models; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/package-info.java new file mode 100644 index 000000000000..a5e760c6f750 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/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 HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +package com.azure.resourcemanager.hybridkubernetes.fluent; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java new file mode 100644 index 000000000000..6c473b9fec59 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterAadProfile; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; +import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class ConnectedClusterImpl + implements ConnectedCluster, ConnectedCluster.Definition, ConnectedCluster.Update { + private ConnectedClusterInner innerObject; + + private final HybridKubernetesManager 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 ConnectedClusterIdentity identity() { + return this.innerModel().identity(); + } + + public String agentPublicKeyCertificate() { + return this.innerModel().agentPublicKeyCertificate(); + } + + public ConnectedClusterAadProfile aadProfile() { + return this.innerModel().aadProfile(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public Integer totalNodeCount() { + return this.innerModel().totalNodeCount(); + } + + public Integer totalCoreCount() { + return this.innerModel().totalCoreCount(); + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String distribution() { + return this.innerModel().distribution(); + } + + public String infrastructure() { + return this.innerModel().infrastructure(); + } + + public String offering() { + return this.innerModel().offering(); + } + + public OffsetDateTime managedIdentityCertificateExpirationTime() { + return this.innerModel().managedIdentityCertificateExpirationTime(); + } + + public OffsetDateTime lastConnectivityTime() { + return this.innerModel().lastConnectivityTime(); + } + + public ConnectivityStatus connectivityStatus() { + return this.innerModel().connectivityStatus(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ConnectedClusterInner innerModel() { + return this.innerObject; + } + + private HybridKubernetesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ConnectedClusterPatch updateConnectedClusterPatch; + + public ConnectedClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ConnectedCluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedClusters() + .create(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public ConnectedCluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedClusters() + .create(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + public ConnectedClusterImpl(String name, HybridKubernetesManager serviceManager) { + this.innerObject = new ConnectedClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ConnectedClusterImpl update() { + this.updateConnectedClusterPatch = new ConnectedClusterPatch(); + return this; + } + + public ConnectedCluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedClusters() + .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, Context.NONE) + .getValue(); + return this; + } + + public ConnectedCluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedClusters() + .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, context) + .getValue(); + return this; + } + + public ConnectedClusterImpl(ConnectedClusterInner innerObject, HybridKubernetesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "connectedClusters"); + } + + public ConnectedCluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public ConnectedCluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public ConnectedClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConnectedClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConnectedClusterImpl withIdentity(ConnectedClusterIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ConnectedClusterImpl withAgentPublicKeyCertificate(String agentPublicKeyCertificate) { + if (isInCreateMode()) { + this.innerModel().withAgentPublicKeyCertificate(agentPublicKeyCertificate); + return this; + } else { + this.updateConnectedClusterPatch.withAgentPublicKeyCertificate(agentPublicKeyCertificate); + return this; + } + } + + public ConnectedClusterImpl withAadProfile(ConnectedClusterAadProfile aadProfile) { + this.innerModel().withAadProfile(aadProfile); + return this; + } + + public ConnectedClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateConnectedClusterPatch.withTags(tags); + return this; + } + } + + public ConnectedClusterImpl withProvisioningState(ProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public ConnectedClusterImpl withDistribution(String distribution) { + this.innerModel().withDistribution(distribution); + return this; + } + + public ConnectedClusterImpl withInfrastructure(String infrastructure) { + this.innerModel().withInfrastructure(infrastructure); + return this; + } + + public ConnectedClusterImpl withConnectivityStatus(ConnectivityStatus connectivityStatus) { + this.innerModel().withConnectivityStatus(connectivityStatus); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java new file mode 100644 index 000000000000..9b413d2cbc09 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java @@ -0,0 +1,1682 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationDetails; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterList; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; +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 ConnectedClustersClient. */ +public final class ConnectedClustersClientImpl implements ConnectedClustersClient { + private final ClientLogger logger = new ClientLogger(ConnectedClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ConnectedClustersService service; + + /** The service client containing this operation class. */ + private final HybridKubernetesManagementClientImpl client; + + /** + * Initializes an instance of ConnectedClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectedClustersClientImpl(HybridKubernetesManagementClientImpl client) { + this.service = + RestProxy.create(ConnectedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridKubernetesManagementClientConnectedClusters to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridKubernetesMana") + private interface ConnectedClustersService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters/{clusterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ConnectedClusterInner connectedCluster, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters/{clusterName}") + @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("clusterName") String clusterName, + @BodyParam("application/json") ConnectedClusterPatch connectedClusterPatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters/{clusterName}") + @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("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters/{clusterName}") + @ExpectedResponses({200, 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("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters/{clusterName}/listClusterUserCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterUserCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("ClientProxy") Boolean clientProxy, + @BodyParam("application/json") AuthenticationDetails clientAuthenticationDetails, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters") + @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}/providers/Microsoft.Kubernetes/connectedClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{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); + + @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); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (connectedCluster == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedCluster is required and cannot be null.")); + } else { + connectedCluster.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + connectedCluster, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (connectedCluster == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedCluster is required and cannot be null.")); + } else { + connectedCluster.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + connectedCluster, + accept, + context); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedClusterInner> beginCreateAsync( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, connectedCluster); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedClusterInner.class, + ConnectedClusterInner.class, + Context.NONE); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedClusterInner> beginCreateAsync( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, connectedCluster, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, context); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedClusterInner> beginCreate( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + return beginCreateAsync(resourceGroupName, clusterName, connectedCluster).getSyncPoller(); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedClusterInner> beginCreate( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + return beginCreateAsync(resourceGroupName, clusterName, connectedCluster, context).getSyncPoller(); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + return beginCreateAsync(resourceGroupName, clusterName, connectedCluster) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + return beginCreateAsync(resourceGroupName, clusterName, connectedCluster, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedClusterInner create( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster) { + return createAsync(resourceGroupName, clusterName, connectedCluster).block(); + } + + /** + * API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedCluster Represents a connected cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedClusterInner create( + String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context) { + return createAsync(resourceGroupName, clusterName, connectedCluster, context).block(); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Object containing updates for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (connectedClusterPatch == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedClusterPatch is required and cannot be null.")); + } else { + connectedClusterPatch.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + connectedClusterPatch, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Object containing updates for patch 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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (connectedClusterPatch == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedClusterPatch is required and cannot be null.")); + } else { + connectedClusterPatch.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + connectedClusterPatch, + accept, + context); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Object containing updates for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + return updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Object containing updates for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedClusterInner update( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + return updateAsync(resourceGroupName, clusterName, connectedClusterPatch).block(); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Object containing updates for patch 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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch, context).block(); + } + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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, + clusterName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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, + clusterName, + accept, + context); + } + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + } + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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, + clusterName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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, + clusterName, + accept, + context); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param clientProxy Parameter to indicate whether the request is for client side proxy or not. + * @param clientAuthenticationDetails Authentication details of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, + String clusterName, + Boolean clientProxy, + AuthenticationDetails clientAuthenticationDetails) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clientAuthenticationDetails != null) { + clientAuthenticationDetails.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterUserCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clientProxy, + clientAuthenticationDetails, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param clientProxy Parameter to indicate whether the request is for client side proxy or not. + * @param clientAuthenticationDetails Authentication details of the user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, + String clusterName, + Boolean clientProxy, + AuthenticationDetails clientAuthenticationDetails, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clientAuthenticationDetails != null) { + clientAuthenticationDetails.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterUserCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clientProxy, + clientAuthenticationDetails, + accept, + context); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param clientProxy Parameter to indicate whether the request is for client side proxy or not. + * @param clientAuthenticationDetails Authentication details of the user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync( + String resourceGroupName, + String clusterName, + Boolean clientProxy, + AuthenticationDetails clientAuthenticationDetails) { + return listClusterUserCredentialsWithResponseAsync( + resourceGroupName, clusterName, clientProxy, clientAuthenticationDetails) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync(String resourceGroupName, String clusterName) { + final Boolean clientProxy = null; + final AuthenticationDetails clientAuthenticationDetails = null; + return listClusterUserCredentialsWithResponseAsync( + resourceGroupName, clusterName, clientProxy, clientAuthenticationDetails) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String clusterName) { + final Boolean clientProxy = null; + final AuthenticationDetails clientAuthenticationDetails = null; + return listClusterUserCredentialsAsync(resourceGroupName, clusterName, clientProxy, clientAuthenticationDetails) + .block(); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param clientProxy Parameter to indicate whether the request is for client side proxy or not. + * @param clientAuthenticationDetails Authentication details of the user. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialsWithResponse( + String resourceGroupName, + String clusterName, + Boolean clientProxy, + AuthenticationDetails clientAuthenticationDetails, + Context context) { + return listClusterUserCredentialsWithResponseAsync( + resourceGroupName, clusterName, clientProxy, clientAuthenticationDetails, context) + .block(); + } + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @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)); + } + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 paginated list of connected Clusters. + */ + @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)); + } + + /** + * 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 paginated list of connected Clusters. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 paginated list of connected Clusters. + */ + @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)); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java new file mode 100644 index 000000000000..c985126d6544 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.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.hybridkubernetes.HybridKubernetesManager; +import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.hybridkubernetes.models.AuthenticationDetails; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; +import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusters; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConnectedClustersImpl implements ConnectedClusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedClustersImpl.class); + + private final ConnectedClustersClient innerClient; + + private final HybridKubernetesManager serviceManager; + + public ConnectedClustersImpl(ConnectedClustersClient innerClient, HybridKubernetesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ConnectedCluster getByResourceGroup(String resourceGroupName, String clusterName) { + ConnectedClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ConnectedClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectedClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public CredentialResults listClusterUserCredentials(String resourceGroupName, String clusterName) { + CredentialResultsInner inner = this.serviceClient().listClusterUserCredentials(resourceGroupName, clusterName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterUserCredentialsWithResponse( + String resourceGroupName, + String clusterName, + Boolean clientProxy, + AuthenticationDetails clientAuthenticationDetails, + Context context) { + Response inner = + this + .serviceClient() + .listClusterUserCredentialsWithResponse( + resourceGroupName, clusterName, clientProxy, clientAuthenticationDetails, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new ConnectedClusterImpl(inner1, this.manager())); + } + + public ConnectedCluster 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 clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + } + this.delete(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "connectedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedClusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private ConnectedClustersClient serviceClient() { + return this.innerClient; + } + + private HybridKubernetesManager manager() { + return this.serviceManager; + } + + public ConnectedClusterImpl define(String name) { + return new ConnectedClusterImpl(name, this.manager()); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java new file mode 100644 index 000000000000..318a53ba60cf --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResult; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.azure.resourcemanager.hybridkubernetes.models.HybridConnectionConfig; +import java.util.Collections; +import java.util.List; + +public final class CredentialResultsImpl implements CredentialResults { + private CredentialResultsInner innerObject; + + private final HybridKubernetesManager serviceManager; + + public CredentialResultsImpl(CredentialResultsInner innerObject, HybridKubernetesManager 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 CredentialResultsInner innerModel() { + return this.innerObject; + } + + private HybridKubernetesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java new file mode 100644 index 000000000000..05305e095024 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the HybridKubernetesManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {HybridKubernetesManagementClientImpl.class}) +public final class HybridKubernetesManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the HybridKubernetesManagementClientBuilder. + */ + public HybridKubernetesManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the HybridKubernetesManagementClientBuilder. + */ + public HybridKubernetesManagementClientBuilder 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 HybridKubernetesManagementClientBuilder. + */ + public HybridKubernetesManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the HybridKubernetesManagementClientBuilder. + */ + public HybridKubernetesManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the HybridKubernetesManagementClientBuilder. + */ + public HybridKubernetesManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the HybridKubernetesManagementClientBuilder. + */ + public HybridKubernetesManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of HybridKubernetesManagementClientImpl with the provided parameters. + * + * @return an instance of HybridKubernetesManagementClientImpl. + */ + public HybridKubernetesManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + HybridKubernetesManagementClientImpl client = + new HybridKubernetesManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java new file mode 100644 index 000000000000..3e4eadb89833 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.HybridKubernetesManagementClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the HybridKubernetesManagementClientImpl type. */ +@ServiceClient(builder = HybridKubernetesManagementClientBuilder.class) +public final class HybridKubernetesManagementClientImpl implements HybridKubernetesManagementClient { + private final ClientLogger logger = new ClientLogger(HybridKubernetesManagementClientImpl.class); + + /** 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 ConnectedClustersClient object to access its operations. */ + private final ConnectedClustersClient connectedClusters; + + /** + * Gets the ConnectedClustersClient object to access its operations. + * + * @return the ConnectedClustersClient object. + */ + public ConnectedClustersClient getConnectedClusters() { + return this.connectedClusters; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * Initializes an instance of HybridKubernetesManagementClient 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. + */ + HybridKubernetesManagementClientImpl( + 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 = "2020-01-01-preview"; + this.connectedClusters = new ConnectedClustersClientImpl(this); + this.operations = new OperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException 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.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java new file mode 100644 index 000000000000..717f5259b879 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridkubernetes.models.Operation; +import com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final HybridKubernetesManager serviceManager; + + public OperationImpl(OperationInner innerObject, HybridKubernetesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private HybridKubernetesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..37a420749cbc --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.fluent.OperationsClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridkubernetes.models.OperationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final HybridKubernetesManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(HybridKubernetesManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridKubernetesManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridKubernetesMana") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Kubernetes/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync() { + 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.get(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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync(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 + .get(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync() { + return new PagedFlux<>(() -> getSinglePageAsync(), nextLink -> getNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync(Context context) { + return new PagedFlux<>( + () -> getSinglePageAsync(context), nextLink -> getNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get() { + return new PagedIterable<>(getAsync()); + } + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get(Context context) { + return new PagedIterable<>(getAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNextSinglePageAsync(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.getNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 paginated list of connected cluster API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNextSinglePageAsync(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 + .getNext(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/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java new file mode 100644 index 000000000000..f8f6db944ad5 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; +import com.azure.resourcemanager.hybridkubernetes.fluent.OperationsClient; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; +import com.azure.resourcemanager.hybridkubernetes.models.Operation; +import com.azure.resourcemanager.hybridkubernetes.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final HybridKubernetesManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, HybridKubernetesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable get() { + PagedIterable inner = this.serviceClient().get(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable get(Context context) { + PagedIterable inner = this.serviceClient().get(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private HybridKubernetesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java new file mode 100644 index 000000000000..0564b5f18e5a --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.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.hybridkubernetes.implementation; + +import java.util.Arrays; +import java.util.Iterator; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.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; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/package-info.java new file mode 100644 index 000000000000..bfce9423ebd6 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/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 HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +package com.azure.resourcemanager.hybridkubernetes.implementation; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetails.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetails.java new file mode 100644 index 000000000000..9ff265db9a52 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetails.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication details of the user. */ +@Fluent +public final class AuthenticationDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthenticationDetails.class); + + /* + * The mode of client authentication. + */ + @JsonProperty(value = "authenticationMethod", required = true) + private AuthenticationMethod authenticationMethod; + + /* + * Authentication token value. + */ + @JsonProperty(value = "value", required = true) + private AuthenticationDetailsValue value; + + /** + * Get the authenticationMethod property: The mode of client authentication. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: The mode of client authentication. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the AuthenticationDetails object itself. + */ + public AuthenticationDetails withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the value property: Authentication token value. + * + * @return the value value. + */ + public AuthenticationDetailsValue value() { + return this.value; + } + + /** + * Set the value property: Authentication token value. + * + * @param value the value value to set. + * @return the AuthenticationDetails object itself. + */ + public AuthenticationDetails withValue(AuthenticationDetailsValue value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationMethod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authenticationMethod in model AuthenticationDetails")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AuthenticationDetails")); + } else { + value().validate(); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetailsValue.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetailsValue.java new file mode 100644 index 000000000000..4bac303f332e --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationDetailsValue.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.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Authentication token value. */ +@Fluent +public final class AuthenticationDetailsValue { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthenticationDetailsValue.class); + + /* + * Authentication token. + */ + @JsonProperty(value = "token") + private String token; + + /** + * Get the token property: Authentication token. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: Authentication token. + * + * @param token the token value to set. + * @return the AuthenticationDetailsValue object itself. + */ + public AuthenticationDetailsValue withToken(String token) { + this.token = token; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java new file mode 100644 index 000000000000..85c1fa4aad0f --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.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.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthenticationMethod. */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value Token for AuthenticationMethod. */ + public static final AuthenticationMethod TOKEN = fromString("Token"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMethod. + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** @return known AuthenticationMethod values. */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java new file mode 100644 index 000000000000..e82a9b279ccb --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of ConnectedCluster. */ +public interface ConnectedCluster { + /** + * 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: The identity of the connected cluster. + * + * @return the identity value. + */ + ConnectedClusterIdentity identity(); + + /** + * Gets the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the + * initial handshake to the backend services in Azure. + * + * @return the agentPublicKeyCertificate value. + */ + String agentPublicKeyCertificate(); + + /** + * Gets the aadProfile property: AAD profile of the connected cluster. + * + * @return the aadProfile value. + */ + ConnectedClusterAadProfile aadProfile(); + + /** + * Gets the kubernetesVersion property: The Kubernetes version of the connected cluster resource. + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the totalNodeCount property: Number of nodes present in the connected cluster resource. + * + * @return the totalNodeCount value. + */ + Integer totalNodeCount(); + + /** + * Gets the totalCoreCount property: Number of CPU cores present in the connected cluster resource. + * + * @return the totalCoreCount value. + */ + Integer totalCoreCount(); + + /** + * Gets the agentVersion property: Version of the agent running on the connected cluster resource. + * + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * Gets the provisioningState property: Provisioning state of the connected cluster resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the distribution property: The Kubernetes distribution running on this connected cluster. + * + * @return the distribution value. + */ + String distribution(); + + /** + * Gets the infrastructure property: The infrastructure on which the Kubernetes cluster represented by this + * connected cluster is running on. + * + * @return the infrastructure value. + */ + String infrastructure(); + + /** + * Gets the offering property: Connected cluster offering. + * + * @return the offering value. + */ + String offering(); + + /** + * Gets the managedIdentityCertificateExpirationTime property: Expiration time of the managed identity certificate. + * + * @return the managedIdentityCertificateExpirationTime value. + */ + OffsetDateTime managedIdentityCertificateExpirationTime(); + + /** + * Gets the lastConnectivityTime property: Time representing the last instance when heart beat was received from the + * cluster. + * + * @return the lastConnectivityTime value. + */ + OffsetDateTime lastConnectivityTime(); + + /** + * Gets the connectivityStatus property: Represents the connectivity status of the connected cluster. + * + * @return the connectivityStatus value. + */ + ConnectivityStatus connectivityStatus(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner object. + * + * @return the inner object. + */ + ConnectedClusterInner innerModel(); + + /** The entirety of the ConnectedCluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithIdentity, + DefinitionStages.WithAgentPublicKeyCertificate, + DefinitionStages.WithAadProfile, + DefinitionStages.WithCreate { + } + /** The ConnectedCluster definition stages. */ + interface DefinitionStages { + /** The first stage of the ConnectedCluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ConnectedCluster 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 ConnectedCluster 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. + */ + WithIdentity withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the ConnectedCluster definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the connected cluster.. + * + * @param identity The identity of the connected cluster. + * @return the next definition stage. + */ + WithAgentPublicKeyCertificate withIdentity(ConnectedClusterIdentity identity); + } + /** The stage of the ConnectedCluster definition allowing to specify agentPublicKeyCertificate. */ + interface WithAgentPublicKeyCertificate { + /** + * Specifies the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to + * do the initial handshake to the backend services in Azure.. + * + * @param agentPublicKeyCertificate Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + * @return the next definition stage. + */ + WithAadProfile withAgentPublicKeyCertificate(String agentPublicKeyCertificate); + } + /** The stage of the ConnectedCluster definition allowing to specify aadProfile. */ + interface WithAadProfile { + /** + * Specifies the aadProfile property: AAD profile of the connected cluster.. + * + * @param aadProfile AAD profile of the connected cluster. + * @return the next definition stage. + */ + WithCreate withAadProfile(ConnectedClusterAadProfile aadProfile); + } + /** + * The stage of the ConnectedCluster 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.WithProvisioningState, + DefinitionStages.WithDistribution, + DefinitionStages.WithInfrastructure, + DefinitionStages.WithConnectivityStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConnectedCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConnectedCluster create(Context context); + } + /** The stage of the ConnectedCluster 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 ConnectedCluster definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the connected cluster resource.. + * + * @param provisioningState Provisioning state of the connected cluster resource. + * @return the next definition stage. + */ + WithCreate withProvisioningState(ProvisioningState provisioningState); + } + /** The stage of the ConnectedCluster definition allowing to specify distribution. */ + interface WithDistribution { + /** + * Specifies the distribution property: The Kubernetes distribution running on this connected cluster.. + * + * @param distribution The Kubernetes distribution running on this connected cluster. + * @return the next definition stage. + */ + WithCreate withDistribution(String distribution); + } + /** The stage of the ConnectedCluster definition allowing to specify infrastructure. */ + interface WithInfrastructure { + /** + * Specifies the infrastructure property: The infrastructure on which the Kubernetes cluster represented by + * this connected cluster is running on.. + * + * @param infrastructure The infrastructure on which the Kubernetes cluster represented by this connected + * cluster is running on. + * @return the next definition stage. + */ + WithCreate withInfrastructure(String infrastructure); + } + /** The stage of the ConnectedCluster definition allowing to specify connectivityStatus. */ + interface WithConnectivityStatus { + /** + * Specifies the connectivityStatus property: Represents the connectivity status of the connected cluster.. + * + * @param connectivityStatus Represents the connectivity status of the connected cluster. + * @return the next definition stage. + */ + WithCreate withConnectivityStatus(ConnectivityStatus connectivityStatus); + } + } + /** + * Begins update for the ConnectedCluster resource. + * + * @return the stage of resource update. + */ + ConnectedCluster.Update update(); + + /** The template for ConnectedCluster update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithAgentPublicKeyCertificate { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConnectedCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConnectedCluster apply(Context context); + } + /** The ConnectedCluster update stages. */ + interface UpdateStages { + /** The stage of the ConnectedCluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ConnectedCluster update allowing to specify agentPublicKeyCertificate. */ + interface WithAgentPublicKeyCertificate { + /** + * Specifies the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to + * do the initial handshake to the backend services in Azure.. + * + * @param agentPublicKeyCertificate Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + * @return the next definition stage. + */ + Update withAgentPublicKeyCertificate(String agentPublicKeyCertificate); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConnectedCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConnectedCluster refresh(Context context); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterAadProfile.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterAadProfile.java new file mode 100644 index 000000000000..0076164fed14 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterAadProfile.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AAD profile of the connected cluster. */ +@Fluent +public final class ConnectedClusterAadProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedClusterAadProfile.class); + + /* + * The aad tenant id which is configured on target K8s cluster + */ + @JsonProperty(value = "tenantId", required = true) + private String tenantId; + + /* + * The client app id configured on target K8 cluster + */ + @JsonProperty(value = "clientAppId", required = true) + private String clientAppId; + + /* + * The server app id to access AD server + */ + @JsonProperty(value = "serverAppId", required = true) + private String serverAppId; + + /** + * Get the tenantId property: The aad tenant id which is configured on target K8s cluster. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The aad tenant id which is configured on target K8s cluster. + * + * @param tenantId the tenantId value to set. + * @return the ConnectedClusterAadProfile object itself. + */ + public ConnectedClusterAadProfile withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the clientAppId property: The client app id configured on target K8 cluster. + * + * @return the clientAppId value. + */ + public String clientAppId() { + return this.clientAppId; + } + + /** + * Set the clientAppId property: The client app id configured on target K8 cluster. + * + * @param clientAppId the clientAppId value to set. + * @return the ConnectedClusterAadProfile object itself. + */ + public ConnectedClusterAadProfile withClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + return this; + } + + /** + * Get the serverAppId property: The server app id to access AD server. + * + * @return the serverAppId value. + */ + public String serverAppId() { + return this.serverAppId; + } + + /** + * Set the serverAppId property: The server app id to access AD server. + * + * @param serverAppId the serverAppId value to set. + * @return the ConnectedClusterAadProfile object itself. + */ + public ConnectedClusterAadProfile withServerAppId(String serverAppId) { + this.serverAppId = serverAppId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tenantId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property tenantId in model ConnectedClusterAadProfile")); + } + if (clientAppId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientAppId in model ConnectedClusterAadProfile")); + } + if (serverAppId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serverAppId in model ConnectedClusterAadProfile")); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java new file mode 100644 index 000000000000..02cb20b04fd2 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterIdentity.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity for the connected cluster. */ +@Fluent +public class ConnectedClusterIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedClusterIdentity.class); + + /* + * The principal id of connected cluster identity. This property will only + * be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id associated with the connected cluster. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the connected cluster. The type + * 'SystemAssigned, includes a system created identity. The type 'None' + * means no identity is assigned to the connected cluster. + */ + @JsonProperty(value = "type", required = true) + private ResourceIdentityType type; + + /** + * Get the principalId property: The principal id of connected cluster identity. This property will only be provided + * for a system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id associated with the connected cluster. This property will only be + * provided for a system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the connected cluster. The type 'SystemAssigned, includes a + * system created identity. The type 'None' means no identity is assigned to the connected cluster. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the connected cluster. The type 'SystemAssigned, includes a + * system created identity. The type 'None' means no identity is assigned to the connected cluster. + * + * @param type the type value to set. + * @return the ConnectedClusterIdentity object itself. + */ + public ConnectedClusterIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ConnectedClusterIdentity")); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java new file mode 100644 index 000000000000..67e988cf7f4e --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The paginated list of connected Clusters. */ +@Fluent +public final class ConnectedClusterList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedClusterList.class); + + /* + * The list of connected clusters + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to fetch the next page of connected cluster + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of connected clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of connected clusters. + * + * @param value the value value to set. + * @return the ConnectedClusterList object itself. + */ + public ConnectedClusterList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to fetch the next page of connected cluster. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to fetch the next page of connected cluster. + * + * @param nextLink the nextLink value to set. + * @return the ConnectedClusterList object itself. + */ + public ConnectedClusterList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java new file mode 100644 index 000000000000..39bcf60315b5 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Object containing updates for patch operations. */ +@JsonFlatten +@Fluent +public class ConnectedClusterPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedClusterPatch.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + */ + @JsonProperty(value = "properties.agentPublicKeyCertificate") + private String agentPublicKeyCertificate; + + /** + * 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 ConnectedClusterPatch object itself. + */ + public ConnectedClusterPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + * + * @return the agentPublicKeyCertificate value. + */ + public String agentPublicKeyCertificate() { + return this.agentPublicKeyCertificate; + } + + /** + * Set the agentPublicKeyCertificate property: Base64 encoded public certificate used by the agent to do the initial + * handshake to the backend services in Azure. + * + * @param agentPublicKeyCertificate the agentPublicKeyCertificate value to set. + * @return the ConnectedClusterPatch object itself. + */ + public ConnectedClusterPatch withAgentPublicKeyCertificate(String agentPublicKeyCertificate) { + this.agentPublicKeyCertificate = agentPublicKeyCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java new file mode 100644 index 000000000000..487fff765f8a --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.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 ConnectedClusters. */ +public interface ConnectedClusters { + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + ConnectedCluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @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 represents a connected cluster. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 clusterName); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @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 clusterName, Context context); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + CredentialResults listClusterUserCredentials(String resourceGroupName, String clusterName); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param clientProxy Parameter to indicate whether the request is for client side proxy or not. + * @param clientAuthenticationDetails Authentication details of the user. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, + String clusterName, + Boolean clientProxy, + AuthenticationDetails clientAuthenticationDetails, + Context context); + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * API to enumerate registered connected K8s clusters under a Resource Group. + * + * @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 the paginated list of connected Clusters. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + PagedIterable list(); + + /** + * API to enumerate registered connected K8s clusters under a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected Clusters. + */ + PagedIterable list(Context context); + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @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 represents a connected cluster. + */ + ConnectedCluster getById(String id); + + /** + * Returns the properties of the specified connected cluster, including name, identity, properties, and additional + * cluster details. + * + * @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 represents a connected cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @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); + + /** + * Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). + * + * @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 ConnectedCluster resource. + * + * @param name resource name. + * @return the first stage of the new ConnectedCluster definition. + */ + ConnectedCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java new file mode 100644 index 000000000000..eb4b1016635a --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectivityStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectivityStatus. */ +public final class ConnectivityStatus extends ExpandableStringEnum { + /** Static value Connecting for ConnectivityStatus. */ + public static final ConnectivityStatus CONNECTING = fromString("Connecting"); + + /** Static value Connected for ConnectivityStatus. */ + public static final ConnectivityStatus CONNECTED = fromString("Connected"); + + /** Static value Offline for ConnectivityStatus. */ + public static final ConnectivityStatus OFFLINE = fromString("Offline"); + + /** Static value Expired for ConnectivityStatus. */ + public static final ConnectivityStatus EXPIRED = fromString("Expired"); + + /** + * Creates or finds a ConnectivityStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectivityStatus. + */ + @JsonCreator + public static ConnectivityStatus fromString(String name) { + return fromString(name, ConnectivityStatus.class); + } + + /** @return known ConnectivityStatus values. */ + public static Collection values() { + return values(ConnectivityStatus.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java new file mode 100644 index 000000000000..9019fae1f3cc --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.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.hybridkubernetes.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The credential result response. */ +@Immutable +public final class CredentialResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResult.class); + + /* + * The name of the credential. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private byte[] value; + + /** + * Get the name property: The name of the credential. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: Base64-encoded Kubernetes configuration file. + * + * @return the value value. + */ + public byte[] value() { + return CoreUtils.clone(this.value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java new file mode 100644 index 000000000000..da6275bfc883 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import java.util.List; + +/** An immutable client-side representation of CredentialResults. */ +public interface CredentialResults { + /** + * Gets the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. + * + * @return the hybridConnectionConfig value. + */ + HybridConnectionConfig hybridConnectionConfig(); + + /** + * Gets the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + List kubeconfigs(); + + /** + * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner object. + * + * @return the inner object. + */ + CredentialResultsInner innerModel(); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..726973f76fe0 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.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.hybridkubernetes.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource management error additional info. */ +@Immutable +public final class ErrorAdditionalInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); + + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object info() { + return this.info; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java new file mode 100644 index 000000000000..63a2f138548c --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.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.hybridkubernetes.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the REP (rendezvous endpoint) and “Sender” access token. */ +@Immutable +public final class HybridConnectionConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionConfig.class); + + /* + * 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 relay. + */ + @JsonProperty(value = "relay", access = JsonProperty.Access.WRITE_ONLY) + private String relay; + + /* + * Sender 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 relay. + * + * @return the relay value. + */ + public String relay() { + return this.relay; + } + + /** + * Get the token property: Sender 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/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.java new file mode 100644 index 000000000000..b642fea7ef98 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operation.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.hybridkubernetes.models; + +import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {Microsoft.Kubernetes}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java new file mode 100644 index 000000000000..6346dc056649 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Service provider: Microsoft.connectedClusters + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Connected Cluster Resource on which the operation is performed + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Service provider: Microsoft.connectedClusters. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft.connectedClusters. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Connected Cluster Resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Connected Cluster Resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type: Read, write, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java new file mode 100644 index 000000000000..fd059d2c1a88 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/OperationList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The paginated list of connected cluster API operations. */ +@Fluent +public final class OperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); + + /* + * The list of connected cluster API operations. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link to fetch the next page of connected cluster API operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of connected cluster API operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to fetch the next page of connected cluster API operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to fetch the next page of connected cluster API operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationList object itself. + */ + public OperationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java new file mode 100644 index 000000000000..92bfeeefcc0a --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + PagedIterable get(); + + /** + * Lists all of the available API operations for Connected Cluster resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of connected cluster API operations. + */ + PagedIterable get(Context context); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.java new file mode 100644 index 000000000000..3fa5f90c7af8 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ProvisioningState.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.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for ProvisioningState. */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.java new file mode 100644 index 000000000000..2d4c98717aa2 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ResourceIdentityType.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.hybridkubernetes.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value None. */ + NONE("None"), + + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/package-info.java new file mode 100644 index 000000000000..3e85170bd735 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/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 HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +package com.azure.resourcemanager.hybridkubernetes.models; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/package-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/package-info.java new file mode 100644 index 000000000000..ddf72d636abc --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/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 HybridKubernetesManagementClient. Hybrid Kubernetes Client. */ +package com.azure.resourcemanager.hybridkubernetes; diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/module-info.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/module-info.java new file mode 100644 index 000000000000..1bfb39198d75 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/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.hybridkubernetes { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.hybridkubernetes; + exports com.azure.resourcemanager.hybridkubernetes.fluent; + exports com.azure.resourcemanager.hybridkubernetes.fluent.models; + exports com.azure.resourcemanager.hybridkubernetes.models; + + opens com.azure.resourcemanager.hybridkubernetes.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hybridkubernetes.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/hybridkubernetes/ci.yml b/sdk/hybridkubernetes/ci.yml new file mode 100644 index 000000000000..5d73fb5abc4a --- /dev/null +++ b/sdk/hybridkubernetes/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hybridkubernetes + Artifacts: + - name: azure-resourcemanager-hybridkubernetes + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerhybridkubernetes diff --git a/sdk/hybridkubernetes/pom.xml b/sdk/hybridkubernetes/pom.xml new file mode 100644 index 000000000000..cfbc1be3f89f --- /dev/null +++ b/sdk/hybridkubernetes/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-hybridkubernetes-service + pom + 1.0.0 + + azure-resourcemanager-hybridkubernetes + +