diff --git a/eng/automation/api-specs.yaml b/eng/automation/api-specs.yaml index e1784ce597af..afd2a04788c5 100644 --- a/eng/automation/api-specs.yaml +++ b/eng/automation/api-specs.yaml @@ -66,6 +66,8 @@ informatica: service: informaticadatamanagement keyvault: suffix: generated +kubernetesconfiguration/Microsoft.KubernetesConfiguration/extensionTypes: + service: kubernetesconfiguration liftrastronomer: service: astro liftrqumulo: diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e52addf8dc5d..8b1dfd23fe4f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -487,6 +487,7 @@ com.azure.resourcemanager:azure-resourcemanager-sitemanager;1.0.0-beta.1;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-mongodbatlas;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-purestorageblock;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-planetarycomputer;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-kubernetesconfiguration-extensiontypes;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/CHANGELOG.md b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/CHANGELOG.md new file mode 100644 index 000000000000..28957f58bb05 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-05-21) + +- Azure Resource Manager ExtensionTypes client library for Java. This package contains Microsoft Azure SDK for ExtensionTypes Management SDK. KubernetesConfiguration Extension Types Client. Package tag package-preview-2024-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-kubernetesconfiguration-extensiontypes Java SDK. diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/README.md b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/README.md new file mode 100644 index 000000000000..2c60fae3dead --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager ExtensionTypes client library for Java + +Azure Resource Manager ExtensionTypes client library for Java. + +This package contains Microsoft Azure SDK for ExtensionTypes Management SDK. KubernetesConfiguration Extension Types Client. Package tag package-preview-2024-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-kubernetesconfiguration-extensiontypes;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-kubernetesconfiguration-extensiontypes + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ExtensionTypesManager manager = ExtensionTypesManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/SAMPLE.md b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/SAMPLE.md new file mode 100644 index 000000000000..ab7ddbd8d554 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/SAMPLE.md @@ -0,0 +1,218 @@ +# Code snippets and samples + + +## ExtensionTypes + +- [ClusterGetVersion](#extensiontypes_clustergetversion) +- [ClusterListVersions](#extensiontypes_clusterlistversions) +- [Get](#extensiontypes_get) +- [GetVersion](#extensiontypes_getversion) +- [List](#extensiontypes_list) +- [ListVersions](#extensiontypes_listversions) +- [LocationGet](#extensiontypes_locationget) +- [LocationList](#extensiontypes_locationlist) +### ExtensionTypes_ClusterGetVersion + +```java +/** + * Samples for ExtensionTypes LocationGet. + */ +public final class ExtensionTypesLocationGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionTypeByLocation.json + */ + /** + * Sample code: Get Extension Type. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void getExtensionType( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes().locationGetWithResponse("westus2", "extensionType1", com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionTypes_ClusterListVersions + +```java +/** + * Samples for ExtensionTypes Get. + */ +public final class ExtensionTypesGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionType.json + */ + /** + * Sample code: Get Extension Types. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void getExtensionTypes( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .getWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", "my-extension-type", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionTypes_Get + +```java +/** + * Samples for ExtensionTypes ClusterGetVersion. + */ +public final class ExtensionTypesClusterGetVersiSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionTypeVersion.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .clusterGetVersionWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", + "my-extension-type", "v1.3.2", com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionTypes_GetVersion + +```java +/** + * Samples for ExtensionTypes ListVersions. + */ +public final class ExtensionTypesListVersionsSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypeVersionsByLocation.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .listVersions("westus", "extensionType1", "stable", "connectedCluster", "2", true, + com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionTypes_List + +```java +/** + * Samples for ExtensionTypes LocationList. + */ +public final class ExtensionTypesLocationListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypesByLocation.json + */ + /** + * Sample code: List Extension Types. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypes( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .locationList("westus2", "myPublisherId", "myOfferId", "myPlanId", "stable", "connectedCluster", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionTypes_ListVersions + +```java +/** + * Samples for ExtensionTypes ClusterListVersions. + */ +public final class ExtensionTypesClusterListVersSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypeVersions.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .clusterListVersions("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", "my-extension-type", + "stable", "2", true, com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionTypes_LocationGet + +```java +/** + * Samples for ExtensionTypes GetVersion. + */ +public final class ExtensionTypesGetVersionSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionTypeVersionByLocation.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .getVersionWithResponse("westus", "extensionType1", "1.20.0", com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionTypes_LocationList + +```java +/** + * Samples for ExtensionTypes List. + */ +public final class ExtensionTypesListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypes.json + */ + /** + * Sample code: Get Extension Types. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void getExtensionTypes( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", "myPublisherId", "myOfferId", + "myPlanId", "stable", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/pom.xml b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/pom.xml new file mode 100644 index 000000000000..4999efeadde6 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-kubernetesconfiguration-extensiontypes + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ExtensionTypes Management + This package contains Microsoft Azure SDK for ExtensionTypes Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. KubernetesConfiguration Extension Types Client. Package tag package-preview-2024-11. + 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 + 0 + 0 + true + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + com.azure + azure-core-test + 1.27.0-beta.8 + test + + + com.azure + azure-identity + 1.16.1 + test + + + diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/ExtensionTypesManager.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/ExtensionTypesManager.java new file mode 100644 index 000000000000..75c502d3fc4a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/ExtensionTypesManager.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.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.RetryOptions; +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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.ExtensionTypesMgmtClient; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.implementation.ExtensionTypesImpl; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.implementation.ExtensionTypesMgmtClientBuilder; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionTypes; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to ExtensionTypesManager. + * KubernetesConfiguration Extension Types Client. + */ +public final class ExtensionTypesManager { + private ExtensionTypes extensionTypes; + + private final ExtensionTypesMgmtClient clientObject; + + private ExtensionTypesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new ExtensionTypesMgmtClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ExtensionTypes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ExtensionTypes service API instance. + */ + public static ExtensionTypesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of ExtensionTypes service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ExtensionTypes service API instance. + */ + public static ExtensionTypesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ExtensionTypesManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ExtensionTypesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ExtensionTypesManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-kubernetesconfiguration-extensiontypes.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ExtensionTypes service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ExtensionTypes service API instance. + */ + public ExtensionTypesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.kubernetesconfiguration.extensiontypes") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ExtensionTypesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ExtensionTypes. + * + * @return Resource collection API of ExtensionTypes. + */ + public ExtensionTypes extensionTypes() { + if (this.extensionTypes == null) { + this.extensionTypes = new ExtensionTypesImpl(clientObject.getExtensionTypes(), this); + } + return extensionTypes; + } + + /** + * Gets wrapped service client ExtensionTypesMgmtClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client ExtensionTypesMgmtClient. + */ + public ExtensionTypesMgmtClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/ExtensionTypesClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/ExtensionTypesClient.java new file mode 100644 index 000000000000..0017526f5c0d --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/ExtensionTypesClient.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.VersionForReleaseTrainInner; + +/** + * An instance of this class provides access to all the operations defined in ExtensionTypesClient. + */ +public interface ExtensionTypesClient { + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable locationList(String location); + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @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 list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable locationList(String location, String publisherId, String offerId, String planId, + String releaseTrain, String clusterType, Context context); + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @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 an extension type for the location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response locationGetWithResponse(String location, String extensionTypeName, Context context); + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extension type for the location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionTypeInner locationGet(String location, String extensionTypeName); + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String location, String extensionTypeName); + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @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 list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String location, String extensionTypeName, + String releaseTrain, String clusterType, String majorVersion, Boolean showLatest, Context context); + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @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 details of a version for an extension type and location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVersionWithResponse(String location, String extensionTypeName, + String versionNumber, Context context); + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an extension type and location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VersionForReleaseTrainInner getVersion(String location, String extensionTypeName, String versionNumber); + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes 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 list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName); + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String publisherId, String offerId, String planId, String releaseTrain, Context context); + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @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 an Extension Type installable to the cluster based region and type for the cluster along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String extensionTypeName, Context context); + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Type installable to the cluster based region and type for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionTypeInner get(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, + String extensionTypeName); + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName); + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @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 list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String releaseTrain, + String majorVersion, Boolean showLatest, Context context); + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @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 details of a version for an Extension Type installable to the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response clusterGetVersionWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String versionNumber, + Context context); + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an Extension Type installable to the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VersionForReleaseTrainInner clusterGetVersion(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String versionNumber); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/ExtensionTypesMgmtClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/ExtensionTypesMgmtClient.java new file mode 100644 index 000000000000..54ae436a30e4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/ExtensionTypesMgmtClient.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.kubernetesconfiguration.extensiontypes.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for ExtensionTypesMgmtClient class. + */ +public interface ExtensionTypesMgmtClient { + /** + * 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 ExtensionTypesClient object to access its operations. + * + * @return the ExtensionTypesClient object. + */ + ExtensionTypesClient getExtensionTypes(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/ClusterScopeSettingsProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/ClusterScopeSettingsProperties.java new file mode 100644 index 000000000000..4325b3a433a6 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/ClusterScopeSettingsProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Extension scope settings. + */ +@Fluent +public final class ClusterScopeSettingsProperties implements JsonSerializable { + /* + * Describes if multiple instances of the extension are allowed + */ + private Boolean allowMultipleInstances; + + /* + * Default extension release namespace + */ + private String defaultReleaseNamespace; + + /** + * Creates an instance of ClusterScopeSettingsProperties class. + */ + public ClusterScopeSettingsProperties() { + } + + /** + * Get the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @return the allowMultipleInstances value. + */ + public Boolean allowMultipleInstances() { + return this.allowMultipleInstances; + } + + /** + * Set the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @param allowMultipleInstances the allowMultipleInstances value to set. + * @return the ClusterScopeSettingsProperties object itself. + */ + public ClusterScopeSettingsProperties withAllowMultipleInstances(Boolean allowMultipleInstances) { + this.allowMultipleInstances = allowMultipleInstances; + return this; + } + + /** + * Get the defaultReleaseNamespace property: Default extension release namespace. + * + * @return the defaultReleaseNamespace value. + */ + public String defaultReleaseNamespace() { + return this.defaultReleaseNamespace; + } + + /** + * Set the defaultReleaseNamespace property: Default extension release namespace. + * + * @param defaultReleaseNamespace the defaultReleaseNamespace value to set. + * @return the ClusterScopeSettingsProperties object itself. + */ + public ClusterScopeSettingsProperties withDefaultReleaseNamespace(String defaultReleaseNamespace) { + this.defaultReleaseNamespace = defaultReleaseNamespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowMultipleInstances", this.allowMultipleInstances); + jsonWriter.writeStringField("defaultReleaseNamespace", this.defaultReleaseNamespace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterScopeSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterScopeSettingsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterScopeSettingsProperties. + */ + public static ClusterScopeSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterScopeSettingsProperties deserializedClusterScopeSettingsProperties + = new ClusterScopeSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowMultipleInstances".equals(fieldName)) { + deserializedClusterScopeSettingsProperties.allowMultipleInstances + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultReleaseNamespace".equals(fieldName)) { + deserializedClusterScopeSettingsProperties.defaultReleaseNamespace = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterScopeSettingsProperties; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/ExtensionTypeInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/ExtensionTypeInner.java new file mode 100644 index 000000000000..8758201aa616 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/ExtensionTypeInner.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionTypeProperties; +import java.io.IOException; + +/** + * The Extension Type object. + */ +@Fluent +public final class ExtensionTypeInner extends ProxyResource { + /* + * The properties property. + */ + private ExtensionTypeProperties properties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ExtensionTypeInner class. + */ + public ExtensionTypeInner() { + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public ExtensionTypeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the ExtensionTypeInner object itself. + */ + public ExtensionTypeInner withProperties(ExtensionTypeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionTypeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionTypeInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExtensionTypeInner. + */ + public static ExtensionTypeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionTypeInner deserializedExtensionTypeInner = new ExtensionTypeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExtensionTypeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedExtensionTypeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtensionTypeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedExtensionTypeInner.properties = ExtensionTypeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionTypeInner; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/VersionForReleaseTrainInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/VersionForReleaseTrainInner.java new file mode 100644 index 000000000000..34985345c5cd --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/VersionForReleaseTrainInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrainProperties; +import java.io.IOException; + +/** + * The Extension Type Version object. + */ +@Fluent +public final class VersionForReleaseTrainInner extends ProxyResource { + /* + * The properties property. + */ + private VersionForReleaseTrainProperties properties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of VersionForReleaseTrainInner class. + */ + public VersionForReleaseTrainInner() { + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public VersionForReleaseTrainProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the VersionForReleaseTrainInner object itself. + */ + public VersionForReleaseTrainInner withProperties(VersionForReleaseTrainProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VersionForReleaseTrainInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VersionForReleaseTrainInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VersionForReleaseTrainInner. + */ + public static VersionForReleaseTrainInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VersionForReleaseTrainInner deserializedVersionForReleaseTrainInner = new VersionForReleaseTrainInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVersionForReleaseTrainInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVersionForReleaseTrainInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVersionForReleaseTrainInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVersionForReleaseTrainInner.properties + = VersionForReleaseTrainProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVersionForReleaseTrainInner; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/package-info.java new file mode 100644 index 000000000000..b8bc02da0685 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for ExtensionTypesMgmtClient. + * KubernetesConfiguration Extension Types Client. + */ +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/package-info.java new file mode 100644 index 000000000000..32fb367515ff --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for ExtensionTypesMgmtClient. + * KubernetesConfiguration Extension Types Client. + */ +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypeImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypeImpl.java new file mode 100644 index 000000000000..3ce7bc9c454b --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypeImpl.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.kubernetesconfiguration.extensiontypes.implementation; + +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionType; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionTypeProperties; + +public final class ExtensionTypeImpl implements ExtensionType { + private ExtensionTypeInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager serviceManager; + + ExtensionTypeImpl(ExtensionTypeInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExtensionTypeProperties properties() { + return this.innerModel().properties(); + } + + public ExtensionTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesClientImpl.java new file mode 100644 index 000000000000..51d58fe31da9 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesClientImpl.java @@ -0,0 +1,2143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.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.kubernetesconfiguration.extensiontypes.fluent.ExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.VersionForReleaseTrainInner; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionTypeVersionsList; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionTypesList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExtensionTypesClient. + */ +public final class ExtensionTypesClientImpl implements ExtensionTypesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ExtensionTypesService service; + + /** + * The service client containing this operation class. + */ + private final ExtensionTypesMgmtClientImpl client; + + /** + * Initializes an instance of ExtensionTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionTypesClientImpl(ExtensionTypesMgmtClientImpl client) { + this.service + = RestProxy.create(ExtensionTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ExtensionTypesMgmtClientExtensionTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ExtensionTypesMgmtCl") + public interface ExtensionTypesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> locationList(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("publisherId") String publisherId, @QueryParam("offerId") String offerId, + @QueryParam("planId") String planId, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("clusterType") String clusterType, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response locationListSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("publisherId") String publisherId, @QueryParam("offerId") String offerId, + @QueryParam("planId") String planId, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("clusterType") String clusterType, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> locationGet(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response locationGetSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersions(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("clusterType") String clusterType, @QueryParam("majorVersion") String majorVersion, + @QueryParam("showLatest") Boolean showLatest, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listVersionsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("clusterType") String clusterType, @QueryParam("majorVersion") String majorVersion, + @QueryParam("showLatest") Boolean showLatest, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions/{versionNumber}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVersion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @PathParam("extensionTypeName") String extensionTypeName, @PathParam("versionNumber") String versionNumber, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions/{versionNumber}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getVersionSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @PathParam("extensionTypeName") String extensionTypeName, @PathParam("versionNumber") String versionNumber, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @QueryParam("publisherId") String publisherId, @QueryParam("offerId") String offerId, + @QueryParam("planId") String planId, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @QueryParam("publisherId") String publisherId, @QueryParam("offerId") String offerId, + @QueryParam("planId") String planId, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> clusterListVersions(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("majorVersion") String majorVersion, @QueryParam("showLatest") Boolean showLatest, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response clusterListVersionsSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @PathParam("extensionTypeName") String extensionTypeName, @QueryParam("releaseTrain") String releaseTrain, + @QueryParam("majorVersion") String majorVersion, @QueryParam("showLatest") Boolean showLatest, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}/versions/{versionNumber}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> clusterGetVersion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @PathParam("extensionTypeName") String extensionTypeName, @PathParam("versionNumber") String versionNumber, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}/versions/{versionNumber}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response clusterGetVersionSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterRp") String clusterRp, + @PathParam("clusterResourceName") String clusterResourceName, @PathParam("clusterName") String clusterName, + @PathParam("extensionTypeName") String extensionTypeName, @PathParam("versionNumber") String versionNumber, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> locationListNext( + @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) + Response locationListNextSync( + @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> listVersionsNext( + @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) + Response listVersionsNextSync( + @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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@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> clusterListVersionsNext( + @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) + Response clusterListVersionsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> locationListSinglePageAsync(String location, String publisherId, + String offerId, String planId, String releaseTrain, String clusterType) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.locationList(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, publisherId, offerId, planId, releaseTrain, clusterType, this.client.getApiVersion(), accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux locationListAsync(String location, String publisherId, String offerId, + String planId, String releaseTrain, String clusterType) { + return new PagedFlux<>( + () -> locationListSinglePageAsync(location, publisherId, offerId, planId, releaseTrain, clusterType), + nextLink -> locationListNextSinglePageAsync(nextLink)); + } + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux locationListAsync(String location) { + final String publisherId = null; + final String offerId = null; + final String planId = null; + final String releaseTrain = null; + final String clusterType = null; + return new PagedFlux<>( + () -> locationListSinglePageAsync(location, publisherId, offerId, planId, releaseTrain, clusterType), + nextLink -> locationListNextSinglePageAsync(nextLink)); + } + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse locationListSinglePage(String location, String publisherId, + String offerId, String planId, String releaseTrain, String clusterType) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.locationListSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), location, publisherId, offerId, planId, releaseTrain, clusterType, + this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse locationListSinglePage(String location, String publisherId, + String offerId, String planId, String releaseTrain, String clusterType, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.locationListSync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + publisherId, offerId, planId, releaseTrain, clusterType, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable locationList(String location) { + final String publisherId = null; + final String offerId = null; + final String planId = null; + final String releaseTrain = null; + final String clusterType = null; + return new PagedIterable<>( + () -> locationListSinglePage(location, publisherId, offerId, planId, releaseTrain, clusterType), + nextLink -> locationListNextSinglePage(nextLink)); + } + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable locationList(String location, String publisherId, String offerId, + String planId, String releaseTrain, String clusterType, Context context) { + return new PagedIterable<>( + () -> locationListSinglePage(location, publisherId, offerId, planId, releaseTrain, clusterType, context), + nextLink -> locationListNextSinglePage(nextLink, context)); + } + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extension type for the location along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> locationGetWithResponseAsync(String location, String extensionTypeName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.locationGet(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, extensionTypeName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extension type for the location on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono locationGetAsync(String location, String extensionTypeName) { + return locationGetWithResponseAsync(location, extensionTypeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extension type for the location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response locationGetWithResponse(String location, String extensionTypeName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.locationGetSync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + extensionTypeName, this.client.getApiVersion(), accept, context); + } + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extension type for the location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionTypeInner locationGet(String location, String extensionTypeName) { + return locationGetWithResponse(location, extensionTypeName, Context.NONE).getValue(); + } + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync(String location, + String extensionTypeName, String releaseTrain, String clusterType, String majorVersion, Boolean showLatest) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, extensionTypeName, releaseTrain, clusterType, majorVersion, showLatest, + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync(String location, String extensionTypeName, + String releaseTrain, String clusterType, String majorVersion, Boolean showLatest) { + return new PagedFlux<>(() -> listVersionsSinglePageAsync(location, extensionTypeName, releaseTrain, clusterType, + majorVersion, showLatest), nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync(String location, String extensionTypeName) { + final String releaseTrain = null; + final String clusterType = null; + final String majorVersion = null; + final Boolean showLatest = null; + return new PagedFlux<>(() -> listVersionsSinglePageAsync(location, extensionTypeName, releaseTrain, clusterType, + majorVersion, showLatest), nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsSinglePage(String location, String extensionTypeName, + String releaseTrain, String clusterType, String majorVersion, Boolean showLatest) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listVersionsSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), location, extensionTypeName, releaseTrain, clusterType, majorVersion, + showLatest, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsSinglePage(String location, String extensionTypeName, + String releaseTrain, String clusterType, String majorVersion, Boolean showLatest, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listVersionsSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), location, extensionTypeName, releaseTrain, clusterType, majorVersion, + showLatest, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String location, String extensionTypeName) { + final String releaseTrain = null; + final String clusterType = null; + final String majorVersion = null; + final Boolean showLatest = null; + return new PagedIterable<>(() -> listVersionsSinglePage(location, extensionTypeName, releaseTrain, clusterType, + majorVersion, showLatest), nextLink -> listVersionsNextSinglePage(nextLink)); + } + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String location, String extensionTypeName, + String releaseTrain, String clusterType, String majorVersion, Boolean showLatest, Context context) { + return new PagedIterable<>(() -> listVersionsSinglePage(location, extensionTypeName, releaseTrain, clusterType, + majorVersion, showLatest, context), nextLink -> listVersionsNextSinglePage(nextLink, context)); + } + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an extension type and location along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVersionWithResponseAsync(String location, + String extensionTypeName, String versionNumber) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + if (versionNumber == null) { + return Mono.error(new IllegalArgumentException("Parameter versionNumber is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getVersion(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, extensionTypeName, versionNumber, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an extension type and location on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVersionAsync(String location, String extensionTypeName, + String versionNumber) { + return getVersionWithResponseAsync(location, extensionTypeName, versionNumber) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an extension type and location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVersionWithResponse(String location, String extensionTypeName, + String versionNumber, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + if (versionNumber == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter versionNumber is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getVersionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), location, + extensionTypeName, versionNumber, this.client.getApiVersion(), accept, context); + } + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an extension type and location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VersionForReleaseTrainInner getVersion(String location, String extensionTypeName, String versionNumber) { + return getVersionWithResponse(location, extensionTypeName, versionNumber, Context.NONE).getValue(); + } + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String publisherId, String offerId, String planId, + String releaseTrain) { + 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 (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName 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.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, publisherId, offerId, planId, + releaseTrain, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String publisherId, String offerId, String planId, + String releaseTrain) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, + publisherId, offerId, planId, releaseTrain), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes 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 list Extension Types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName) { + final String publisherId = null; + final String offerId = null; + final String planId = null; + final String releaseTrain = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, + publisherId, offerId, planId, releaseTrain), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String publisherId, String offerId, String planId, + String releaseTrain) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, publisherId, offerId, planId, releaseTrain, + this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String publisherId, String offerId, String planId, + String releaseTrain, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, publisherId, offerId, planId, releaseTrain, + this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes 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 list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName) { + final String publisherId = null; + final String offerId = null; + final String planId = null; + final String releaseTrain = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterRp, clusterResourceName, clusterName, + publisherId, offerId, planId, releaseTrain), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String publisherId, String offerId, String planId, + String releaseTrain, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, clusterRp, clusterResourceName, clusterName, + publisherId, offerId, planId, releaseTrain, context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Type installable to the cluster based region and type for the cluster along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName) { + 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 (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Type installable to the cluster based region and type for the cluster on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String extensionTypeName) { + return getWithResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Type installable to the cluster based region and type for the cluster along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterRp, + clusterResourceName, clusterName, extensionTypeName, this.client.getApiVersion(), accept, context); + } + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Type installable to the cluster based region and type for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionTypeInner get(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String extensionTypeName) { + return getWithResponse(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, + Context.NONE).getValue(); + } + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clusterListVersionsSinglePageAsync( + String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, + String extensionTypeName, String releaseTrain, String majorVersion, Boolean showLatest) { + 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 (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.clusterListVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, releaseTrain, + majorVersion, showLatest, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux clusterListVersionsAsync(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String releaseTrain, + String majorVersion, Boolean showLatest) { + return new PagedFlux<>( + () -> clusterListVersionsSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, releaseTrain, majorVersion, showLatest), + nextLink -> clusterListVersionsNextSinglePageAsync(nextLink)); + } + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux clusterListVersionsAsync(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName) { + final String releaseTrain = null; + final String majorVersion = null; + final Boolean showLatest = null; + return new PagedFlux<>( + () -> clusterListVersionsSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, releaseTrain, majorVersion, showLatest), + nextLink -> clusterListVersionsNextSinglePageAsync(nextLink)); + } + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse clusterListVersionsSinglePage(String resourceGroupName, + String clusterRp, String clusterResourceName, String clusterName, String extensionTypeName, String releaseTrain, + String majorVersion, Boolean showLatest) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.clusterListVersionsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, releaseTrain, + majorVersion, showLatest, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse clusterListVersionsSinglePage(String resourceGroupName, + String clusterRp, String clusterResourceName, String clusterName, String extensionTypeName, String releaseTrain, + String majorVersion, Boolean showLatest, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.clusterListVersionsSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, releaseTrain, majorVersion, showLatest, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName) { + final String releaseTrain = null; + final String majorVersion = null; + final Boolean showLatest = null; + return new PagedIterable<>( + () -> clusterListVersionsSinglePage(resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, releaseTrain, majorVersion, showLatest), + nextLink -> clusterListVersionsNextSinglePage(nextLink)); + } + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String releaseTrain, + String majorVersion, Boolean showLatest, Context context) { + return new PagedIterable<>( + () -> clusterListVersionsSinglePage(resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, releaseTrain, majorVersion, showLatest, context), + nextLink -> clusterListVersionsNextSinglePage(nextLink, context)); + } + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an Extension Type installable to the cluster along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clusterGetVersionWithResponseAsync(String resourceGroupName, + String clusterRp, String clusterResourceName, String clusterName, String extensionTypeName, + String versionNumber) { + 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 (clusterRp == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + if (versionNumber == null) { + return Mono.error(new IllegalArgumentException("Parameter versionNumber is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.clusterGetVersion(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, versionNumber, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an Extension Type installable to the cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono clusterGetVersionAsync(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String versionNumber) { + return clusterGetVersionWithResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, versionNumber).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an Extension Type installable to the cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response clusterGetVersionWithResponse(String resourceGroupName, + String clusterRp, String clusterResourceName, String clusterName, String extensionTypeName, + String versionNumber, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterRp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); + } + if (clusterResourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionTypeName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter extensionTypeName is required and cannot be null.")); + } + if (versionNumber == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter versionNumber is required and cannot be null.")); + } + final String accept = "application/json"; + return service.clusterGetVersionSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, versionNumber, + this.client.getApiVersion(), accept, context); + } + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an Extension Type installable to the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VersionForReleaseTrainInner clusterGetVersion(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String versionNumber) { + return clusterGetVersionWithResponse(resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, versionNumber, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> locationListNextSinglePageAsync(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.locationListNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse locationListNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.locationListNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse locationListNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.locationListNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(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.listVersionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listVersionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listVersionsNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listVersionsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clusterListVersionsNextSinglePageAsync(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.clusterListVersionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse clusterListVersionsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.clusterListVersionsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse clusterListVersionsNextSinglePage(String nextLink, + Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.clusterListVersionsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(ExtensionTypesClientImpl.class); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesImpl.java new file mode 100644 index 000000000000..1c3b8e01a558 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.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.kubernetesconfiguration.extensiontypes.fluent.ExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ExtensionTypeInner; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.VersionForReleaseTrainInner; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionType; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionTypes; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrain; + +public final class ExtensionTypesImpl implements ExtensionTypes { + private static final ClientLogger LOGGER = new ClientLogger(ExtensionTypesImpl.class); + + private final ExtensionTypesClient innerClient; + + private final com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager serviceManager; + + public ExtensionTypesImpl(ExtensionTypesClient innerClient, + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable locationList(String location) { + PagedIterable inner = this.serviceClient().locationList(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + public PagedIterable locationList(String location, String publisherId, String offerId, String planId, + String releaseTrain, String clusterType, Context context) { + PagedIterable inner = this.serviceClient() + .locationList(location, publisherId, offerId, planId, releaseTrain, clusterType, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + public Response locationGetWithResponse(String location, String extensionTypeName, Context context) { + Response inner + = this.serviceClient().locationGetWithResponse(location, extensionTypeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExtensionTypeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExtensionType locationGet(String location, String extensionTypeName) { + ExtensionTypeInner inner = this.serviceClient().locationGet(location, extensionTypeName); + if (inner != null) { + return new ExtensionTypeImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listVersions(String location, String extensionTypeName) { + PagedIterable inner + = this.serviceClient().listVersions(location, extensionTypeName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VersionForReleaseTrainImpl(inner1, this.manager())); + } + + public PagedIterable listVersions(String location, String extensionTypeName, + String releaseTrain, String clusterType, String majorVersion, Boolean showLatest, Context context) { + PagedIterable inner = this.serviceClient() + .listVersions(location, extensionTypeName, releaseTrain, clusterType, majorVersion, showLatest, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VersionForReleaseTrainImpl(inner1, this.manager())); + } + + public Response getVersionWithResponse(String location, String extensionTypeName, + String versionNumber, Context context) { + Response inner + = this.serviceClient().getVersionWithResponse(location, extensionTypeName, versionNumber, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VersionForReleaseTrainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VersionForReleaseTrain getVersion(String location, String extensionTypeName, String versionNumber) { + VersionForReleaseTrainInner inner = this.serviceClient().getVersion(location, extensionTypeName, versionNumber); + if (inner != null) { + return new VersionForReleaseTrainImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String publisherId, String offerId, String planId, String releaseTrain, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, clusterRp, clusterResourceName, clusterName, publisherId, offerId, planId, + releaseTrain, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtensionTypeImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExtensionTypeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExtensionType get(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, + String extensionTypeName) { + ExtensionTypeInner inner = this.serviceClient() + .get(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName); + if (inner != null) { + return new ExtensionTypeImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName) { + PagedIterable inner = this.serviceClient() + .clusterListVersions(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VersionForReleaseTrainImpl(inner1, this.manager())); + } + + public PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String releaseTrain, + String majorVersion, Boolean showLatest, Context context) { + PagedIterable inner = this.serviceClient() + .clusterListVersions(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, + releaseTrain, majorVersion, showLatest, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VersionForReleaseTrainImpl(inner1, this.manager())); + } + + public Response clusterGetVersionWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String versionNumber, + Context context) { + Response inner = this.serviceClient() + .clusterGetVersionWithResponse(resourceGroupName, clusterRp, clusterResourceName, clusterName, + extensionTypeName, versionNumber, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VersionForReleaseTrainImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VersionForReleaseTrain clusterGetVersion(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String versionNumber) { + VersionForReleaseTrainInner inner = this.serviceClient() + .clusterGetVersion(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionTypeName, + versionNumber); + if (inner != null) { + return new VersionForReleaseTrainImpl(inner, this.manager()); + } else { + return null; + } + } + + private ExtensionTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesMgmtClientBuilder.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesMgmtClientBuilder.java new file mode 100644 index 000000000000..42d255386bdb --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesMgmtClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the ExtensionTypesMgmtClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ExtensionTypesMgmtClientImpl.class }) +public final class ExtensionTypesMgmtClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ExtensionTypesMgmtClientBuilder. + */ + public ExtensionTypesMgmtClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ExtensionTypesMgmtClientBuilder. + */ + public ExtensionTypesMgmtClientBuilder 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 ExtensionTypesMgmtClientBuilder. + */ + public ExtensionTypesMgmtClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ExtensionTypesMgmtClientBuilder. + */ + public ExtensionTypesMgmtClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ExtensionTypesMgmtClientBuilder. + */ + public ExtensionTypesMgmtClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ExtensionTypesMgmtClientBuilder. + */ + public ExtensionTypesMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ExtensionTypesMgmtClientImpl with the provided parameters. + * + * @return an instance of ExtensionTypesMgmtClientImpl. + */ + public ExtensionTypesMgmtClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ExtensionTypesMgmtClientImpl client = new ExtensionTypesMgmtClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesMgmtClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesMgmtClientImpl.java new file mode 100644 index 000000000000..40f2cd7de5b1 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ExtensionTypesMgmtClientImpl.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +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.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.ExtensionTypesClient; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.ExtensionTypesMgmtClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the ExtensionTypesMgmtClientImpl type. + */ +@ServiceClient(builder = ExtensionTypesMgmtClientBuilder.class) +public final class ExtensionTypesMgmtClientImpl implements ExtensionTypesMgmtClient { + /** + * 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 ExtensionTypesClient object to access its operations. + */ + private final ExtensionTypesClient extensionTypes; + + /** + * Gets the ExtensionTypesClient object to access its operations. + * + * @return the ExtensionTypesClient object. + */ + public ExtensionTypesClient getExtensionTypes() { + return this.extensionTypes; + } + + /** + * Initializes an instance of ExtensionTypesMgmtClient 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. + */ + ExtensionTypesMgmtClientImpl(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 = "2024-11-01-preview"; + this.extensionTypes = new ExtensionTypesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @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 SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExtensionTypesMgmtClientImpl.class); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ResourceManagerUtils.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..e2806b829114 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/VersionForReleaseTrainImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/VersionForReleaseTrainImpl.java new file mode 100644 index 000000000000..76ed89a9fffb --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/VersionForReleaseTrainImpl.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.kubernetesconfiguration.extensiontypes.implementation; + +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.VersionForReleaseTrainInner; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrain; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrainProperties; + +public final class VersionForReleaseTrainImpl implements VersionForReleaseTrain { + private VersionForReleaseTrainInner innerObject; + + private final com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager serviceManager; + + VersionForReleaseTrainImpl(VersionForReleaseTrainInner innerObject, + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VersionForReleaseTrainProperties properties() { + return this.innerModel().properties(); + } + + public VersionForReleaseTrainInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/package-info.java new file mode 100644 index 000000000000..be3efb7377c5 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for ExtensionTypesMgmtClient. + * KubernetesConfiguration Extension Types Client. + */ +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.implementation; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ClusterScopeSettings.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ClusterScopeSettings.java new file mode 100644 index 000000000000..3b68aca93752 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ClusterScopeSettings.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ClusterScopeSettingsProperties; +import java.io.IOException; + +/** + * Extension scope settings. + */ +@Fluent +public final class ClusterScopeSettings extends ProxyResource { + /* + * Extension scope settings + */ + private ClusterScopeSettingsProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ClusterScopeSettings class. + */ + public ClusterScopeSettings() { + } + + /** + * Get the innerProperties property: Extension scope settings. + * + * @return the innerProperties value. + */ + private ClusterScopeSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @return the allowMultipleInstances value. + */ + public Boolean allowMultipleInstances() { + return this.innerProperties() == null ? null : this.innerProperties().allowMultipleInstances(); + } + + /** + * Set the allowMultipleInstances property: Describes if multiple instances of the extension are allowed. + * + * @param allowMultipleInstances the allowMultipleInstances value to set. + * @return the ClusterScopeSettings object itself. + */ + public ClusterScopeSettings withAllowMultipleInstances(Boolean allowMultipleInstances) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterScopeSettingsProperties(); + } + this.innerProperties().withAllowMultipleInstances(allowMultipleInstances); + return this; + } + + /** + * Get the defaultReleaseNamespace property: Default extension release namespace. + * + * @return the defaultReleaseNamespace value. + */ + public String defaultReleaseNamespace() { + return this.innerProperties() == null ? null : this.innerProperties().defaultReleaseNamespace(); + } + + /** + * Set the defaultReleaseNamespace property: Default extension release namespace. + * + * @param defaultReleaseNamespace the defaultReleaseNamespace value to set. + * @return the ClusterScopeSettings object itself. + */ + public ClusterScopeSettings withDefaultReleaseNamespace(String defaultReleaseNamespace) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterScopeSettingsProperties(); + } + this.innerProperties().withDefaultReleaseNamespace(defaultReleaseNamespace); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterScopeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterScopeSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClusterScopeSettings. + */ + public static ClusterScopeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterScopeSettings deserializedClusterScopeSettings = new ClusterScopeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterScopeSettings.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterScopeSettings.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterScopeSettings.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterScopeSettings.innerProperties = ClusterScopeSettingsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterScopeSettings; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionType.java new file mode 100644 index 000000000000..1622e1e072b2 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ExtensionTypeInner; + +/** + * An immutable client-side representation of ExtensionType. + */ +public interface ExtensionType { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The properties property. + * + * @return the properties value. + */ + ExtensionTypeProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ExtensionTypeInner + * object. + * + * @return the inner object. + */ + ExtensionTypeInner innerModel(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypeProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypeProperties.java new file mode 100644 index 000000000000..38403d2272c0 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypeProperties.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The ExtensionTypeProperties model. + */ +@Fluent +public final class ExtensionTypeProperties implements JsonSerializable { + /* + * Is this Extension Type a system extension. + */ + private Boolean isSystemExtension; + + /* + * Should an identity for this cluster resource be created + */ + private Boolean isManagedIdentityRequired; + + /* + * Description of the extension type + */ + private String description; + + /* + * Name of the publisher for the Extension Type + */ + private String publisher; + + /* + * Plan information only for the Marketplace Extension Type. + */ + private ExtensionTypePropertiesPlanInfo planInfo; + + /* + * Cluster Types supported for this Extension Type. + */ + private List supportedClusterTypes; + + /* + * Supported Kubernetes Scopes for this Extension Type. + */ + private ExtensionTypePropertiesSupportedScopes supportedScopes; + + /** + * Creates an instance of ExtensionTypeProperties class. + */ + public ExtensionTypeProperties() { + } + + /** + * Get the isSystemExtension property: Is this Extension Type a system extension. + * + * @return the isSystemExtension value. + */ + public Boolean isSystemExtension() { + return this.isSystemExtension; + } + + /** + * Set the isSystemExtension property: Is this Extension Type a system extension. + * + * @param isSystemExtension the isSystemExtension value to set. + * @return the ExtensionTypeProperties object itself. + */ + public ExtensionTypeProperties withIsSystemExtension(Boolean isSystemExtension) { + this.isSystemExtension = isSystemExtension; + return this; + } + + /** + * Get the isManagedIdentityRequired property: Should an identity for this cluster resource be created. + * + * @return the isManagedIdentityRequired value. + */ + public Boolean isManagedIdentityRequired() { + return this.isManagedIdentityRequired; + } + + /** + * Set the isManagedIdentityRequired property: Should an identity for this cluster resource be created. + * + * @param isManagedIdentityRequired the isManagedIdentityRequired value to set. + * @return the ExtensionTypeProperties object itself. + */ + public ExtensionTypeProperties withIsManagedIdentityRequired(Boolean isManagedIdentityRequired) { + this.isManagedIdentityRequired = isManagedIdentityRequired; + return this; + } + + /** + * Get the description property: Description of the extension type. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the extension type. + * + * @param description the description value to set. + * @return the ExtensionTypeProperties object itself. + */ + public ExtensionTypeProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the publisher property: Name of the publisher for the Extension Type. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Name of the publisher for the Extension Type. + * + * @param publisher the publisher value to set. + * @return the ExtensionTypeProperties object itself. + */ + public ExtensionTypeProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the planInfo property: Plan information only for the Marketplace Extension Type. + * + * @return the planInfo value. + */ + public ExtensionTypePropertiesPlanInfo planInfo() { + return this.planInfo; + } + + /** + * Set the planInfo property: Plan information only for the Marketplace Extension Type. + * + * @param planInfo the planInfo value to set. + * @return the ExtensionTypeProperties object itself. + */ + public ExtensionTypeProperties withPlanInfo(ExtensionTypePropertiesPlanInfo planInfo) { + this.planInfo = planInfo; + return this; + } + + /** + * Get the supportedClusterTypes property: Cluster Types supported for this Extension Type. + * + * @return the supportedClusterTypes value. + */ + public List supportedClusterTypes() { + return this.supportedClusterTypes; + } + + /** + * Set the supportedClusterTypes property: Cluster Types supported for this Extension Type. + * + * @param supportedClusterTypes the supportedClusterTypes value to set. + * @return the ExtensionTypeProperties object itself. + */ + public ExtensionTypeProperties withSupportedClusterTypes(List supportedClusterTypes) { + this.supportedClusterTypes = supportedClusterTypes; + return this; + } + + /** + * Get the supportedScopes property: Supported Kubernetes Scopes for this Extension Type. + * + * @return the supportedScopes value. + */ + public ExtensionTypePropertiesSupportedScopes supportedScopes() { + return this.supportedScopes; + } + + /** + * Set the supportedScopes property: Supported Kubernetes Scopes for this Extension Type. + * + * @param supportedScopes the supportedScopes value to set. + * @return the ExtensionTypeProperties object itself. + */ + public ExtensionTypeProperties withSupportedScopes(ExtensionTypePropertiesSupportedScopes supportedScopes) { + this.supportedScopes = supportedScopes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (planInfo() != null) { + planInfo().validate(); + } + if (supportedScopes() != null) { + supportedScopes().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isSystemExtension", this.isSystemExtension); + jsonWriter.writeBooleanField("isManagedIdentityRequired", this.isManagedIdentityRequired); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeJsonField("planInfo", this.planInfo); + jsonWriter.writeArrayField("supportedClusterTypes", this.supportedClusterTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("supportedScopes", this.supportedScopes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionTypeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionTypeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtensionTypeProperties. + */ + public static ExtensionTypeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionTypeProperties deserializedExtensionTypeProperties = new ExtensionTypeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isSystemExtension".equals(fieldName)) { + deserializedExtensionTypeProperties.isSystemExtension = reader.getNullable(JsonReader::getBoolean); + } else if ("isManagedIdentityRequired".equals(fieldName)) { + deserializedExtensionTypeProperties.isManagedIdentityRequired + = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedExtensionTypeProperties.description = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedExtensionTypeProperties.publisher = reader.getString(); + } else if ("planInfo".equals(fieldName)) { + deserializedExtensionTypeProperties.planInfo = ExtensionTypePropertiesPlanInfo.fromJson(reader); + } else if ("supportedClusterTypes".equals(fieldName)) { + List supportedClusterTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedExtensionTypeProperties.supportedClusterTypes = supportedClusterTypes; + } else if ("supportedScopes".equals(fieldName)) { + deserializedExtensionTypeProperties.supportedScopes + = ExtensionTypePropertiesSupportedScopes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionTypeProperties; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypePropertiesPlanInfo.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypePropertiesPlanInfo.java new file mode 100644 index 000000000000..28cd670ea184 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypePropertiesPlanInfo.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Plan information only for the Marketplace Extension Type. + */ +@Fluent +public final class ExtensionTypePropertiesPlanInfo implements JsonSerializable { + /* + * Publisher ID of the Marketplace Extension Type. + */ + private String publisherId; + + /* + * Plan ID of the Marketplace Extension Type. + */ + private String planId; + + /* + * Offer or Product ID of the Marketplace Extension Type. + */ + private String offerId; + + /** + * Creates an instance of ExtensionTypePropertiesPlanInfo class. + */ + public ExtensionTypePropertiesPlanInfo() { + } + + /** + * Get the publisherId property: Publisher ID of the Marketplace Extension Type. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Publisher ID of the Marketplace Extension Type. + * + * @param publisherId the publisherId value to set. + * @return the ExtensionTypePropertiesPlanInfo object itself. + */ + public ExtensionTypePropertiesPlanInfo withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the planId property: Plan ID of the Marketplace Extension Type. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: Plan ID of the Marketplace Extension Type. + * + * @param planId the planId value to set. + * @return the ExtensionTypePropertiesPlanInfo object itself. + */ + public ExtensionTypePropertiesPlanInfo withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the offerId property: Offer or Product ID of the Marketplace Extension Type. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: Offer or Product ID of the Marketplace Extension Type. + * + * @param offerId the offerId value to set. + * @return the ExtensionTypePropertiesPlanInfo object itself. + */ + public ExtensionTypePropertiesPlanInfo withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("offerId", this.offerId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionTypePropertiesPlanInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionTypePropertiesPlanInfo if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtensionTypePropertiesPlanInfo. + */ + public static ExtensionTypePropertiesPlanInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionTypePropertiesPlanInfo deserializedExtensionTypePropertiesPlanInfo + = new ExtensionTypePropertiesPlanInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisherId".equals(fieldName)) { + deserializedExtensionTypePropertiesPlanInfo.publisherId = reader.getString(); + } else if ("planId".equals(fieldName)) { + deserializedExtensionTypePropertiesPlanInfo.planId = reader.getString(); + } else if ("offerId".equals(fieldName)) { + deserializedExtensionTypePropertiesPlanInfo.offerId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionTypePropertiesPlanInfo; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypePropertiesSupportedScopes.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypePropertiesSupportedScopes.java new file mode 100644 index 000000000000..36fb95903bd5 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypePropertiesSupportedScopes.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Supported Kubernetes Scopes for this Extension Type. + */ +@Fluent +public final class ExtensionTypePropertiesSupportedScopes + implements JsonSerializable { + /* + * The default scope of the extension type. This scope will be used if the user does not provide a scope while + * creating an extension. + */ + private String defaultScope; + + /* + * Extension scope settings + */ + private ClusterScopeSettings clusterScopeSettings; + + /** + * Creates an instance of ExtensionTypePropertiesSupportedScopes class. + */ + public ExtensionTypePropertiesSupportedScopes() { + } + + /** + * Get the defaultScope property: The default scope of the extension type. This scope will be used if the user does + * not provide a scope while creating an extension. + * + * @return the defaultScope value. + */ + public String defaultScope() { + return this.defaultScope; + } + + /** + * Set the defaultScope property: The default scope of the extension type. This scope will be used if the user does + * not provide a scope while creating an extension. + * + * @param defaultScope the defaultScope value to set. + * @return the ExtensionTypePropertiesSupportedScopes object itself. + */ + public ExtensionTypePropertiesSupportedScopes withDefaultScope(String defaultScope) { + this.defaultScope = defaultScope; + return this; + } + + /** + * Get the clusterScopeSettings property: Extension scope settings. + * + * @return the clusterScopeSettings value. + */ + public ClusterScopeSettings clusterScopeSettings() { + return this.clusterScopeSettings; + } + + /** + * Set the clusterScopeSettings property: Extension scope settings. + * + * @param clusterScopeSettings the clusterScopeSettings value to set. + * @return the ExtensionTypePropertiesSupportedScopes object itself. + */ + public ExtensionTypePropertiesSupportedScopes withClusterScopeSettings(ClusterScopeSettings clusterScopeSettings) { + this.clusterScopeSettings = clusterScopeSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterScopeSettings() != null) { + clusterScopeSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultScope", this.defaultScope); + jsonWriter.writeJsonField("clusterScopeSettings", this.clusterScopeSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionTypePropertiesSupportedScopes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionTypePropertiesSupportedScopes if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtensionTypePropertiesSupportedScopes. + */ + public static ExtensionTypePropertiesSupportedScopes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionTypePropertiesSupportedScopes deserializedExtensionTypePropertiesSupportedScopes + = new ExtensionTypePropertiesSupportedScopes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultScope".equals(fieldName)) { + deserializedExtensionTypePropertiesSupportedScopes.defaultScope = reader.getString(); + } else if ("clusterScopeSettings".equals(fieldName)) { + deserializedExtensionTypePropertiesSupportedScopes.clusterScopeSettings + = ClusterScopeSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionTypePropertiesSupportedScopes; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypeVersionsList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypeVersionsList.java new file mode 100644 index 000000000000..dfff3494a4db --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypeVersionsList.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.VersionForReleaseTrainInner; +import java.io.IOException; +import java.util.List; + +/** + * List Extension Type Versions. It contains a list of ExtensionTypeVersionForReleaseTrain objects. + */ +@Immutable +public final class ExtensionTypeVersionsList implements JsonSerializable { + /* + * List of Extension Type Versions for an Extension Type in a Release Train. + */ + private List value; + + /* + * URL to get the next set of extension objects, if any. + */ + private String nextLink; + + /** + * Creates an instance of ExtensionTypeVersionsList class. + */ + public ExtensionTypeVersionsList() { + } + + /** + * Get the value property: List of Extension Type Versions for an Extension Type in a Release Train. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of extension objects, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionTypeVersionsList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionTypeVersionsList if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtensionTypeVersionsList. + */ + public static ExtensionTypeVersionsList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionTypeVersionsList deserializedExtensionTypeVersionsList = new ExtensionTypeVersionsList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VersionForReleaseTrainInner.fromJson(reader1)); + deserializedExtensionTypeVersionsList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExtensionTypeVersionsList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionTypeVersionsList; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypes.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypes.java new file mode 100644 index 000000000000..2dccaf1b2933 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypes.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.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 ExtensionTypes. + */ +public interface ExtensionTypes { + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable locationList(String location); + + /** + * List all Extension Types for the location. + * + * @param location The name of Azure region. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @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 list Extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable locationList(String location, String publisherId, String offerId, String planId, + String releaseTrain, String clusterType, Context context); + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @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 an extension type for the location along with {@link Response}. + */ + Response locationGetWithResponse(String location, String extensionTypeName, Context context); + + /** + * Get an extension type for the location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extension type for the location. + */ + ExtensionType locationGet(String location, String extensionTypeName); + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listVersions(String location, String extensionTypeName); + + /** + * List the versions for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param clusterType Filter results by the cluster type for extension types. + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @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 list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listVersions(String location, String extensionTypeName, String releaseTrain, + String clusterType, String majorVersion, Boolean showLatest, Context context); + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @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 details of a version for an extension type and location along with {@link Response}. + */ + Response getVersionWithResponse(String location, String extensionTypeName, + String versionNumber, Context context); + + /** + * Get details of a version for an extension type and location. + * + * @param location The name of Azure region. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an extension type and location. + */ + VersionForReleaseTrain getVersion(String location, String extensionTypeName, String versionNumber); + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes 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 list Extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName); + + /** + * List installable Extension Types for the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param publisherId Filter results by Publisher ID of a marketplace extension type. + * @param offerId Filter results by Offer or Product ID of a marketplace extension type. + * @param planId Filter results by Plan ID of a marketplace extension type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Types as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String publisherId, String offerId, String planId, String releaseTrain, Context context); + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @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 an Extension Type installable to the cluster based region and type for the cluster along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String extensionTypeName, Context context); + + /** + * Get an Extension Type installable to the cluster based region and type for the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Extension Type installable to the cluster based region and type for the cluster. + */ + ExtensionType get(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, + String extensionTypeName); + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName); + + /** + * List the version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param releaseTrain Filter results by release train (default value is stable). + * @param majorVersion Filter results by the major version of an extension type. + * @param showLatest Filter results by only the latest version (based on other query parameters). + * @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 list Extension Type Versions as paginated response with {@link PagedIterable}. + */ + PagedIterable clusterListVersions(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String releaseTrain, + String majorVersion, Boolean showLatest, Context context); + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @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 details of a version for an Extension Type installable to the cluster along with {@link Response}. + */ + Response clusterGetVersionWithResponse(String resourceGroupName, String clusterRp, + String clusterResourceName, String clusterName, String extensionTypeName, String versionNumber, + Context context); + + /** + * Get details of a version for an Extension Type installable to the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterRp The Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, + * Microsoft.HybridContainerService. + * @param clusterResourceName The Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, + * provisionedClusters, appliances. + * @param clusterName The name of the kubernetes cluster. + * @param extensionTypeName Name of the Extension Type. + * @param versionNumber Version number of the Extension Type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of a version for an Extension Type installable to the cluster. + */ + VersionForReleaseTrain clusterGetVersion(String resourceGroupName, String clusterRp, String clusterResourceName, + String clusterName, String extensionTypeName, String versionNumber); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypesList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypesList.java new file mode 100644 index 000000000000..bf0cb454d6e7 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/ExtensionTypesList.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.ExtensionTypeInner; +import java.io.IOException; +import java.util.List; + +/** + * List Extension Types. It contains a list of ExtensionType objects and a URL link to get the next set of results. + */ +@Immutable +public final class ExtensionTypesList implements JsonSerializable { + /* + * List of Extension Types. + */ + private List value; + + /* + * URL to get the next set of extension type objects, if any. + */ + private String nextLink; + + /** + * Creates an instance of ExtensionTypesList class. + */ + public ExtensionTypesList() { + } + + /** + * Get the value property: List of Extension Types. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of extension type objects, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtensionTypesList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtensionTypesList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtensionTypesList. + */ + public static ExtensionTypesList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtensionTypesList deserializedExtensionTypesList = new ExtensionTypesList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ExtensionTypeInner.fromJson(reader1)); + deserializedExtensionTypesList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExtensionTypesList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExtensionTypesList; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/UnsupportedKubernetesMatrixItem.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/UnsupportedKubernetesMatrixItem.java new file mode 100644 index 000000000000..e61d93dfd02e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/UnsupportedKubernetesMatrixItem.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The list of Kubernetes Distribution and Versions that are not supported by this version of this Extension Type. + */ +@Fluent +public final class UnsupportedKubernetesMatrixItem implements JsonSerializable { + /* + * The list of Kubernetes Cluster Distribution Names not supported + */ + private List distributions; + + /* + * The list of Kubernetes Versions not supported by the list of Kubernetes Cluster Distribution names in this object + */ + private List unsupportedVersions; + + /** + * Creates an instance of UnsupportedKubernetesMatrixItem class. + */ + public UnsupportedKubernetesMatrixItem() { + } + + /** + * Get the distributions property: The list of Kubernetes Cluster Distribution Names not supported. + * + * @return the distributions value. + */ + public List distributions() { + return this.distributions; + } + + /** + * Set the distributions property: The list of Kubernetes Cluster Distribution Names not supported. + * + * @param distributions the distributions value to set. + * @return the UnsupportedKubernetesMatrixItem object itself. + */ + public UnsupportedKubernetesMatrixItem withDistributions(List distributions) { + this.distributions = distributions; + return this; + } + + /** + * Get the unsupportedVersions property: The list of Kubernetes Versions not supported by the list of Kubernetes + * Cluster Distribution names in this object. + * + * @return the unsupportedVersions value. + */ + public List unsupportedVersions() { + return this.unsupportedVersions; + } + + /** + * Set the unsupportedVersions property: The list of Kubernetes Versions not supported by the list of Kubernetes + * Cluster Distribution names in this object. + * + * @param unsupportedVersions the unsupportedVersions value to set. + * @return the UnsupportedKubernetesMatrixItem object itself. + */ + public UnsupportedKubernetesMatrixItem withUnsupportedVersions(List unsupportedVersions) { + this.unsupportedVersions = unsupportedVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("distributions", this.distributions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("unsupportedVersions", this.unsupportedVersions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnsupportedKubernetesMatrixItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnsupportedKubernetesMatrixItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UnsupportedKubernetesMatrixItem. + */ + public static UnsupportedKubernetesMatrixItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnsupportedKubernetesMatrixItem deserializedUnsupportedKubernetesMatrixItem + = new UnsupportedKubernetesMatrixItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("distributions".equals(fieldName)) { + List distributions = reader.readArray(reader1 -> reader1.getString()); + deserializedUnsupportedKubernetesMatrixItem.distributions = distributions; + } else if ("unsupportedVersions".equals(fieldName)) { + List unsupportedVersions = reader.readArray(reader1 -> reader1.getString()); + deserializedUnsupportedKubernetesMatrixItem.unsupportedVersions = unsupportedVersions; + } else { + reader.skipChildren(); + } + } + + return deserializedUnsupportedKubernetesMatrixItem; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/UnsupportedKubernetesVersions.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/UnsupportedKubernetesVersions.java new file mode 100644 index 000000000000..78483beebcdf --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/UnsupportedKubernetesVersions.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The list of supported Kubernetes cluster versions for this extension type. + */ +@Fluent +public final class UnsupportedKubernetesVersions implements JsonSerializable { + /* + * The connectedCluster property. + */ + private List connectedCluster; + + /* + * The appliances property. + */ + private List appliances; + + /* + * The provisionedCluster property. + */ + private List provisionedCluster; + + /* + * The managedCluster property. + */ + private List managedCluster; + + /** + * Creates an instance of UnsupportedKubernetesVersions class. + */ + public UnsupportedKubernetesVersions() { + } + + /** + * Get the connectedCluster property: The connectedCluster property. + * + * @return the connectedCluster value. + */ + public List connectedCluster() { + return this.connectedCluster; + } + + /** + * Set the connectedCluster property: The connectedCluster property. + * + * @param connectedCluster the connectedCluster value to set. + * @return the UnsupportedKubernetesVersions object itself. + */ + public UnsupportedKubernetesVersions withConnectedCluster(List connectedCluster) { + this.connectedCluster = connectedCluster; + return this; + } + + /** + * Get the appliances property: The appliances property. + * + * @return the appliances value. + */ + public List appliances() { + return this.appliances; + } + + /** + * Set the appliances property: The appliances property. + * + * @param appliances the appliances value to set. + * @return the UnsupportedKubernetesVersions object itself. + */ + public UnsupportedKubernetesVersions withAppliances(List appliances) { + this.appliances = appliances; + return this; + } + + /** + * Get the provisionedCluster property: The provisionedCluster property. + * + * @return the provisionedCluster value. + */ + public List provisionedCluster() { + return this.provisionedCluster; + } + + /** + * Set the provisionedCluster property: The provisionedCluster property. + * + * @param provisionedCluster the provisionedCluster value to set. + * @return the UnsupportedKubernetesVersions object itself. + */ + public UnsupportedKubernetesVersions + withProvisionedCluster(List provisionedCluster) { + this.provisionedCluster = provisionedCluster; + return this; + } + + /** + * Get the managedCluster property: The managedCluster property. + * + * @return the managedCluster value. + */ + public List managedCluster() { + return this.managedCluster; + } + + /** + * Set the managedCluster property: The managedCluster property. + * + * @param managedCluster the managedCluster value to set. + * @return the UnsupportedKubernetesVersions object itself. + */ + public UnsupportedKubernetesVersions withManagedCluster(List managedCluster) { + this.managedCluster = managedCluster; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectedCluster() != null) { + connectedCluster().forEach(e -> e.validate()); + } + if (appliances() != null) { + appliances().forEach(e -> e.validate()); + } + if (provisionedCluster() != null) { + provisionedCluster().forEach(e -> e.validate()); + } + if (managedCluster() != null) { + managedCluster().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("connectedCluster", this.connectedCluster, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("appliances", this.appliances, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("provisionedCluster", this.provisionedCluster, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("managedCluster", this.managedCluster, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnsupportedKubernetesVersions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnsupportedKubernetesVersions if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UnsupportedKubernetesVersions. + */ + public static UnsupportedKubernetesVersions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnsupportedKubernetesVersions deserializedUnsupportedKubernetesVersions + = new UnsupportedKubernetesVersions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectedCluster".equals(fieldName)) { + List connectedCluster + = reader.readArray(reader1 -> UnsupportedKubernetesMatrixItem.fromJson(reader1)); + deserializedUnsupportedKubernetesVersions.connectedCluster = connectedCluster; + } else if ("appliances".equals(fieldName)) { + List appliances + = reader.readArray(reader1 -> UnsupportedKubernetesMatrixItem.fromJson(reader1)); + deserializedUnsupportedKubernetesVersions.appliances = appliances; + } else if ("provisionedCluster".equals(fieldName)) { + List provisionedCluster + = reader.readArray(reader1 -> UnsupportedKubernetesMatrixItem.fromJson(reader1)); + deserializedUnsupportedKubernetesVersions.provisionedCluster = provisionedCluster; + } else if ("managedCluster".equals(fieldName)) { + List managedCluster + = reader.readArray(reader1 -> UnsupportedKubernetesMatrixItem.fromJson(reader1)); + deserializedUnsupportedKubernetesVersions.managedCluster = managedCluster; + } else { + reader.skipChildren(); + } + } + + return deserializedUnsupportedKubernetesVersions; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/VersionForReleaseTrain.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/VersionForReleaseTrain.java new file mode 100644 index 000000000000..89dcbcc09a1f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/VersionForReleaseTrain.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.kubernetesconfiguration.extensiontypes.models; + +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.VersionForReleaseTrainInner; + +/** + * An immutable client-side representation of VersionForReleaseTrain. + */ +public interface VersionForReleaseTrain { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The properties property. + * + * @return the properties value. + */ + VersionForReleaseTrainProperties properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models.VersionForReleaseTrainInner + * object. + * + * @return the inner object. + */ + VersionForReleaseTrainInner innerModel(); +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/VersionForReleaseTrainProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/VersionForReleaseTrainProperties.java new file mode 100644 index 000000000000..45862e64871f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/VersionForReleaseTrainProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The VersionForReleaseTrainProperties model. + */ +@Fluent +public final class VersionForReleaseTrainProperties implements JsonSerializable { + /* + * The version number for the extension type + */ + private String version; + + /* + * The list of supported Kubernetes cluster versions for this extension type + */ + private UnsupportedKubernetesVersions unsupportedKubernetesVersions; + + /* + * A list of supported cluster types for this version of the Extension Type + */ + private List supportedClusterTypes; + + /** + * Creates an instance of VersionForReleaseTrainProperties class. + */ + public VersionForReleaseTrainProperties() { + } + + /** + * Get the version property: The version number for the extension type. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version number for the extension type. + * + * @param version the version value to set. + * @return the VersionForReleaseTrainProperties object itself. + */ + public VersionForReleaseTrainProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the unsupportedKubernetesVersions property: The list of supported Kubernetes cluster versions for this + * extension type. + * + * @return the unsupportedKubernetesVersions value. + */ + public UnsupportedKubernetesVersions unsupportedKubernetesVersions() { + return this.unsupportedKubernetesVersions; + } + + /** + * Set the unsupportedKubernetesVersions property: The list of supported Kubernetes cluster versions for this + * extension type. + * + * @param unsupportedKubernetesVersions the unsupportedKubernetesVersions value to set. + * @return the VersionForReleaseTrainProperties object itself. + */ + public VersionForReleaseTrainProperties + withUnsupportedKubernetesVersions(UnsupportedKubernetesVersions unsupportedKubernetesVersions) { + this.unsupportedKubernetesVersions = unsupportedKubernetesVersions; + return this; + } + + /** + * Get the supportedClusterTypes property: A list of supported cluster types for this version of the Extension Type. + * + * @return the supportedClusterTypes value. + */ + public List supportedClusterTypes() { + return this.supportedClusterTypes; + } + + /** + * Set the supportedClusterTypes property: A list of supported cluster types for this version of the Extension Type. + * + * @param supportedClusterTypes the supportedClusterTypes value to set. + * @return the VersionForReleaseTrainProperties object itself. + */ + public VersionForReleaseTrainProperties withSupportedClusterTypes(List supportedClusterTypes) { + this.supportedClusterTypes = supportedClusterTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (unsupportedKubernetesVersions() != null) { + unsupportedKubernetesVersions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeJsonField("unsupportedKubernetesVersions", this.unsupportedKubernetesVersions); + jsonWriter.writeArrayField("supportedClusterTypes", this.supportedClusterTypes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VersionForReleaseTrainProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VersionForReleaseTrainProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VersionForReleaseTrainProperties. + */ + public static VersionForReleaseTrainProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VersionForReleaseTrainProperties deserializedVersionForReleaseTrainProperties + = new VersionForReleaseTrainProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedVersionForReleaseTrainProperties.version = reader.getString(); + } else if ("unsupportedKubernetesVersions".equals(fieldName)) { + deserializedVersionForReleaseTrainProperties.unsupportedKubernetesVersions + = UnsupportedKubernetesVersions.fromJson(reader); + } else if ("supportedClusterTypes".equals(fieldName)) { + List supportedClusterTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedVersionForReleaseTrainProperties.supportedClusterTypes = supportedClusterTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedVersionForReleaseTrainProperties; + }); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/package-info.java new file mode 100644 index 000000000000..46276afe1358 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for ExtensionTypesMgmtClient. + * KubernetesConfiguration Extension Types Client. + */ +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/package-info.java new file mode 100644 index 000000000000..44c6159005e0 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for ExtensionTypesMgmtClient. + * KubernetesConfiguration Extension Types Client. + */ +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/module-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/module-info.java new file mode 100644 index 000000000000..ed79005a17cb --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.kubernetesconfiguration.extensiontypes { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.kubernetesconfiguration.extensiontypes; + exports com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent; + exports com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models; + exports com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models; + + opens com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.fluent.models to com.azure.core; + opens com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models to com.azure.core; +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/kubernetesconfiguration-extensiontypes/proxy-config.json b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/kubernetesconfiguration-extensiontypes/proxy-config.json new file mode 100644 index 000000000000..4a67a4ec6ab5 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/kubernetesconfiguration-extensiontypes/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.implementation.ExtensionTypesClientImpl$ExtensionTypesService"]] \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/kubernetesconfiguration-extensiontypes/reflect-config.json b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/kubernetesconfiguration-extensiontypes/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/META-INF/native-image/com.azure.resourcemanager/kubernetesconfiguration-extensiontypes/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/azure-resourcemanager-kubernetesconfiguration-extensiontypes.properties b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/azure-resourcemanager-kubernetesconfiguration-extensiontypes.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/main/resources/azure-resourcemanager-kubernetesconfiguration-extensiontypes.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterGetVersiSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterGetVersiSamples.java new file mode 100644 index 000000000000..b24b192c80ad --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterGetVersiSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes ClusterGetVersion. + */ +public final class ExtensionTypesClusterGetVersiSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionTypeVersion.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .clusterGetVersionWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", + "my-extension-type", "v1.3.2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterListVersSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterListVersSamples.java new file mode 100644 index 000000000000..804561451a9d --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterListVersSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes ClusterListVersions. + */ +public final class ExtensionTypesClusterListVersSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypeVersions.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .clusterListVersions("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", "my-extension-type", + "stable", "2", true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetSamples.java new file mode 100644 index 000000000000..418882f4f0fe --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes Get. + */ +public final class ExtensionTypesGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionType.json + */ + /** + * Sample code: Get Extension Types. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void getExtensionTypes( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .getWithResponse("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", "my-extension-type", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetVersionSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetVersionSamples.java new file mode 100644 index 000000000000..e163607094fc --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetVersionSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes GetVersion. + */ +public final class ExtensionTypesGetVersionSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionTypeVersionByLocation.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .getVersionWithResponse("westus", "extensionType1", "1.20.0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListSamples.java new file mode 100644 index 000000000000..303519f1698e --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes List. + */ +public final class ExtensionTypesListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypes.json + */ + /** + * Sample code: Get Extension Types. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void getExtensionTypes( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .list("rg1", "Microsoft.Kubernetes", "connectedClusters", "my-cluster", "myPublisherId", "myOfferId", + "myPlanId", "stable", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListVersionsSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListVersionsSamples.java new file mode 100644 index 000000000000..334fd966cee2 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListVersionsSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes ListVersions. + */ +public final class ExtensionTypesListVersionsSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypeVersionsByLocation.json + */ + /** + * Sample code: List Extension Type Versions. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypeVersions( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .listVersions("westus", "extensionType1", "stable", "connectedCluster", "2", true, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationGetSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationGetSamples.java new file mode 100644 index 000000000000..887328e12917 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes LocationGet. + */ +public final class ExtensionTypesLocationGetSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/GetExtensionTypeByLocation.json + */ + /** + * Sample code: Get Extension Type. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void getExtensionType( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes().locationGetWithResponse("westus2", "extensionType1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationListSamples.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationListSamples.java new file mode 100644 index 000000000000..2e7cd10b0de4 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/samples/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +/** + * Samples for ExtensionTypes LocationList. + */ +public final class ExtensionTypesLocationListSamples { + /* + * x-ms-original-file: + * specification/kubernetesconfiguration/resource-manager/Microsoft.KubernetesConfiguration/extensionTypes/preview/ + * 2024-11-01-preview/examples/ListExtensionTypesByLocation.json + */ + /** + * Sample code: List Extension Types. + * + * @param manager Entry point to ExtensionTypesManager. + */ + public static void listExtensionTypes( + com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager manager) { + manager.extensionTypes() + .locationList("westus2", "myPublisherId", "myOfferId", "myPlanId", "stable", "connectedCluster", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterGetVersioMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterGetVersioMockTests.java new file mode 100644 index 000000000000..04c77a36a86f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterGetVersioMockTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrain; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesClusterGetVersioMockTests { + @Test + public void testClusterGetVersionWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"version\":\"vqtmnub\",\"unsupportedKubernetesVersions\":{\"connectedCluster\":[{\"distributions\":[\"smond\",\"mquxvypo\"],\"unsupportedVersions\":[\"opkwhojv\",\"ajqgxy\",\"mocmbqfqvmk\",\"xozap\"]}],\"appliances\":[{\"distributions\":[\"prglya\",\"dd\",\"kcbcue\"],\"unsupportedVersions\":[\"xgc\",\"qibrhosxsdqrhzoy\",\"i\"]},{\"distributions\":[\"qyib\"],\"unsupportedVersions\":[\"fluszdtm\",\"rkwofyyvoqa\"]},{\"distributions\":[\"expbtg\",\"wbwo\",\"nwashrtd\"],\"unsupportedVersions\":[\"nqxwbp\",\"kulpiujwaasi\",\"qiiobyuqer\",\"qlpqwcciuq\"]},{\"distributions\":[\"butauvfb\",\"kuwhh\",\"hykojoxafnndlpic\",\"koymkcd\"],\"unsupportedVersions\":[\"pkkpw\",\"reqnovvqfov\",\"jxywsuws\"]}],\"provisionedCluster\":[{\"distributions\":[\"sytgadgvraea\",\"neqn\",\"arrwlquu\"],\"unsupportedVersions\":[\"qkacewii\"]}],\"managedCluster\":[{\"distributions\":[\"ji\",\"wwiftohqkvpuv\",\"sgplsakn\"],\"unsupportedVersions\":[\"synljphuopxodl\",\"iyntorzihle\",\"sjswsrms\"]},{\"distributions\":[\"rpzbchckqqzqi\",\"xiy\"],\"unsupportedVersions\":[\"i\",\"ynkedyatrwyhqmib\",\"yhwitsmypyynpcdp\",\"mnzgmwznmabi\"]}]},\"supportedClusterTypes\":[\"orgjhxbldt\",\"wwrlkdmtncv\"]},\"id\":\"kotl\",\"name\":\"xdy\",\"type\":\"gsyocogj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + VersionForReleaseTrain response = manager.extensionTypes() + .clusterGetVersionWithResponse("mgxcxrslpm", "twuoegrpkhjwni", "qsluicp", "ggkzzlvmbmpa", + "modfvuefywsbpfvm", "yhrfouyftaakcpw", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("vqtmnub", response.properties().version()); + Assertions.assertEquals("smond", + response.properties().unsupportedKubernetesVersions().connectedCluster().get(0).distributions().get(0)); + Assertions.assertEquals("opkwhojv", + response.properties() + .unsupportedKubernetesVersions() + .connectedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("prglya", + response.properties().unsupportedKubernetesVersions().appliances().get(0).distributions().get(0)); + Assertions.assertEquals("xgc", + response.properties().unsupportedKubernetesVersions().appliances().get(0).unsupportedVersions().get(0)); + Assertions.assertEquals("sytgadgvraea", + response.properties().unsupportedKubernetesVersions().provisionedCluster().get(0).distributions().get(0)); + Assertions.assertEquals("qkacewii", + response.properties() + .unsupportedKubernetesVersions() + .provisionedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("ji", + response.properties().unsupportedKubernetesVersions().managedCluster().get(0).distributions().get(0)); + Assertions.assertEquals("synljphuopxodl", + response.properties().unsupportedKubernetesVersions().managedCluster().get(0).unsupportedVersions().get(0)); + Assertions.assertEquals("orgjhxbldt", response.properties().supportedClusterTypes().get(0)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterListVersiMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterListVersiMockTests.java new file mode 100644 index 000000000000..c8655e94954a --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesClusterListVersiMockTests.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrain; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesClusterListVersiMockTests { + @Test + public void testClusterListVersions() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"version\":\"pvjzbe\",\"unsupportedKubernetesVersions\":{\"connectedCluster\":[{\"distributions\":[\"fqqnvwpmqtaruo\",\"jmkcjhwqytj\"],\"unsupportedVersions\":[\"n\"]},{\"distributions\":[\"wgdrjervnaenqp\",\"hin\",\"oygmift\"],\"unsupportedVersions\":[\"d\",\"dslgnayqigynduh\"]},{\"distributions\":[\"qlkth\",\"maqolbgycduie\",\"tgccymvaolpss\"],\"unsupportedVersions\":[\"fmmdnbbg\",\"zpswiydmc\",\"yhz\",\"xssadbzmnvdf\"]},{\"distributions\":[\"daodvxzbncblyl\"],\"unsupportedVersions\":[\"dbh\",\"xsrz\",\"zucerscdntnev\"]}],\"appliances\":[{\"distributions\":[\"ygtdsslswt\",\"weriofzpyqsem\",\"abnetshh\"],\"unsupportedVersions\":[\"edplvwiwubmw\"]}],\"provisionedCluster\":[{\"distributions\":[\"dnkwwtppjflcxog\",\"okonzmnsikvmkqz\",\"qqkdltfzxmhhvhgu\"],\"unsupportedVersions\":[\"dkwobdagx\",\"ibqdxbxwakbogqx\"]}],\"managedCluster\":[{\"distributions\":[\"gxhuriplbp\"],\"unsupportedVersions\":[\"unkbebx\",\"ubyyntw\",\"rbqtkoie\",\"seotgqrllt\"]},{\"distributions\":[\"lauwzizxbmpgcjef\",\"zmuvpbttdumorppx\",\"bmnzbtbhjpgl\",\"fgohdneuelfphs\"],\"unsupportedVersions\":[\"t\",\"zfikd\",\"wwquuvxzxclvithh\"]},{\"distributions\":[\"nosggbhcoh\"],\"unsupportedVersions\":[\"sjnkal\",\"utiiswacf\"]},{\"distributions\":[\"k\",\"zewk\",\"vhqcrail\",\"pnppfuf\"],\"unsupportedVersions\":[\"dmhdlxyjr\",\"sag\",\"fcnihgwq\"]}]},\"supportedClusterTypes\":[\"edgfbcvkcvq\",\"pkeqdcvdrhvoo\"]},\"id\":\"sotbob\",\"name\":\"dopcjwvnh\",\"type\":\"ld\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.extensionTypes() + .clusterListVersions("bhsfxob", "ytkblmpew", "wfbkrvrns", "shqjohxcrsbf", "vasrruvwb", "sqfsubcgjbirxb", + "ybsrfbjfdtwss", false, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("pvjzbe", response.iterator().next().properties().version()); + Assertions.assertEquals("fqqnvwpmqtaruo", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .connectedCluster() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("n", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .connectedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("ygtdsslswt", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .appliances() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("edplvwiwubmw", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .appliances() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("dnkwwtppjflcxog", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .provisionedCluster() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("dkwobdagx", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .provisionedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("gxhuriplbp", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .managedCluster() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("unkbebx", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .managedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("edgfbcvkcvq", response.iterator().next().properties().supportedClusterTypes().get(0)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetVersionWithReMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetVersionWithReMockTests.java new file mode 100644 index 000000000000..c3c5e7b30797 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetVersionWithReMockTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrain; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesGetVersionWithReMockTests { + @Test + public void testGetVersionWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"version\":\"uahaquhcdhmd\",\"unsupportedKubernetesVersions\":{\"connectedCluster\":[{\"distributions\":[\"qpv\",\"adm\",\"sr\"],\"unsupportedVersions\":[\"vxpvgomz\"]}],\"appliances\":[{\"distributions\":[\"gwb\",\"b\",\"e\"],\"unsupportedVersions\":[\"wkz\"]},{\"distributions\":[\"io\",\"rqhakauha\",\"hsfwxosowzxcug\"],\"unsupportedVersions\":[\"ooxdjebwpuc\",\"wfvovbv\",\"euecivyhzceuoj\"]}],\"provisionedCluster\":[{\"distributions\":[\"ueiotwmcdyt\",\"x\",\"it\",\"nrjawgqwg\"],\"unsupportedVersions\":[\"isk\"]}],\"managedCluster\":[{\"distributions\":[\"y\"],\"unsupportedVersions\":[\"lwn\",\"nhjdauw\",\"vylwzbtdhxuj\",\"nbmpowuwprzq\"]},{\"distributions\":[\"ualupjmkh\",\"xobbcswsrt\",\"riplrbpbewtg\"],\"unsupportedVersions\":[\"blcg\",\"xzvlvqhjkbegib\",\"nmxiebwwaloayqc\"]}]},\"supportedClusterTypes\":[\"tzjuzgwyzmhtxo\",\"gmtsavjcbpwxqpsr\"]},\"id\":\"nftguvriuhpr\",\"name\":\"mdyvxqtayriw\",\"type\":\"ro\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + VersionForReleaseTrain response = manager.extensionTypes() + .getVersionWithResponse("hspkdeemao", "mx", "gkvtmelmqkrhah", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("uahaquhcdhmd", response.properties().version()); + Assertions.assertEquals("qpv", + response.properties().unsupportedKubernetesVersions().connectedCluster().get(0).distributions().get(0)); + Assertions.assertEquals("vxpvgomz", + response.properties() + .unsupportedKubernetesVersions() + .connectedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("gwb", + response.properties().unsupportedKubernetesVersions().appliances().get(0).distributions().get(0)); + Assertions.assertEquals("wkz", + response.properties().unsupportedKubernetesVersions().appliances().get(0).unsupportedVersions().get(0)); + Assertions.assertEquals("ueiotwmcdyt", + response.properties().unsupportedKubernetesVersions().provisionedCluster().get(0).distributions().get(0)); + Assertions.assertEquals("isk", + response.properties() + .unsupportedKubernetesVersions() + .provisionedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("y", + response.properties().unsupportedKubernetesVersions().managedCluster().get(0).distributions().get(0)); + Assertions.assertEquals("lwn", + response.properties().unsupportedKubernetesVersions().managedCluster().get(0).unsupportedVersions().get(0)); + Assertions.assertEquals("tzjuzgwyzmhtxo", response.properties().supportedClusterTypes().get(0)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetWithResponseMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetWithResponseMockTests.java new file mode 100644 index 000000000000..e174dcef7437 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesGetWithResponseMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"isSystemExtension\":false,\"isManagedIdentityRequired\":false,\"description\":\"wptfdy\",\"publisher\":\"fqbuaceopzf\",\"planInfo\":{\"publisherId\":\"huaoppp\",\"planId\":\"eqx\",\"offerId\":\"z\"},\"supportedClusterTypes\":[\"zxctobgb\",\"dmoizpostmg\"],\"supportedScopes\":{\"defaultScope\":\"bunrmfqjhhk\",\"clusterScopeSettings\":{\"properties\":{\"allowMultipleInstances\":false,\"defaultReleaseNamespace\":\"mjh\"},\"id\":\"xjyngudivk\",\"name\":\"tswb\",\"type\":\"qzvszjf\"}}},\"id\":\"uvjfdxxive\",\"name\":\"vtcqaqtdo\",\"type\":\"mcbxvwvxysl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ExtensionType response = manager.extensionTypes() + .getWithResponse("gvpgy", "gqgitxmedjvcsl", "n", "wwncwzzhxgk", "rmgucnap", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertFalse(response.properties().isSystemExtension()); + Assertions.assertFalse(response.properties().isManagedIdentityRequired()); + Assertions.assertEquals("wptfdy", response.properties().description()); + Assertions.assertEquals("fqbuaceopzf", response.properties().publisher()); + Assertions.assertEquals("huaoppp", response.properties().planInfo().publisherId()); + Assertions.assertEquals("eqx", response.properties().planInfo().planId()); + Assertions.assertEquals("z", response.properties().planInfo().offerId()); + Assertions.assertEquals("zxctobgb", response.properties().supportedClusterTypes().get(0)); + Assertions.assertEquals("bunrmfqjhhk", response.properties().supportedScopes().defaultScope()); + Assertions.assertFalse(response.properties().supportedScopes().clusterScopeSettings().allowMultipleInstances()); + Assertions.assertEquals("mjh", + response.properties().supportedScopes().clusterScopeSettings().defaultReleaseNamespace()); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListMockTests.java new file mode 100644 index 000000000000..848374cc4de7 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListMockTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"isSystemExtension\":true,\"isManagedIdentityRequired\":false,\"description\":\"bbtdzumvee\",\"publisher\":\"pwo\",\"planInfo\":{\"publisherId\":\"kfpbs\",\"planId\":\"ofd\",\"offerId\":\"uusdttouwa\"},\"supportedClusterTypes\":[\"kqvkelnsmvbxwyjs\",\"lh\"],\"supportedScopes\":{\"defaultScope\":\"aln\",\"clusterScopeSettings\":{\"properties\":{\"allowMultipleInstances\":true,\"defaultReleaseNamespace\":\"yaw\"},\"id\":\"oyaqcslyjpkiid\",\"name\":\"yexz\",\"type\":\"eli\"}}},\"id\":\"hnrztfol\",\"name\":\"bnxknalaulppg\",\"type\":\"dtpnapnyiropuhp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.extensionTypes() + .list("qbex", "mcqibycnojv", "nmefqsgzvahapj", "zhpvgqzcjrvxd", "zlmwlxkvugfhz", "vawjvzunlu", "hnnpr", + "xipeilpjzuaejx", com.azure.core.util.Context.NONE); + + Assertions.assertTrue(response.iterator().next().properties().isSystemExtension()); + Assertions.assertFalse(response.iterator().next().properties().isManagedIdentityRequired()); + Assertions.assertEquals("bbtdzumvee", response.iterator().next().properties().description()); + Assertions.assertEquals("pwo", response.iterator().next().properties().publisher()); + Assertions.assertEquals("kfpbs", response.iterator().next().properties().planInfo().publisherId()); + Assertions.assertEquals("ofd", response.iterator().next().properties().planInfo().planId()); + Assertions.assertEquals("uusdttouwa", response.iterator().next().properties().planInfo().offerId()); + Assertions.assertEquals("kqvkelnsmvbxwyjs", + response.iterator().next().properties().supportedClusterTypes().get(0)); + Assertions.assertEquals("aln", response.iterator().next().properties().supportedScopes().defaultScope()); + Assertions.assertTrue( + response.iterator().next().properties().supportedScopes().clusterScopeSettings().allowMultipleInstances()); + Assertions.assertEquals("yaw", + response.iterator().next().properties().supportedScopes().clusterScopeSettings().defaultReleaseNamespace()); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListVersionsMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListVersionsMockTests.java new file mode 100644 index 000000000000..242acbbe34c2 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesListVersionsMockTests.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.VersionForReleaseTrain; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesListVersionsMockTests { + @Test + public void testListVersions() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"version\":\"nqzahmgkbrpyyd\",\"unsupportedKubernetesVersions\":{\"connectedCluster\":[{\"distributions\":[\"qkpikadrgvtqagnb\",\"ynhijggme\",\"fsiarbutr\"],\"unsupportedVersions\":[\"na\",\"zmhjrunmp\"]},{\"distributions\":[\"dbhrbnlankxm\",\"skpbhenbtkcxywn\",\"tnrsyn\"],\"unsupportedVersions\":[\"dybyxczfclhaa\",\"dbabp\",\"lwrq\"]},{\"distributions\":[\"tsthsucocm\",\"yyazttbt\",\"wrqpue\",\"ckzywbiexzfeyue\"],\"unsupportedVersions\":[\"bxu\"]},{\"distributions\":[\"hqwa\",\"muzyoxaepdk\",\"jancu\",\"rhdwbavxbniw\"],\"unsupportedVersions\":[\"wz\",\"s\"]}],\"appliances\":[{\"distributions\":[\"xytxhpzxbz\",\"fzab\"],\"unsupportedVersions\":[\"uhxwtctyqiklbbov\"]}],\"provisionedCluster\":[{\"distributions\":[\"hvgyuguosvmk\",\"ss\"],\"unsupportedVersions\":[\"kkfpl\",\"mg\",\"xnkjzkdesl\"]},{\"distributions\":[\"opwi\",\"ighxpk\"],\"unsupportedVersions\":[\"baiuebbaumny\"]},{\"distributions\":[\"edeojnabc\"],\"unsupportedVersions\":[\"mtxpsiebtfh\",\"pesapskrdqmhjj\",\"htldwk\"]}],\"managedCluster\":[{\"distributions\":[\"tkncwsc\",\"svlxotogtwrup\"],\"unsupportedVersions\":[\"vnm\",\"cykvceo\",\"eil\",\"vnotyfjfcnj\"]},{\"distributions\":[\"nxdhbt\"],\"unsupportedVersions\":[\"h\",\"wpn\"]},{\"distributions\":[\"oqnermclfpl\"],\"unsupportedVersions\":[\"xus\",\"rpabg\",\"epsbjtazqu\",\"xywpmueefjzwfqkq\"]},{\"distributions\":[\"dsuyonobgla\"],\"unsupportedVersions\":[\"xtccmg\",\"udxytlmoyrx\",\"wfudwpzntxhdzhl\"]}]},\"supportedClusterTypes\":[\"bh\",\"kfrlhrxsbky\",\"pycanuzbpz\"]},\"id\":\"afkuwb\",\"name\":\"rnwb\",\"type\":\"ehhseyvjusrts\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.extensionTypes() + .listVersions("mxnehmp", "ec", "godebfqkkrbmpu", "gr", "wflzlfbxzpuzy", true, + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("nqzahmgkbrpyyd", response.iterator().next().properties().version()); + Assertions.assertEquals("qkpikadrgvtqagnb", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .connectedCluster() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("na", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .connectedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("xytxhpzxbz", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .appliances() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("uhxwtctyqiklbbov", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .appliances() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("hvgyuguosvmk", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .provisionedCluster() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("kkfpl", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .provisionedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("tkncwsc", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .managedCluster() + .get(0) + .distributions() + .get(0)); + Assertions.assertEquals("vnm", + response.iterator() + .next() + .properties() + .unsupportedKubernetesVersions() + .managedCluster() + .get(0) + .unsupportedVersions() + .get(0)); + Assertions.assertEquals("bh", response.iterator().next().properties().supportedClusterTypes().get(0)); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationGetWithRMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationGetWithRMockTests.java new file mode 100644 index 000000000000..ad89eb8c958f --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationGetWithRMockTests.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.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesLocationGetWithRMockTests { + @Test + public void testLocationGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"isSystemExtension\":true,\"isManagedIdentityRequired\":false,\"description\":\"conuqszfkbeype\",\"publisher\":\"mjmwvvjektcx\",\"planInfo\":{\"publisherId\":\"hwlrsf\",\"planId\":\"zpwv\",\"offerId\":\"dqgbiqylihkaetc\"},\"supportedClusterTypes\":[\"fcivfsnkym\",\"ctq\",\"jf\",\"ebrjcxe\"],\"supportedScopes\":{\"defaultScope\":\"wutttxfvjrbi\",\"clusterScopeSettings\":{\"properties\":{\"allowMultipleInstances\":true,\"defaultReleaseNamespace\":\"c\"},\"id\":\"vahfn\",\"name\":\"jky\",\"type\":\"xjvuujqgidokg\"}}},\"id\":\"ljyoxgvcltb\",\"name\":\"sncghkjeszz\",\"type\":\"bijhtxfvgxbf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ExtensionType response = manager.extensionTypes() + .locationGetWithResponse("heun", "mqhgyxzkonocuk", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertTrue(response.properties().isSystemExtension()); + Assertions.assertFalse(response.properties().isManagedIdentityRequired()); + Assertions.assertEquals("conuqszfkbeype", response.properties().description()); + Assertions.assertEquals("mjmwvvjektcx", response.properties().publisher()); + Assertions.assertEquals("hwlrsf", response.properties().planInfo().publisherId()); + Assertions.assertEquals("zpwv", response.properties().planInfo().planId()); + Assertions.assertEquals("dqgbiqylihkaetc", response.properties().planInfo().offerId()); + Assertions.assertEquals("fcivfsnkym", response.properties().supportedClusterTypes().get(0)); + Assertions.assertEquals("wutttxfvjrbi", response.properties().supportedScopes().defaultScope()); + Assertions.assertTrue(response.properties().supportedScopes().clusterScopeSettings().allowMultipleInstances()); + Assertions.assertEquals("c", + response.properties().supportedScopes().clusterScopeSettings().defaultReleaseNamespace()); + } +} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationListMockTests.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationListMockTests.java new file mode 100644 index 000000000000..f0c825af5917 --- /dev/null +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensiontypes/src/test/java/com/azure/resourcemanager/kubernetesconfiguration/extensiontypes/generated/ExtensionTypesLocationListMockTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.ExtensionTypesManager; +import com.azure.resourcemanager.kubernetesconfiguration.extensiontypes.models.ExtensionType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ExtensionTypesLocationListMockTests { + @Test + public void testLocationList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"isSystemExtension\":false,\"isManagedIdentityRequired\":true,\"description\":\"kgjn\",\"publisher\":\"ucgygevqz\",\"planInfo\":{\"publisherId\":\"pmr\",\"planId\":\"izcdrqjsd\",\"offerId\":\"dnfyhxdeoejzicwi\"},\"supportedClusterTypes\":[\"ttgzfbis\",\"cbkhajdeyeamdph\"],\"supportedScopes\":{\"defaultScope\":\"lpbuxwgipwhonowk\",\"clusterScopeSettings\":{\"properties\":{\"allowMultipleInstances\":true,\"defaultReleaseNamespace\":\"kix\"},\"id\":\"bin\",\"name\":\"eputtmrywnuzoqf\",\"type\":\"iyqzrnk\"}}},\"id\":\"qvyxlwhzlsicoho\",\"name\":\"qnwvlrya\",\"type\":\"w\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ExtensionTypesManager manager = ExtensionTypesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.extensionTypes() + .locationList("ithlvmezyvshxm", "sbbzo", "gigr", "wburvjxxjnspydpt", "oenkouknvudwti", "kbldngkpocipa", + com.azure.core.util.Context.NONE); + + Assertions.assertFalse(response.iterator().next().properties().isSystemExtension()); + Assertions.assertTrue(response.iterator().next().properties().isManagedIdentityRequired()); + Assertions.assertEquals("kgjn", response.iterator().next().properties().description()); + Assertions.assertEquals("ucgygevqz", response.iterator().next().properties().publisher()); + Assertions.assertEquals("pmr", response.iterator().next().properties().planInfo().publisherId()); + Assertions.assertEquals("izcdrqjsd", response.iterator().next().properties().planInfo().planId()); + Assertions.assertEquals("dnfyhxdeoejzicwi", response.iterator().next().properties().planInfo().offerId()); + Assertions.assertEquals("ttgzfbis", response.iterator().next().properties().supportedClusterTypes().get(0)); + Assertions.assertEquals("lpbuxwgipwhonowk", + response.iterator().next().properties().supportedScopes().defaultScope()); + Assertions.assertTrue( + response.iterator().next().properties().supportedScopes().clusterScopeSettings().allowMultipleInstances()); + Assertions.assertEquals("kix", + response.iterator().next().properties().supportedScopes().clusterScopeSettings().defaultReleaseNamespace()); + } +} diff --git a/sdk/kubernetesconfiguration/ci.yml b/sdk/kubernetesconfiguration/ci.yml index c7badfe6206f..713ca473208b 100644 --- a/sdk/kubernetesconfiguration/ci.yml +++ b/sdk/kubernetesconfiguration/ci.yml @@ -37,3 +37,6 @@ extends: - name: azure-resourcemanager-kubernetesconfiguration groupId: com.azure.resourcemanager safeName: azureresourcemanagerkubernetesconfiguration + - name: azure-resourcemanager-kubernetesconfiguration-extensiontypes + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerkubernetesconfigurationextensiontypes diff --git a/sdk/kubernetesconfiguration/pom.xml b/sdk/kubernetesconfiguration/pom.xml index c997fa0c0115..c0d894e9f730 100644 --- a/sdk/kubernetesconfiguration/pom.xml +++ b/sdk/kubernetesconfiguration/pom.xml @@ -10,6 +10,7 @@ 1.0.0 - azure-resourcemanager-kubernetesconfiguration + azure-resourcemanager-kubernetesconfiguration + azure-resourcemanager-kubernetesconfiguration-extensiontypes