diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 667ca4883a79..277a8ff1cf6e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -350,6 +350,7 @@ com.azure.resourcemanager:azure-resourcemanager-dynatrace;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-deviceupdate;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-machinelearning;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-education;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-nginx;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 28f19ed8c5ca..5b4bcab9ade4 100644 --- a/pom.xml +++ b/pom.xml @@ -940,6 +940,7 @@ sdk/mysql sdk/mysqlflexibleserver sdk/netapp + sdk/nginx sdk/notificationhubs sdk/oep sdk/operationsmanagement diff --git a/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md b/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md new file mode 100644 index 000000000000..704007fa37db --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-06-13) + +- Azure Resource Manager Nginx client library for Java. This package contains Microsoft Azure SDK for Nginx Management SDK. Package tag package-2021-05-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/nginx/azure-resourcemanager-nginx/README.md b/sdk/nginx/azure-resourcemanager-nginx/README.md new file mode 100644 index 000000000000..b033f561883e --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Nginx client library for Java + +Azure Resource Manager Nginx client library for Java. + +This package contains Microsoft Azure SDK for Nginx Management SDK. Package tag package-2021-05-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-nginx;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-nginx + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +NginxManager manager = NginxManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md b/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md new file mode 100644 index 000000000000..b3c8d536306b --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md @@ -0,0 +1,359 @@ +# Code snippets and samples + + +## Certificates + +- [Create](#certificates_create) +- [Delete](#certificates_delete) +- [Get](#certificates_get) +- [List](#certificates_list) + +## Configurations + +- [CreateOrUpdate](#configurations_createorupdate) +- [Delete](#configurations_delete) +- [Get](#configurations_get) +- [List](#configurations_list) + +## Deployments + +- [Create](#deployments_create) +- [Delete](#deployments_delete) +- [GetByResourceGroup](#deployments_getbyresourcegroup) +- [List](#deployments_list) +- [ListByResourceGroup](#deployments_listbyresourcegroup) +- [Update](#deployments_update) + +## Operations + +- [List](#operations_list) +### Certificates_Create + +```java +/** Samples for Certificates Create. */ +public final class CertificatesCreateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_CreateOrUpdate.json + */ + /** + * Sample code: Certificates_CreateOrUpdate. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager + .certificates() + .define("default") + .withRegion((String) null) + .withExistingNginxDeployment("myResourceGroup", "myDeployment") + .create(); + } +} +``` + +### Certificates_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_Delete.json + */ + /** + * Sample code: Certificates_Delete. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates().delete("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} +``` + +### Certificates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_Get.json + */ + /** + * Sample code: Certificates_Get. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates().getWithResponse("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} +``` + +### Certificates_List + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_List.json + */ + /** + * Sample code: Certificates_List. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates().list("myResourceGroup", "myDeployment", Context.NONE); + } +} +``` + +### Configurations_CreateOrUpdate + +```java +/** Samples for Configurations CreateOrUpdate. */ +public final class ConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_CreateOrUpdate.json + */ + /** + * Sample code: Configurations_CreateOrUpdate. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager + .configurations() + .define("default") + .withRegion((String) null) + .withExistingNginxDeployment("myResourceGroup", "myDeployment") + .create(); + } +} +``` + +### Configurations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Configurations Delete. */ +public final class ConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_Delete.json + */ + /** + * Sample code: Configurations_Delete. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().delete("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} +``` + +### Configurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Configurations Get. */ +public final class ConfigurationsGetSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_Get.json + */ + /** + * Sample code: Configurations_Get. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().getWithResponse("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} +``` + +### Configurations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Configurations List. */ +public final class ConfigurationsListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_List.json + */ + /** + * Sample code: Configurations_List. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().list("myResourceGroup", "myDeployment", Context.NONE); + } +} +``` + +### Deployments_Create + +```java +/** Samples for Deployments Create. */ +public final class DeploymentsCreateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Create.json + */ + /** + * Sample code: Deployments_Create. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsCreate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager + .deployments() + .define("myDeployment") + .withRegion((String) null) + .withExistingResourceGroup("myResourceGroup") + .create(); + } +} +``` + +### Deployments_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments Delete. */ +public final class DeploymentsDeleteSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Delete.json + */ + /** + * Sample code: Deployments_Delete. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().delete("myResourceGroup", "myDeployment", Context.NONE); + } +} +``` + +### Deployments_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments GetByResourceGroup. */ +public final class DeploymentsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Get.json + */ + /** + * Sample code: Deployments_Get. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().getByResourceGroupWithResponse("myResourceGroup", "myDeployment", Context.NONE); + } +} +``` + +### Deployments_List + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments List. */ +public final class DeploymentsListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_List.json + */ + /** + * Sample code: Deployments_List. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().list(Context.NONE); + } +} +``` + +### Deployments_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments ListByResourceGroup. */ +public final class DeploymentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_ListByResourceGroup.json + */ + /** + * Sample code: Deployments_ListByResourceGroup. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsListByResourceGroup(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### Deployments_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.models.NginxDeployment; + +/** Samples for Deployments Update. */ +public final class DeploymentsUpdateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Update.json + */ + /** + * Sample code: Deployments_Update. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + NginxDeployment resource = + manager + .deployments() + .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to NginxManager. + */ + public static void operationsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + diff --git a/sdk/nginx/azure-resourcemanager-nginx/pom.xml b/sdk/nginx/azure-resourcemanager-nginx/pom.xml new file mode 100644 index 000000000000..32d295ea4c4b --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-nginx + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Nginx Management + This package contains Microsoft Azure SDK for Nginx Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-05-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.29.1 + + + com.azure + azure-core-management + 1.6.2 + + + diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/NginxManager.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/NginxManager.java new file mode 100644 index 000000000000..5d76d80a6097 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/NginxManager.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.nginx.fluent.NginxManagementClient; +import com.azure.resourcemanager.nginx.implementation.CertificatesImpl; +import com.azure.resourcemanager.nginx.implementation.ConfigurationsImpl; +import com.azure.resourcemanager.nginx.implementation.DeploymentsImpl; +import com.azure.resourcemanager.nginx.implementation.NginxManagementClientBuilder; +import com.azure.resourcemanager.nginx.implementation.OperationsImpl; +import com.azure.resourcemanager.nginx.models.Certificates; +import com.azure.resourcemanager.nginx.models.Configurations; +import com.azure.resourcemanager.nginx.models.Deployments; +import com.azure.resourcemanager.nginx.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to NginxManager. */ +public final class NginxManager { + private Certificates certificates; + + private Configurations configurations; + + private Deployments deployments; + + private Operations operations; + + private final NginxManagementClient clientObject; + + private NginxManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new NginxManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Nginx service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Nginx service API instance. + */ + public static NginxManager 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 Nginx service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Nginx service API instance. + */ + public static NginxManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new NginxManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create NginxManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new NginxManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Nginx service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Nginx service API instance. + */ + public NginxManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.nginx") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new NginxManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Certificates. It manages NginxCertificate. + * + * @return Resource collection API of Certificates. + */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); + } + return certificates; + } + + /** + * Gets the resource collection API of Configurations. It manages NginxConfiguration. + * + * @return Resource collection API of Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); + } + return configurations; + } + + /** + * Gets the resource collection API of Deployments. It manages NginxDeployment. + * + * @return Resource collection API of Deployments. + */ + public Deployments deployments() { + if (this.deployments == null) { + this.deployments = new DeploymentsImpl(clientObject.getDeployments(), this); + } + return deployments; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * @return Wrapped service client NginxManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public NginxManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/CertificatesClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/CertificatesClient.java new file mode 100644 index 000000000000..8cb3acfb363d --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/CertificatesClient.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; + +/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +public interface CertificatesClient { + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxCertificateInner get(String resourceGroupName, String deploymentName, String certificateName); + + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String deploymentName, String certificateName, Context context); + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxCertificateInner> beginCreate( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body); + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxCertificateInner> beginCreate( + String resourceGroupName, + String deploymentName, + String certificateName, + NginxCertificateInner body, + Context context); + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxCertificateInner create( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body); + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxCertificateInner create(String resourceGroupName, String deploymentName, String certificateName); + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxCertificateInner create( + String resourceGroupName, + String deploymentName, + String certificateName, + NginxCertificateInner body, + Context context); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String certificateName); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String certificateName, Context context); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, String certificateName); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, String certificateName, Context context); + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deploymentName); + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deploymentName, Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ConfigurationsClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ConfigurationsClient.java new file mode 100644 index 000000000000..ef5c20310a6a --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ConfigurationsClient.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; + +/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ +public interface ConfigurationsClient { + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deploymentName); + + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @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 response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deploymentName, Context context); + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxConfigurationInner get(String resourceGroupName, String deploymentName, String configurationName); + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String deploymentName, String configurationName, Context context); + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationInner body); + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String deploymentName, + String configurationName, + NginxConfigurationInner body, + Context context); + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxConfigurationInner createOrUpdate( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationInner body); + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxConfigurationInner createOrUpdate(String resourceGroupName, String deploymentName, String configurationName); + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxConfigurationInner createOrUpdate( + String resourceGroupName, + String deploymentName, + String configurationName, + NginxConfigurationInner body, + Context context); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String configurationName); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String configurationName, Context context); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, String configurationName); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, String configurationName, Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DeploymentsClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DeploymentsClient.java new file mode 100644 index 000000000000..8ca0769ba615 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DeploymentsClient.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; +import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateParameters; + +/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ +public interface DeploymentsClient { + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentInner getByResourceGroup(String resourceGroupName, String deploymentName); + + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context); + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxDeploymentInner> beginCreate( + String resourceGroupName, String deploymentName, NginxDeploymentInner body); + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxDeploymentInner> beginCreate( + String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context); + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentInner create(String resourceGroupName, String deploymentName, NginxDeploymentInner body); + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentInner create(String resourceGroupName, String deploymentName); + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentInner create( + String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context); + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxDeploymentInner> beginUpdate( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body); + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxDeploymentInner> beginUpdate( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context); + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentInner update(String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body); + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentInner update(String resourceGroupName, String deploymentName); + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentInner update( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context); + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName); + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, Context context); + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName); + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, Context context); + + /** + * List the Nginx deployments resources. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the Nginx deployments resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/NginxManagementClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/NginxManagementClient.java new file mode 100644 index 000000000000..e24d2ad31db5 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/NginxManagementClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for NginxManagementClient class. */ +public interface NginxManagementClient { + /** + * 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 CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + CertificatesClient getCertificates(); + + /** + * Gets the ConfigurationsClient object to access its operations. + * + * @return the ConfigurationsClient object. + */ + ConfigurationsClient getConfigurations(); + + /** + * Gets the DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + DeploymentsClient getDeployments(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/OperationsClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/OperationsClient.java new file mode 100644 index 000000000000..cb80aa2a2251 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxCertificateInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxCertificateInner.java new file mode 100644 index 000000000000..e328c36cf85f --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxCertificateInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.nginx.models.NginxCertificateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NginxCertificate model. */ +@Fluent +public final class NginxCertificateInner extends Resource { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private NginxCertificateProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public NginxCertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the NginxCertificateInner object itself. + */ + public NginxCertificateInner withProperties(NginxCertificateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NginxCertificateInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NginxCertificateInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationInner.java new file mode 100644 index 000000000000..c768f162dcae --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NginxConfiguration model. */ +@Fluent +public final class NginxConfigurationInner extends Resource { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private NginxConfigurationProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public NginxConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the NginxConfigurationInner object itself. + */ + public NginxConfigurationInner withProperties(NginxConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NginxConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NginxConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentInner.java new file mode 100644 index 000000000000..92541df0ccf5 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentInner.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.nginx.models.IdentityProperties; +import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; +import com.azure.resourcemanager.nginx.models.ResourceSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NginxDeployment model. */ +@Fluent +public final class NginxDeploymentInner extends Resource { + /* + * The identity property. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private NginxDeploymentProperties properties; + + /* + * The sku property. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the identity property: The identity property. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity property. + * + * @param identity the identity value to set. + * @return the NginxDeploymentInner object itself. + */ + public NginxDeploymentInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public NginxDeploymentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the NginxDeploymentInner object itself. + */ + public NginxDeploymentInner withProperties(NginxDeploymentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: The sku property. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku property. + * + * @param sku the sku value to set. + * @return the NginxDeploymentInner object itself. + */ + public NginxDeploymentInner withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public NginxDeploymentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public NginxDeploymentInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java new file mode 100644 index 000000000000..f1e0386770f9 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.nginx.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Nginx.NginxPlus REST API operation. */ +@Fluent +public final class OperationResultInner { + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/package-info.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/package-info.java new file mode 100644 index 000000000000..7cba885b86c2 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for NginxManagementClient. null. */ +package com.azure.resourcemanager.nginx.fluent.models; diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/package-info.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/package-info.java new file mode 100644 index 000000000000..4db0ff3a08b3 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for NginxManagementClient. null. */ +package com.azure.resourcemanager.nginx.fluent; diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesClientImpl.java new file mode 100644 index 000000000000..a8ea3e272f6b --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesClientImpl.java @@ -0,0 +1,1137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.CertificatesClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; +import com.azure.resourcemanager.nginx.models.NginxCertificateListResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +public final class CertificatesClientImpl implements CertificatesClient { + /** The proxy service used to perform REST calls. */ + private final CertificatesService service; + + /** The service client containing this operation class. */ + private final NginxManagementClientImpl client; + + /** + * Initializes an instance of CertificatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CertificatesClientImpl(NginxManagementClientImpl client) { + this.service = + RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NginxManagementClientCertificates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NginxManagementClien") + private interface CertificatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/certificates/{certificateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("certificateName") String certificateName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/certificates/{certificateName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("certificateName") String certificateName, + @BodyParam("application/json") NginxCertificateInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/certificates/{certificateName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("certificateName") String certificateName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/certificates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String deploymentName, String certificateName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + certificateName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String deploymentName, String certificateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + certificateName, + accept, + context); + } + + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String deploymentName, String certificateName) { + return getWithResponseAsync(resourceGroupName, deploymentName, certificateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxCertificateInner get(String resourceGroupName, String deploymentName, String certificateName) { + return getAsync(resourceGroupName, deploymentName, certificateName).block(); + } + + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String deploymentName, String certificateName, Context context) { + return getWithResponseAsync(resourceGroupName, deploymentName, certificateName, context).block(); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + certificateName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String deploymentName, + String certificateName, + NginxCertificateInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + certificateName, + body, + accept, + context); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxCertificateInner> beginCreateAsync( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, deploymentName, certificateName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NginxCertificateInner.class, + NginxCertificateInner.class, + this.client.getContext()); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxCertificateInner> beginCreateAsync( + String resourceGroupName, + String deploymentName, + String certificateName, + NginxCertificateInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, deploymentName, certificateName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NginxCertificateInner.class, NginxCertificateInner.class, context); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxCertificateInner> beginCreate( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body) { + return beginCreateAsync(resourceGroupName, deploymentName, certificateName, body).getSyncPoller(); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxCertificateInner> beginCreate( + String resourceGroupName, + String deploymentName, + String certificateName, + NginxCertificateInner body, + Context context) { + return beginCreateAsync(resourceGroupName, deploymentName, certificateName, body, context).getSyncPoller(); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body) { + return beginCreateAsync(resourceGroupName, deploymentName, certificateName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String deploymentName, String certificateName) { + final NginxCertificateInner body = null; + return beginCreateAsync(resourceGroupName, deploymentName, certificateName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String deploymentName, + String certificateName, + NginxCertificateInner body, + Context context) { + return beginCreateAsync(resourceGroupName, deploymentName, certificateName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxCertificateInner create( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body) { + return createAsync(resourceGroupName, deploymentName, certificateName, body).block(); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxCertificateInner create(String resourceGroupName, String deploymentName, String certificateName) { + final NginxCertificateInner body = null; + return createAsync(resourceGroupName, deploymentName, certificateName, body).block(); + } + + /** + * Create or update the Nginx certificates for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxCertificateInner create( + String resourceGroupName, + String deploymentName, + String certificateName, + NginxCertificateInner body, + Context context) { + return createAsync(resourceGroupName, deploymentName, certificateName, body, context).block(); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String deploymentName, String certificateName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + certificateName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String deploymentName, String certificateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + certificateName, + accept, + context); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String deploymentName, String certificateName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, deploymentName, certificateName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String deploymentName, String certificateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, deploymentName, certificateName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String certificateName) { + return beginDeleteAsync(resourceGroupName, deploymentName, certificateName).getSyncPoller(); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String certificateName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, certificateName, context).getSyncPoller(); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deploymentName, String certificateName) { + return beginDeleteAsync(resourceGroupName, deploymentName, certificateName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String deploymentName, String certificateName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, certificateName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName, String certificateName) { + deleteAsync(resourceGroupName, deploymentName, certificateName).block(); + } + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName, String certificateName, Context context) { + deleteAsync(resourceGroupName, deploymentName, certificateName, context).block(); + } + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String deploymentName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + 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 certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String deploymentName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, deploymentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String deploymentName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, deploymentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String deploymentName) { + return new PagedIterable<>(listAsync(resourceGroupName, deploymentName)); + } + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String deploymentName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, deploymentName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesImpl.java new file mode 100644 index 000000000000..9161c3858265 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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.nginx.fluent.CertificatesClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; +import com.azure.resourcemanager.nginx.models.Certificates; +import com.azure.resourcemanager.nginx.models.NginxCertificate; + +public final class CertificatesImpl implements Certificates { + private static final ClientLogger LOGGER = new ClientLogger(CertificatesImpl.class); + + private final CertificatesClient innerClient; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public CertificatesImpl( + CertificatesClient innerClient, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NginxCertificate get(String resourceGroupName, String deploymentName, String certificateName) { + NginxCertificateInner inner = this.serviceClient().get(resourceGroupName, deploymentName, certificateName); + if (inner != null) { + return new NginxCertificateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String deploymentName, String certificateName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, deploymentName, certificateName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NginxCertificateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String deploymentName, String certificateName) { + this.serviceClient().delete(resourceGroupName, deploymentName, certificateName); + } + + public void delete(String resourceGroupName, String deploymentName, String certificateName, Context context) { + this.serviceClient().delete(resourceGroupName, deploymentName, certificateName, context); + } + + public PagedIterable list(String resourceGroupName, String deploymentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, deploymentName); + return Utils.mapPage(inner, inner1 -> new NginxCertificateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String deploymentName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, deploymentName, context); + return Utils.mapPage(inner, inner1 -> new NginxCertificateImpl(inner1, this.manager())); + } + + public NginxCertificate getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, deploymentName, certificateName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, deploymentName, certificateName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + this.delete(resourceGroupName, deploymentName, certificateName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + this.delete(resourceGroupName, deploymentName, certificateName, context); + } + + private CertificatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + public NginxCertificateImpl define(String name) { + return new NginxCertificateImpl(name, this.manager()); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsClientImpl.java new file mode 100644 index 000000000000..177bc2bc8be3 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsClientImpl.java @@ -0,0 +1,1171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.ConfigurationsClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; +import com.azure.resourcemanager.nginx.models.NginxConfigurationListResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ +public final class ConfigurationsClientImpl implements ConfigurationsClient { + /** The proxy service used to perform REST calls. */ + private final ConfigurationsService service; + + /** The service client containing this operation class. */ + private final NginxManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationsClientImpl(NginxManagementClientImpl client) { + this.service = + RestProxy.create(ConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NginxManagementClientConfigurations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NginxManagementClien") + private interface ConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/configurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/configurations/{configurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("configurationName") String configurationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/configurations/{configurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") NginxConfigurationInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}/configurations/{configurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("configurationName") String configurationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String deploymentName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + 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 Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @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 response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String deploymentName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, deploymentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @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 response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String deploymentName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, deploymentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String deploymentName) { + return new PagedIterable<>(listAsync(resourceGroupName, deploymentName)); + } + + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @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 response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String deploymentName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, deploymentName, context)); + } + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String deploymentName, String configurationName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + configurationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String deploymentName, String configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + configurationName, + accept, + context); + } + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String deploymentName, String configurationName) { + return getWithResponseAsync(resourceGroupName, deploymentName, configurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxConfigurationInner get(String resourceGroupName, String deploymentName, String configurationName) { + return getAsync(resourceGroupName, deploymentName, configurationName).block(); + } + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String deploymentName, String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, deploymentName, configurationName, context).block(); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationInner body) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + configurationName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String deploymentName, + String configurationName, + NginxConfigurationInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + configurationName, + body, + accept, + context); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationInner body) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, configurationName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NginxConfigurationInner.class, + NginxConfigurationInner.class, + this.client.getContext()); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxConfigurationInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String deploymentName, + String configurationName, + NginxConfigurationInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, configurationName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NginxConfigurationInner.class, + NginxConfigurationInner.class, + context); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body).getSyncPoller(); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String deploymentName, + String configurationName, + NginxConfigurationInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body, context) + .getSyncPoller(); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String deploymentName, String configurationName) { + final NginxConfigurationInner body = null; + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String deploymentName, + String configurationName, + NginxConfigurationInner body, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxConfigurationInner createOrUpdate( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationInner body) { + return createOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body).block(); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxConfigurationInner createOrUpdate( + String resourceGroupName, String deploymentName, String configurationName) { + final NginxConfigurationInner body = null; + return createOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body).block(); + } + + /** + * Create or update the Nginx configuration for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param body The Nginx configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxConfigurationInner createOrUpdate( + String resourceGroupName, + String deploymentName, + String configurationName, + NginxConfigurationInner body, + Context context) { + return createOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body, context).block(); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String deploymentName, String configurationName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + configurationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String deploymentName, String configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + configurationName, + accept, + context); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String deploymentName, String configurationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, deploymentName, configurationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String deploymentName, String configurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, deploymentName, configurationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String configurationName) { + return beginDeleteAsync(resourceGroupName, deploymentName, configurationName).getSyncPoller(); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, String configurationName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, configurationName, context).getSyncPoller(); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deploymentName, String configurationName) { + return beginDeleteAsync(resourceGroupName, deploymentName, configurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String deploymentName, String configurationName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, configurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName, String configurationName) { + deleteAsync(resourceGroupName, deploymentName, configurationName).block(); + } + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName, String configurationName, Context context) { + deleteAsync(resourceGroupName, deploymentName, configurationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsImpl.java new file mode 100644 index 000000000000..4221b92bbb3a --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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.nginx.fluent.ConfigurationsClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; +import com.azure.resourcemanager.nginx.models.Configurations; +import com.azure.resourcemanager.nginx.models.NginxConfiguration; + +public final class ConfigurationsImpl implements Configurations { + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationsImpl.class); + + private final ConfigurationsClient innerClient; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public ConfigurationsImpl( + ConfigurationsClient innerClient, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String deploymentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, deploymentName); + return Utils.mapPage(inner, inner1 -> new NginxConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String deploymentName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, deploymentName, context); + return Utils.mapPage(inner, inner1 -> new NginxConfigurationImpl(inner1, this.manager())); + } + + public NginxConfiguration get(String resourceGroupName, String deploymentName, String configurationName) { + NginxConfigurationInner inner = this.serviceClient().get(resourceGroupName, deploymentName, configurationName); + if (inner != null) { + return new NginxConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String deploymentName, String configurationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, deploymentName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NginxConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String deploymentName, String configurationName) { + this.serviceClient().delete(resourceGroupName, deploymentName, configurationName); + } + + public void delete(String resourceGroupName, String deploymentName, String configurationName, Context context) { + this.serviceClient().delete(resourceGroupName, deploymentName, configurationName, context); + } + + public NginxConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + return this.getWithResponse(resourceGroupName, deploymentName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + return this.getWithResponse(resourceGroupName, deploymentName, configurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + this.delete(resourceGroupName, deploymentName, configurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String configurationName = Utils.getValueFromIdByName(id, "configurations"); + if (configurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'configurations'.", id))); + } + this.delete(resourceGroupName, deploymentName, configurationName, context); + } + + private ConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + public NginxConfigurationImpl define(String name) { + return new NginxConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsClientImpl.java new file mode 100644 index 000000000000..ea242555a2dc --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsClientImpl.java @@ -0,0 +1,1552 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.DeploymentsClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; +import com.azure.resourcemanager.nginx.models.NginxDeploymentListResponse; +import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ +public final class DeploymentsClientImpl implements DeploymentsClient { + /** The proxy service used to perform REST calls. */ + private final DeploymentsService service; + + /** The service client containing this operation class. */ + private final NginxManagementClientImpl client; + + /** + * Initializes an instance of DeploymentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeploymentsClientImpl(NginxManagementClientImpl client) { + this.service = + RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NginxManagementClientDeployments to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NginxManagementClien") + private interface DeploymentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") NginxDeploymentInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") NginxDeploymentUpdateParameters body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments/{deploymentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus" + + "/nginxDeployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deploymentName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + accept, + context); + } + + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentInner getByResourceGroup(String resourceGroupName, String deploymentName) { + return getByResourceGroupAsync(resourceGroupName, deploymentName).block(); + } + + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName, context).block(); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String deploymentName, NginxDeploymentInner body) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + body, + accept, + context); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxDeploymentInner> beginCreateAsync( + String resourceGroupName, String deploymentName, NginxDeploymentInner body) { + Mono>> mono = createWithResponseAsync(resourceGroupName, deploymentName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NginxDeploymentInner.class, + NginxDeploymentInner.class, + this.client.getContext()); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxDeploymentInner> beginCreateAsync( + String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, deploymentName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NginxDeploymentInner.class, NginxDeploymentInner.class, context); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxDeploymentInner> beginCreate( + String resourceGroupName, String deploymentName, NginxDeploymentInner body) { + return beginCreateAsync(resourceGroupName, deploymentName, body).getSyncPoller(); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxDeploymentInner> beginCreate( + String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { + return beginCreateAsync(resourceGroupName, deploymentName, body, context).getSyncPoller(); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String deploymentName, NginxDeploymentInner body) { + return beginCreateAsync(resourceGroupName, deploymentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String deploymentName) { + final NginxDeploymentInner body = null; + return beginCreateAsync(resourceGroupName, deploymentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { + return beginCreateAsync(resourceGroupName, deploymentName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentInner create(String resourceGroupName, String deploymentName, NginxDeploymentInner body) { + return createAsync(resourceGroupName, deploymentName, body).block(); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentInner create(String resourceGroupName, String deploymentName) { + final NginxDeploymentInner body = null; + return createAsync(resourceGroupName, deploymentName, body).block(); + } + + /** + * Create or update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentInner create( + String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { + return createAsync(resourceGroupName, deploymentName, body, context).block(); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + body, + accept, + context); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxDeploymentInner> beginUpdateAsync( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, deploymentName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + NginxDeploymentInner.class, + NginxDeploymentInner.class, + this.client.getContext()); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxDeploymentInner> beginUpdateAsync( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, deploymentName, body, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NginxDeploymentInner.class, NginxDeploymentInner.class, context); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxDeploymentInner> beginUpdate( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body) { + return beginUpdateAsync(resourceGroupName, deploymentName, body).getSyncPoller(); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxDeploymentInner> beginUpdate( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { + return beginUpdateAsync(resourceGroupName, deploymentName, body, context).getSyncPoller(); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body) { + return beginUpdateAsync(resourceGroupName, deploymentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String deploymentName) { + final NginxDeploymentUpdateParameters body = null; + return beginUpdateAsync(resourceGroupName, deploymentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { + return beginUpdateAsync(resourceGroupName, deploymentName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentInner update( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body) { + return updateAsync(resourceGroupName, deploymentName, body).block(); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentInner update(String resourceGroupName, String deploymentName) { + final NginxDeploymentUpdateParameters body = null; + return updateAsync(resourceGroupName, deploymentName, body).block(); + } + + /** + * Update the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentInner update( + String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { + return updateAsync(resourceGroupName, deploymentName, body, context).block(); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName) { + 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + deploymentName, + accept, + context); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName) { + return beginDeleteAsync(resourceGroupName, deploymentName).getSyncPoller(); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String deploymentName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, context).getSyncPoller(); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deploymentName) { + return beginDeleteAsync(resourceGroupName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deploymentName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName) { + deleteAsync(resourceGroupName, deploymentName).block(); + } + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName, Context context) { + deleteAsync(resourceGroupName, deploymentName, context).block(); + } + + /** + * List the Nginx deployments resources. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), 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 Nginx deployments resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the Nginx deployments resources. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the Nginx deployments resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the Nginx deployments resources. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the Nginx deployments resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + 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 Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsImpl.java new file mode 100644 index 000000000000..cbc7f17cfc1f --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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.nginx.fluent.DeploymentsClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; +import com.azure.resourcemanager.nginx.models.Deployments; +import com.azure.resourcemanager.nginx.models.NginxDeployment; + +public final class DeploymentsImpl implements Deployments { + private static final ClientLogger LOGGER = new ClientLogger(DeploymentsImpl.class); + + private final DeploymentsClient innerClient; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public DeploymentsImpl(DeploymentsClient innerClient, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NginxDeployment getByResourceGroup(String resourceGroupName, String deploymentName) { + NginxDeploymentInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, deploymentName); + if (inner != null) { + return new NginxDeploymentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NginxDeploymentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String deploymentName) { + this.serviceClient().delete(resourceGroupName, deploymentName); + } + + public void delete(String resourceGroupName, String deploymentName, Context context) { + this.serviceClient().delete(resourceGroupName, deploymentName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new NginxDeploymentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new NginxDeploymentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new NginxDeploymentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new NginxDeploymentImpl(inner1, this.manager())); + } + + public NginxDeployment getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deploymentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + this.delete(resourceGroupName, deploymentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + this.delete(resourceGroupName, deploymentName, context); + } + + private DeploymentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + public NginxDeploymentImpl define(String name) { + return new NginxDeploymentImpl(name, this.manager()); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxCertificateImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxCertificateImpl.java new file mode 100644 index 000000000000..bb68ff852830 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxCertificateImpl.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; +import com.azure.resourcemanager.nginx.models.NginxCertificate; +import com.azure.resourcemanager.nginx.models.NginxCertificateProperties; +import java.util.Collections; +import java.util.Map; + +public final class NginxCertificateImpl implements NginxCertificate, NginxCertificate.Definition { + private NginxCertificateInner innerObject; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + NginxCertificateImpl( + NginxCertificateInner innerObject, com.azure.resourcemanager.nginx.NginxManager 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 String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NginxCertificateProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public NginxCertificateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String deploymentName; + + private String certificateName; + + public NginxCertificateImpl withExistingNginxDeployment(String resourceGroupName, String deploymentName) { + this.resourceGroupName = resourceGroupName; + this.deploymentName = deploymentName; + return this; + } + + public NginxCertificate create() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .create(resourceGroupName, deploymentName, certificateName, this.innerModel(), Context.NONE); + return this; + } + + public NginxCertificate create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .create(resourceGroupName, deploymentName, certificateName, this.innerModel(), context); + return this; + } + + NginxCertificateImpl(String name, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = new NginxCertificateInner(); + this.serviceManager = serviceManager; + this.certificateName = name; + } + + public NginxCertificate refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, deploymentName, certificateName, Context.NONE) + .getValue(); + return this; + } + + public NginxCertificate refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, deploymentName, certificateName, context) + .getValue(); + return this; + } + + public NginxCertificateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NginxCertificateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NginxCertificateImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public NginxCertificateImpl withProperties(NginxCertificateProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxConfigurationImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxConfigurationImpl.java new file mode 100644 index 000000000000..bfed32cb0571 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxConfigurationImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; +import com.azure.resourcemanager.nginx.models.NginxConfiguration; +import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; +import java.util.Collections; +import java.util.Map; + +public final class NginxConfigurationImpl + implements NginxConfiguration, NginxConfiguration.Definition, NginxConfiguration.Update { + private NginxConfigurationInner innerObject; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NginxConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NginxConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String deploymentName; + + private String configurationName; + + public NginxConfigurationImpl withExistingNginxDeployment(String resourceGroupName, String deploymentName) { + this.resourceGroupName = resourceGroupName; + this.deploymentName = deploymentName; + return this; + } + + public NginxConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .createOrUpdate(resourceGroupName, deploymentName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public NginxConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .createOrUpdate(resourceGroupName, deploymentName, configurationName, this.innerModel(), context); + return this; + } + + NginxConfigurationImpl(String name, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = new NginxConfigurationInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public NginxConfigurationImpl update() { + return this; + } + + public NginxConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .createOrUpdate(resourceGroupName, deploymentName, configurationName, this.innerModel(), Context.NONE); + return this; + } + + public NginxConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .createOrUpdate(resourceGroupName, deploymentName, configurationName, this.innerModel(), context); + return this; + } + + NginxConfigurationImpl( + NginxConfigurationInner innerObject, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.deploymentName = Utils.getValueFromIdByName(innerObject.id(), "nginxDeployments"); + this.configurationName = Utils.getValueFromIdByName(innerObject.id(), "configurations"); + } + + public NginxConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .getWithResponse(resourceGroupName, deploymentName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public NginxConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurations() + .getWithResponse(resourceGroupName, deploymentName, configurationName, context) + .getValue(); + return this; + } + + public NginxConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NginxConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NginxConfigurationImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public NginxConfigurationImpl withProperties(NginxConfigurationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentImpl.java new file mode 100644 index 000000000000..82336853947d --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; +import com.azure.resourcemanager.nginx.models.IdentityProperties; +import com.azure.resourcemanager.nginx.models.NginxDeployment; +import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; +import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateParameters; +import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateProperties; +import com.azure.resourcemanager.nginx.models.ResourceSku; +import java.util.Collections; +import java.util.Map; + +public final class NginxDeploymentImpl implements NginxDeployment, NginxDeployment.Definition, NginxDeployment.Update { + private NginxDeploymentInner innerObject; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public NginxDeploymentProperties properties() { + return this.innerModel().properties(); + } + + public ResourceSku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NginxDeploymentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String deploymentName; + + private NginxDeploymentUpdateParameters updateBody; + + public NginxDeploymentImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NginxDeployment create() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .create(resourceGroupName, deploymentName, this.innerModel(), Context.NONE); + return this; + } + + public NginxDeployment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .create(resourceGroupName, deploymentName, this.innerModel(), context); + return this; + } + + NginxDeploymentImpl(String name, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = new NginxDeploymentInner(); + this.serviceManager = serviceManager; + this.deploymentName = name; + } + + public NginxDeploymentImpl update() { + this.updateBody = new NginxDeploymentUpdateParameters(); + return this; + } + + public NginxDeployment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .update(resourceGroupName, deploymentName, updateBody, Context.NONE); + return this; + } + + public NginxDeployment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .update(resourceGroupName, deploymentName, updateBody, context); + return this; + } + + NginxDeploymentImpl(NginxDeploymentInner innerObject, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.deploymentName = Utils.getValueFromIdByName(innerObject.id(), "nginxDeployments"); + } + + public NginxDeployment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .getByResourceGroupWithResponse(resourceGroupName, deploymentName, Context.NONE) + .getValue(); + return this; + } + + public NginxDeployment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .getByResourceGroupWithResponse(resourceGroupName, deploymentName, context) + .getValue(); + return this; + } + + public NginxDeploymentImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NginxDeploymentImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NginxDeploymentImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public NginxDeploymentImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateBody.withIdentity(identity); + return this; + } + } + + public NginxDeploymentImpl withProperties(NginxDeploymentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public NginxDeploymentImpl withSku(ResourceSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateBody.withSku(sku); + return this; + } + } + + public NginxDeploymentImpl withProperties(NginxDeploymentUpdateProperties properties) { + this.updateBody.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientBuilder.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientBuilder.java new file mode 100644 index 000000000000..bf9a762c2731 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientBuilder.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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 NginxManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {NginxManagementClientImpl.class}) +public final class NginxManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the NginxManagementClientBuilder. + */ + public NginxManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the NginxManagementClientBuilder. + */ + public NginxManagementClientBuilder 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 NginxManagementClientBuilder. + */ + public NginxManagementClientBuilder 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 NginxManagementClientBuilder. + */ + public NginxManagementClientBuilder 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 NginxManagementClientBuilder. + */ + public NginxManagementClientBuilder 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 NginxManagementClientBuilder. + */ + public NginxManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NginxManagementClientImpl with the provided parameters. + * + * @return an instance of NginxManagementClientImpl. + */ + public NginxManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = ""; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + NginxManagementClientImpl client = + new NginxManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientImpl.java new file mode 100644 index 000000000000..a70f393c8224 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientImpl.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.nginx.fluent.CertificatesClient; +import com.azure.resourcemanager.nginx.fluent.ConfigurationsClient; +import com.azure.resourcemanager.nginx.fluent.DeploymentsClient; +import com.azure.resourcemanager.nginx.fluent.NginxManagementClient; +import com.azure.resourcemanager.nginx.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the NginxManagementClientImpl type. */ +@ServiceClient(builder = NginxManagementClientBuilder.class) +public final class NginxManagementClientImpl implements NginxManagementClient { + /** 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 CertificatesClient object to access its operations. */ + private final CertificatesClient certificates; + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + public CertificatesClient getCertificates() { + return this.certificates; + } + + /** The ConfigurationsClient object to access its operations. */ + private final ConfigurationsClient configurations; + + /** + * Gets the ConfigurationsClient object to access its operations. + * + * @return the ConfigurationsClient object. + */ + public ConfigurationsClient getConfigurations() { + return this.configurations; + } + + /** The DeploymentsClient object to access its operations. */ + private final DeploymentsClient deployments; + + /** + * Gets the DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + public DeploymentsClient getDeployments() { + return this.deployments; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * Initializes an instance of NginxManagementClient 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. + */ + NginxManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-05-01-preview"; + this.certificates = new CertificatesClientImpl(this); + this.configurations = new ConfigurationsClientImpl(this); + this.deployments = new DeploymentsClientImpl(this); + this.operations = new OperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NginxManagementClientImpl.class); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationResultImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationResultImpl.java new file mode 100644 index 000000000000..6825039391fc --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.azure.resourcemanager.nginx.models.OperationDisplay; +import com.azure.resourcemanager.nginx.models.OperationResult; + +public final class OperationResultImpl implements OperationResult { + private OperationResultInner innerObject; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + OperationResultImpl(OperationResultInner innerObject, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..75a59351ddc1 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsClientImpl.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.nginx.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.resourcemanager.nginx.fluent.OperationsClient; +import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.azure.resourcemanager.nginx.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final NginxManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(NginxManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NginxManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NginxManagementClien") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Nginx.NginxPlus/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations 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 nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsImpl.java new file mode 100644 index 000000000000..6e2a5786004f --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.nginx.fluent.OperationsClient; +import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.azure.resourcemanager.nginx.models.OperationResult; +import com.azure.resourcemanager.nginx.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/Utils.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/Utils.java new file mode 100644 index 000000000000..acdfd8fe4dbf --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/package-info.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/package-info.java new file mode 100644 index 000000000000..12d9994fb2f3 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for NginxManagementClient. null. */ +package com.azure.resourcemanager.nginx.implementation; diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Certificates.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Certificates.java new file mode 100644 index 000000000000..eec33cd0d9e8 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Certificates.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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 Certificates. */ +public interface Certificates { + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment. + */ + NginxCertificate get(String resourceGroupName, String deploymentName, String certificateName); + + /** + * Get a certificate of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String deploymentName, String certificateName, Context context); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deploymentName, String certificateName); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param certificateName The name of certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deploymentName, String certificateName, Context context); + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deploymentName); + + /** + * List all certificates of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deploymentName, Context context); + + /** + * Get a certificate of given Nginx deployment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment along with {@link Response}. + */ + NginxCertificate getById(String id); + + /** + * Get a certificate of given Nginx deployment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a certificate of given Nginx deployment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a certificate from the nginx deployment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NginxCertificate resource. + * + * @param name resource name. + * @return the first stage of the new NginxCertificate definition. + */ + NginxCertificate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Configurations.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Configurations.java new file mode 100644 index 000000000000..06841997a1c9 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Configurations.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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 Configurations. */ +public interface Configurations { + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deploymentName); + + /** + * List the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @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 response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deploymentName, Context context); + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment. + */ + NginxConfiguration get(String resourceGroupName, String deploymentName, String configurationName); + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String deploymentName, String configurationName, Context context); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deploymentName, String configurationName); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * Nginx conf. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deploymentName, String configurationName, Context context); + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment along with {@link Response}. + */ + NginxConfiguration getById(String id); + + /** + * Get the Nginx configuration of given Nginx deployment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx configuration of given Nginx deployment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Reset the Nginx configuration of given Nginx deployment to default. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NginxConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new NginxConfiguration definition. + */ + NginxConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Deployments.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Deployments.java new file mode 100644 index 000000000000..62fb61af517b --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Deployments.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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 Deployments. */ +public interface Deployments { + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment. + */ + NginxDeployment getByResourceGroup(String resourceGroupName, String deploymentName); + + /** + * Get the Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context); + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String deploymentName); + + /** + * Delete the Nginx deployment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deploymentName, Context context); + + /** + * List the Nginx deployments resources. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the Nginx deployments resources. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all Nginx deployments under the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the Nginx deployment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment along with {@link Response}. + */ + NginxDeployment getById(String id); + + /** + * Get the Nginx deployment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx deployment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the Nginx deployment resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the Nginx deployment resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NginxDeployment resource. + * + * @param name resource name. + * @return the first stage of the new NginxDeployment definition. + */ + NginxDeployment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityProperties.java new file mode 100644 index 000000000000..35855d390d60 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The IdentityProperties model. */ +@Fluent +public final class IdentityProperties { + /* + * The principalId property. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenantId property. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type property. + */ + @JsonProperty(value = "type") + private IdentityType type; + + /* + * Dictionary of + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principalId property. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: Dictionary of <UserIdentityProperties>. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Dictionary of <UserIdentityProperties>. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityType.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityType.java new file mode 100644 index 000000000000..041c67d581b5 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityType. */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for IdentityType. */ + public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned, UserAssigned"); + + /** Static value None for IdentityType. */ + public static final IdentityType NONE = fromString("None"); + + /** + * Creates or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** + * Gets known IdentityType values. + * + * @return known IdentityType values. + */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificate.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificate.java new file mode 100644 index 000000000000..f2fc37f4f261 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificate.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; +import java.util.Map; + +/** An immutable client-side representation of NginxCertificate. */ +public interface NginxCertificate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The properties property. + * + * @return the properties value. + */ + NginxCertificateProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner object. + * + * @return the inner object. + */ + NginxCertificateInner innerModel(); + + /** The entirety of the NginxCertificate definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The NginxCertificate definition stages. */ + interface DefinitionStages { + /** The first stage of the NginxCertificate definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NginxCertificate definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the NginxCertificate definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, deploymentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @return the next definition stage. + */ + WithCreate withExistingNginxDeployment(String resourceGroupName, String deploymentName); + } + /** + * The stage of the NginxCertificate definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + NginxCertificate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NginxCertificate create(Context context); + } + /** The stage of the NginxCertificate definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NginxCertificate definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + WithCreate withProperties(NginxCertificateProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NginxCertificate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NginxCertificate refresh(Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateListResponse.java new file mode 100644 index 000000000000..ba567091e38c --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateListResponse.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NginxCertificateListResponse model. */ +@Fluent +public final class NginxCertificateListResponse { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the NginxCertificateListResponse object itself. + */ + public NginxCertificateListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the NginxCertificateListResponse object itself. + */ + public NginxCertificateListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateProperties.java new file mode 100644 index 000000000000..05d4c7f4355f --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxCertificateProperties model. */ +@Fluent +public final class NginxCertificateProperties { + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The keyVirtualPath property. + */ + @JsonProperty(value = "keyVirtualPath") + private String keyVirtualPath; + + /* + * The certificateVirtualPath property. + */ + @JsonProperty(value = "certificateVirtualPath") + private String certificateVirtualPath; + + /* + * The keyVaultSecretId property. + */ + @JsonProperty(value = "keyVaultSecretId") + private String keyVaultSecretId; + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the NginxCertificateProperties object itself. + */ + public NginxCertificateProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the keyVirtualPath property: The keyVirtualPath property. + * + * @return the keyVirtualPath value. + */ + public String keyVirtualPath() { + return this.keyVirtualPath; + } + + /** + * Set the keyVirtualPath property: The keyVirtualPath property. + * + * @param keyVirtualPath the keyVirtualPath value to set. + * @return the NginxCertificateProperties object itself. + */ + public NginxCertificateProperties withKeyVirtualPath(String keyVirtualPath) { + this.keyVirtualPath = keyVirtualPath; + return this; + } + + /** + * Get the certificateVirtualPath property: The certificateVirtualPath property. + * + * @return the certificateVirtualPath value. + */ + public String certificateVirtualPath() { + return this.certificateVirtualPath; + } + + /** + * Set the certificateVirtualPath property: The certificateVirtualPath property. + * + * @param certificateVirtualPath the certificateVirtualPath value to set. + * @return the NginxCertificateProperties object itself. + */ + public NginxCertificateProperties withCertificateVirtualPath(String certificateVirtualPath) { + this.certificateVirtualPath = certificateVirtualPath; + return this; + } + + /** + * Get the keyVaultSecretId property: The keyVaultSecretId property. + * + * @return the keyVaultSecretId value. + */ + public String keyVaultSecretId() { + return this.keyVaultSecretId; + } + + /** + * Set the keyVaultSecretId property: The keyVaultSecretId property. + * + * @param keyVaultSecretId the keyVaultSecretId value to set. + * @return the NginxCertificateProperties object itself. + */ + public NginxCertificateProperties withKeyVaultSecretId(String keyVaultSecretId) { + this.keyVaultSecretId = keyVaultSecretId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfiguration.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfiguration.java new file mode 100644 index 000000000000..aeaf4e8a40cc --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfiguration.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; +import java.util.Map; + +/** An immutable client-side representation of NginxConfiguration. */ +public interface NginxConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The properties property. + * + * @return the properties value. + */ + NginxConfigurationProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner object. + * + * @return the inner object. + */ + NginxConfigurationInner innerModel(); + + /** The entirety of the NginxConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The NginxConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the NginxConfiguration definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NginxConfiguration definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the NginxConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, deploymentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted Nginx deployment. + * @return the next definition stage. + */ + WithCreate withExistingNginxDeployment(String resourceGroupName, String deploymentName); + } + /** + * The stage of the NginxConfiguration definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + NginxConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NginxConfiguration create(Context context); + } + /** The stage of the NginxConfiguration definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NginxConfiguration definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + WithCreate withProperties(NginxConfigurationProperties properties); + } + } + /** + * Begins update for the NginxConfiguration resource. + * + * @return the stage of resource update. + */ + NginxConfiguration.Update update(); + + /** The template for NginxConfiguration update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NginxConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NginxConfiguration apply(Context context); + } + /** The NginxConfiguration update stages. */ + interface UpdateStages { + /** The stage of the NginxConfiguration update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the NginxConfiguration update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + Update withProperties(NginxConfigurationProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NginxConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NginxConfiguration refresh(Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationFile.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationFile.java new file mode 100644 index 000000000000..8e7b735a2b83 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationFile.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxConfigurationFile model. */ +@Fluent +public final class NginxConfigurationFile { + /* + * The content property. + */ + @JsonProperty(value = "content") + private String content; + + /* + * The virtualPath property. + */ + @JsonProperty(value = "virtualPath") + private String virtualPath; + + /** + * Get the content property: The content property. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The content property. + * + * @param content the content value to set. + * @return the NginxConfigurationFile object itself. + */ + public NginxConfigurationFile withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the virtualPath property: The virtualPath property. + * + * @return the virtualPath value. + */ + public String virtualPath() { + return this.virtualPath; + } + + /** + * Set the virtualPath property: The virtualPath property. + * + * @param virtualPath the virtualPath value to set. + * @return the NginxConfigurationFile object itself. + */ + public NginxConfigurationFile withVirtualPath(String virtualPath) { + this.virtualPath = virtualPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationListResponse.java new file mode 100644 index 000000000000..e64392bd01b5 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationListResponse.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response of a list operation. */ +@Fluent +public final class NginxConfigurationListResponse { + /* + * Results of a list operation. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results, if any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Results of a list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Results of a list operation. + * + * @param value the value value to set. + * @return the NginxConfigurationListResponse object itself. + */ + public NginxConfigurationListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results, if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results, if any. + * + * @param nextLink the nextLink value to set. + * @return the NginxConfigurationListResponse object itself. + */ + public NginxConfigurationListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationPackage.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationPackage.java new file mode 100644 index 000000000000..737de8d9a995 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationPackage.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxConfigurationPackage model. */ +@Fluent +public final class NginxConfigurationPackage { + /* + * The data property. + */ + @JsonProperty(value = "data") + private String data; + + /** + * Get the data property: The data property. + * + * @return the data value. + */ + public String data() { + return this.data; + } + + /** + * Set the data property: The data property. + * + * @param data the data value to set. + * @return the NginxConfigurationPackage object itself. + */ + public NginxConfigurationPackage withData(String data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProperties.java new file mode 100644 index 000000000000..07dd62174f0a --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NginxConfigurationProperties model. */ +@Fluent +public final class NginxConfigurationProperties { + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The files property. + */ + @JsonProperty(value = "files") + private List files; + + /* + * The package property. + */ + @JsonProperty(value = "package") + private NginxConfigurationPackage packageProperty; + + /* + * The rootFile property. + */ + @JsonProperty(value = "rootFile") + private String rootFile; + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the NginxConfigurationProperties object itself. + */ + public NginxConfigurationProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the files property: The files property. + * + * @return the files value. + */ + public List files() { + return this.files; + } + + /** + * Set the files property: The files property. + * + * @param files the files value to set. + * @return the NginxConfigurationProperties object itself. + */ + public NginxConfigurationProperties withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get the packageProperty property: The package property. + * + * @return the packageProperty value. + */ + public NginxConfigurationPackage packageProperty() { + return this.packageProperty; + } + + /** + * Set the packageProperty property: The package property. + * + * @param packageProperty the packageProperty value to set. + * @return the NginxConfigurationProperties object itself. + */ + public NginxConfigurationProperties withPackageProperty(NginxConfigurationPackage packageProperty) { + this.packageProperty = packageProperty; + return this; + } + + /** + * Get the rootFile property: The rootFile property. + * + * @return the rootFile value. + */ + public String rootFile() { + return this.rootFile; + } + + /** + * Set the rootFile property: The rootFile property. + * + * @param rootFile the rootFile value to set. + * @return the NginxConfigurationProperties object itself. + */ + public NginxConfigurationProperties withRootFile(String rootFile) { + this.rootFile = rootFile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (files() != null) { + files().forEach(e -> e.validate()); + } + if (packageProperty() != null) { + packageProperty().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeployment.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeployment.java new file mode 100644 index 000000000000..20c91245ce98 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeployment.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; +import java.util.Map; + +/** An immutable client-side representation of NginxDeployment. */ +public interface NginxDeployment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The identity property. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the properties property: The properties property. + * + * @return the properties value. + */ + NginxDeploymentProperties properties(); + + /** + * Gets the sku property: The sku property. + * + * @return the sku value. + */ + ResourceSku sku(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner object. + * + * @return the inner object. + */ + NginxDeploymentInner innerModel(); + + /** The entirety of the NginxDeployment definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The NginxDeployment definition stages. */ + interface DefinitionStages { + /** The first stage of the NginxDeployment definition. */ + interface Blank extends WithLocation { + } + /** The stage of the NginxDeployment definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the NginxDeployment definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the NginxDeployment definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithProperties, + DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + NginxDeployment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NginxDeployment create(Context context); + } + /** The stage of the NginxDeployment definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NginxDeployment definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity property.. + * + * @param identity The identity property. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the NginxDeployment definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + WithCreate withProperties(NginxDeploymentProperties properties); + } + /** The stage of the NginxDeployment definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku property.. + * + * @param sku The sku property. + * @return the next definition stage. + */ + WithCreate withSku(ResourceSku sku); + } + } + /** + * Begins update for the NginxDeployment resource. + * + * @return the stage of resource update. + */ + NginxDeployment.Update update(); + + /** The template for NginxDeployment update. */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NginxDeployment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NginxDeployment apply(Context context); + } + /** The NginxDeployment update stages. */ + interface UpdateStages { + /** The stage of the NginxDeployment update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Dictionary of <string>. + * + * @param tags Dictionary of <string>. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the NginxDeployment update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity property.. + * + * @param identity The identity property. + * @return the next definition stage. + */ + Update withIdentity(IdentityProperties identity); + } + /** The stage of the NginxDeployment update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku property.. + * + * @param sku The sku property. + * @return the next definition stage. + */ + Update withSku(ResourceSku sku); + } + /** The stage of the NginxDeployment update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + Update withProperties(NginxDeploymentUpdateProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NginxDeployment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NginxDeployment refresh(Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentListResponse.java new file mode 100644 index 000000000000..a56160466be8 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentListResponse.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NginxDeploymentListResponse model. */ +@Fluent +public final class NginxDeploymentListResponse { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the NginxDeploymentListResponse object itself. + */ + public NginxDeploymentListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the NginxDeploymentListResponse object itself. + */ + public NginxDeploymentListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentProperties.java new file mode 100644 index 000000000000..6a6ec0b27920 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentProperties.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.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxDeploymentProperties model. */ +@Fluent +public final class NginxDeploymentProperties { + /* + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * The nginxVersion property. + */ + @JsonProperty(value = "nginxVersion", access = JsonProperty.Access.WRITE_ONLY) + private String nginxVersion; + + /* + * The managed resource group to deploy VNet injection related network + * resources. + */ + @JsonProperty(value = "managedResourceGroup") + private String managedResourceGroup; + + /* + * The networkProfile property. + */ + @JsonProperty(value = "networkProfile") + private NginxNetworkProfile networkProfile; + + /* + * The IP address of the deployment. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * The enableDiagnosticsSupport property. + */ + @JsonProperty(value = "enableDiagnosticsSupport") + private Boolean enableDiagnosticsSupport; + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioningState property. + * + * @param provisioningState the provisioningState value to set. + * @return the NginxDeploymentProperties object itself. + */ + public NginxDeploymentProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the nginxVersion property: The nginxVersion property. + * + * @return the nginxVersion value. + */ + public String nginxVersion() { + return this.nginxVersion; + } + + /** + * Get the managedResourceGroup property: The managed resource group to deploy VNet injection related network + * resources. + * + * @return the managedResourceGroup value. + */ + public String managedResourceGroup() { + return this.managedResourceGroup; + } + + /** + * Set the managedResourceGroup property: The managed resource group to deploy VNet injection related network + * resources. + * + * @param managedResourceGroup the managedResourceGroup value to set. + * @return the NginxDeploymentProperties object itself. + */ + public NginxDeploymentProperties withManagedResourceGroup(String managedResourceGroup) { + this.managedResourceGroup = managedResourceGroup; + return this; + } + + /** + * Get the networkProfile property: The networkProfile property. + * + * @return the networkProfile value. + */ + public NginxNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: The networkProfile property. + * + * @param networkProfile the networkProfile value to set. + * @return the NginxDeploymentProperties object itself. + */ + public NginxDeploymentProperties withNetworkProfile(NginxNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the ipAddress property: The IP address of the deployment. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the enableDiagnosticsSupport property: The enableDiagnosticsSupport property. + * + * @return the enableDiagnosticsSupport value. + */ + public Boolean enableDiagnosticsSupport() { + return this.enableDiagnosticsSupport; + } + + /** + * Set the enableDiagnosticsSupport property: The enableDiagnosticsSupport property. + * + * @param enableDiagnosticsSupport the enableDiagnosticsSupport value to set. + * @return the NginxDeploymentProperties object itself. + */ + public NginxDeploymentProperties withEnableDiagnosticsSupport(Boolean enableDiagnosticsSupport) { + this.enableDiagnosticsSupport = enableDiagnosticsSupport; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkProfile() != null) { + networkProfile().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateParameters.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateParameters.java new file mode 100644 index 000000000000..5b487c472d88 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateParameters.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NginxDeploymentUpdateParameters model. */ +@Fluent +public final class NginxDeploymentUpdateParameters { + /* + * The identity property. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * Dictionary of + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The sku property. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /* + * The location property. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private NginxDeploymentUpdateProperties properties; + + /** + * Get the identity property: The identity property. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity property. + * + * @param identity the identity value to set. + * @return the NginxDeploymentUpdateParameters object itself. + */ + public NginxDeploymentUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. + * @return the NginxDeploymentUpdateParameters object itself. + */ + public NginxDeploymentUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The sku property. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku property. + * + * @param sku the sku value to set. + * @return the NginxDeploymentUpdateParameters object itself. + */ + public NginxDeploymentUpdateParameters withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location property. + * + * @param location the location value to set. + * @return the NginxDeploymentUpdateParameters object itself. + */ + public NginxDeploymentUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public NginxDeploymentUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the NginxDeploymentUpdateParameters object itself. + */ + public NginxDeploymentUpdateParameters withProperties(NginxDeploymentUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateProperties.java new file mode 100644 index 000000000000..b0e59253b0f9 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxDeploymentUpdateProperties model. */ +@Fluent +public final class NginxDeploymentUpdateProperties { + /* + * The enableDiagnosticsSupport property. + */ + @JsonProperty(value = "enableDiagnosticsSupport") + private Boolean enableDiagnosticsSupport; + + /** + * Get the enableDiagnosticsSupport property: The enableDiagnosticsSupport property. + * + * @return the enableDiagnosticsSupport value. + */ + public Boolean enableDiagnosticsSupport() { + return this.enableDiagnosticsSupport; + } + + /** + * Set the enableDiagnosticsSupport property: The enableDiagnosticsSupport property. + * + * @param enableDiagnosticsSupport the enableDiagnosticsSupport value to set. + * @return the NginxDeploymentUpdateProperties object itself. + */ + public NginxDeploymentUpdateProperties withEnableDiagnosticsSupport(Boolean enableDiagnosticsSupport) { + this.enableDiagnosticsSupport = enableDiagnosticsSupport; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxFrontendIpConfiguration.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxFrontendIpConfiguration.java new file mode 100644 index 000000000000..ed2ca09b060e --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxFrontendIpConfiguration.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The NginxFrontendIpConfiguration model. */ +@Fluent +public final class NginxFrontendIpConfiguration { + /* + * The publicIPAddresses property. + */ + @JsonProperty(value = "publicIPAddresses") + private List publicIpAddresses; + + /* + * The privateIPAddresses property. + */ + @JsonProperty(value = "privateIPAddresses") + private List privateIpAddresses; + + /** + * Get the publicIpAddresses property: The publicIPAddresses property. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * Set the publicIpAddresses property: The publicIPAddresses property. + * + * @param publicIpAddresses the publicIpAddresses value to set. + * @return the NginxFrontendIpConfiguration object itself. + */ + public NginxFrontendIpConfiguration withPublicIpAddresses(List publicIpAddresses) { + this.publicIpAddresses = publicIpAddresses; + return this; + } + + /** + * Get the privateIpAddresses property: The privateIPAddresses property. + * + * @return the privateIpAddresses value. + */ + public List privateIpAddresses() { + return this.privateIpAddresses; + } + + /** + * Set the privateIpAddresses property: The privateIPAddresses property. + * + * @param privateIpAddresses the privateIpAddresses value to set. + * @return the NginxFrontendIpConfiguration object itself. + */ + public NginxFrontendIpConfiguration withPrivateIpAddresses(List privateIpAddresses) { + this.privateIpAddresses = privateIpAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicIpAddresses() != null) { + publicIpAddresses().forEach(e -> e.validate()); + } + if (privateIpAddresses() != null) { + privateIpAddresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkInterfaceConfiguration.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkInterfaceConfiguration.java new file mode 100644 index 000000000000..30fb197e89db --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkInterfaceConfiguration.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxNetworkInterfaceConfiguration model. */ +@Fluent +public final class NginxNetworkInterfaceConfiguration { + /* + * The subnetId property. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** + * Get the subnetId property: The subnetId property. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnetId property. + * + * @param subnetId the subnetId value to set. + * @return the NginxNetworkInterfaceConfiguration object itself. + */ + public NginxNetworkInterfaceConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkProfile.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkProfile.java new file mode 100644 index 000000000000..172dd5c63825 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkProfile.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxNetworkProfile model. */ +@Fluent +public final class NginxNetworkProfile { + /* + * The frontEndIPConfiguration property. + */ + @JsonProperty(value = "frontEndIPConfiguration") + private NginxFrontendIpConfiguration frontEndIpConfiguration; + + /* + * The networkInterfaceConfiguration property. + */ + @JsonProperty(value = "networkInterfaceConfiguration") + private NginxNetworkInterfaceConfiguration networkInterfaceConfiguration; + + /** + * Get the frontEndIpConfiguration property: The frontEndIPConfiguration property. + * + * @return the frontEndIpConfiguration value. + */ + public NginxFrontendIpConfiguration frontEndIpConfiguration() { + return this.frontEndIpConfiguration; + } + + /** + * Set the frontEndIpConfiguration property: The frontEndIPConfiguration property. + * + * @param frontEndIpConfiguration the frontEndIpConfiguration value to set. + * @return the NginxNetworkProfile object itself. + */ + public NginxNetworkProfile withFrontEndIpConfiguration(NginxFrontendIpConfiguration frontEndIpConfiguration) { + this.frontEndIpConfiguration = frontEndIpConfiguration; + return this; + } + + /** + * Get the networkInterfaceConfiguration property: The networkInterfaceConfiguration property. + * + * @return the networkInterfaceConfiguration value. + */ + public NginxNetworkInterfaceConfiguration networkInterfaceConfiguration() { + return this.networkInterfaceConfiguration; + } + + /** + * Set the networkInterfaceConfiguration property: The networkInterfaceConfiguration property. + * + * @param networkInterfaceConfiguration the networkInterfaceConfiguration value to set. + * @return the NginxNetworkProfile object itself. + */ + public NginxNetworkProfile withNetworkInterfaceConfiguration( + NginxNetworkInterfaceConfiguration networkInterfaceConfiguration) { + this.networkInterfaceConfiguration = networkInterfaceConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (frontEndIpConfiguration() != null) { + frontEndIpConfiguration().validate(); + } + if (networkInterfaceConfiguration() != null) { + networkInterfaceConfiguration().validate(); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAddress.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAddress.java new file mode 100644 index 000000000000..7644039f0034 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAddress.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxPrivateIpAddress model. */ +@Fluent +public final class NginxPrivateIpAddress { + /* + * The privateIPAddress property. + */ + @JsonProperty(value = "privateIPAddress") + private String privateIpAddress; + + /* + * The privateIPAllocationMethod property. + */ + @JsonProperty(value = "privateIPAllocationMethod") + private NginxPrivateIpAllocationMethod privateIpAllocationMethod; + + /* + * The subnetId property. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** + * Get the privateIpAddress property: The privateIPAddress property. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: The privateIPAddress property. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the NginxPrivateIpAddress object itself. + */ + public NginxPrivateIpAddress withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAllocationMethod property: The privateIPAllocationMethod property. + * + * @return the privateIpAllocationMethod value. + */ + public NginxPrivateIpAllocationMethod privateIpAllocationMethod() { + return this.privateIpAllocationMethod; + } + + /** + * Set the privateIpAllocationMethod property: The privateIPAllocationMethod property. + * + * @param privateIpAllocationMethod the privateIpAllocationMethod value to set. + * @return the NginxPrivateIpAddress object itself. + */ + public NginxPrivateIpAddress withPrivateIpAllocationMethod( + NginxPrivateIpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Get the subnetId property: The subnetId property. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnetId property. + * + * @param subnetId the subnetId value to set. + * @return the NginxPrivateIpAddress object itself. + */ + public NginxPrivateIpAddress withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAllocationMethod.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAllocationMethod.java new file mode 100644 index 000000000000..e809f795b258 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAllocationMethod.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NginxPrivateIpAllocationMethod. */ +public final class NginxPrivateIpAllocationMethod extends ExpandableStringEnum { + /** Static value Static for NginxPrivateIpAllocationMethod. */ + public static final NginxPrivateIpAllocationMethod STATIC = fromString("Static"); + + /** Static value Dynamic for NginxPrivateIpAllocationMethod. */ + public static final NginxPrivateIpAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a NginxPrivateIpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding NginxPrivateIpAllocationMethod. + */ + @JsonCreator + public static NginxPrivateIpAllocationMethod fromString(String name) { + return fromString(name, NginxPrivateIpAllocationMethod.class); + } + + /** + * Gets known NginxPrivateIpAllocationMethod values. + * + * @return known NginxPrivateIpAllocationMethod values. + */ + public static Collection values() { + return values(NginxPrivateIpAllocationMethod.class); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPublicIpAddress.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPublicIpAddress.java new file mode 100644 index 000000000000..dd935b1d7b17 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPublicIpAddress.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NginxPublicIpAddress model. */ +@Fluent +public final class NginxPublicIpAddress { + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the NginxPublicIpAddress object itself. + */ + public NginxPublicIpAddress withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationDisplay.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationDisplay.java new file mode 100644 index 000000000000..6f2b50c3516c --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationDisplay.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Fluent +public final class OperationDisplay { + /* + * Service provider: Nginx.NginxPlus + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Type on which the operation is performed, e.g., 'deployments'. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Operation type, e.g., read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation, e.g., 'Write deployments'. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Service provider: Nginx.NginxPlus. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Nginx.NginxPlus. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Type on which the operation is performed, e.g., 'deployments'. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Type on which the operation is performed, e.g., 'deployments'. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operation type, e.g., read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type, e.g., read, write, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation, e.g., 'Write deployments'. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation, e.g., 'Write deployments'. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationListResult.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationListResult.java new file mode 100644 index 000000000000..f648270bb071 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of GET request to list Nginx.NginxPlus operations. */ +@Fluent +public final class OperationListResult { + /* + * List of operations supported by the Nginx.NginxPlus provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of operations supported by the Nginx.NginxPlus provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of operations supported by the Nginx.NginxPlus provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationResult.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationResult.java new file mode 100644 index 000000000000..fae3b3abc762 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationResult.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; + +/** An immutable client-side representation of OperationResult. */ +public interface OperationResult { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.OperationResultInner object. + * + * @return the inner object. + */ + OperationResultInner innerModel(); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operations.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operations.java new file mode 100644 index 000000000000..14c7b04c2b24 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List all operations provided by Nginx.NginxPlus for the 2021-05-01-preview api version. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ProvisioningState.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ProvisioningState.java new file mode 100644 index 000000000000..d2302de0c4ff --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value NotSpecified for ProvisioningState. */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ResourceSku.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ResourceSku.java new file mode 100644 index 000000000000..90bfee342287 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ResourceSku.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceSku model. */ +@Fluent +public final class ResourceSku { + /* + * Name of the SKU. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: Name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the SKU. + * + * @param name the name value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ResourceSku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSku.class); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/UserIdentityProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/UserIdentityProperties.java new file mode 100644 index 000000000000..3a5798a3d661 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/UserIdentityProperties.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.nginx.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserIdentityProperties model. */ +@Immutable +public final class UserIdentityProperties { + /* + * The principalId property. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The clientId property. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principalId property. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The clientId property. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/package-info.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/package-info.java new file mode 100644 index 000000000000..91cf254cbb2c --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for NginxManagementClient. null. */ +package com.azure.resourcemanager.nginx.models; diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/package-info.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/package-info.java new file mode 100644 index 000000000000..fd94f3e7c8ea --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for NginxManagementClient. null. */ +package com.azure.resourcemanager.nginx; diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/module-info.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/module-info.java new file mode 100644 index 000000000000..274ae0ae8e72 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.nginx { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.nginx; + exports com.azure.resourcemanager.nginx.fluent; + exports com.azure.resourcemanager.nginx.fluent.models; + exports com.azure.resourcemanager.nginx.models; + + opens com.azure.resourcemanager.nginx.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.nginx.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesCreateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesCreateSamples.java new file mode 100644 index 000000000000..decf1ea55205 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesCreateSamples.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.nginx.generated; + +/** Samples for Certificates Create. */ +public final class CertificatesCreateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_CreateOrUpdate.json + */ + /** + * Sample code: Certificates_CreateOrUpdate. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager + .certificates() + .define("default") + .withRegion((String) null) + .withExistingNginxDeployment("myResourceGroup", "myDeployment") + .create(); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteSamples.java new file mode 100644 index 000000000000..9fc96530b627 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_Delete.json + */ + /** + * Sample code: Certificates_Delete. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates().delete("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesGetSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesGetSamples.java new file mode 100644 index 000000000000..c1f25f3b3caf --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_Get.json + */ + /** + * Sample code: Certificates_Get. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates().getWithResponse("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesListSamples.java new file mode 100644 index 000000000000..8a27ed6b3368 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Certificates_List.json + */ + /** + * Sample code: Certificates_List. + * + * @param manager Entry point to NginxManager. + */ + public static void certificatesList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates().list("myResourceGroup", "myDeployment", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..471e482e9f2e --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateSamples.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.nginx.generated; + +/** Samples for Configurations CreateOrUpdate. */ +public final class ConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_CreateOrUpdate.json + */ + /** + * Sample code: Configurations_CreateOrUpdate. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager + .configurations() + .define("default") + .withRegion((String) null) + .withExistingNginxDeployment("myResourceGroup", "myDeployment") + .create(); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..bac3acbe0df5 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Configurations Delete. */ +public final class ConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_Delete.json + */ + /** + * Sample code: Configurations_Delete. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().delete("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetSamples.java new file mode 100644 index 000000000000..ce610d144ecf --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Configurations Get. */ +public final class ConfigurationsGetSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_Get.json + */ + /** + * Sample code: Configurations_Get. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().getWithResponse("myResourceGroup", "myDeployment", "default", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListSamples.java new file mode 100644 index 000000000000..978bd592875c --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Configurations List. */ +public final class ConfigurationsListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Configurations_List.json + */ + /** + * Sample code: Configurations_List. + * + * @param manager Entry point to NginxManager. + */ + public static void configurationsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().list("myResourceGroup", "myDeployment", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateSamples.java new file mode 100644 index 000000000000..59c068a81fe8 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateSamples.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.nginx.generated; + +/** Samples for Deployments Create. */ +public final class DeploymentsCreateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Create.json + */ + /** + * Sample code: Deployments_Create. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsCreate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager + .deployments() + .define("myDeployment") + .withRegion((String) null) + .withExistingResourceGroup("myResourceGroup") + .create(); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteSamples.java new file mode 100644 index 000000000000..8175d026d803 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Deployments Delete. */ +public final class DeploymentsDeleteSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Delete.json + */ + /** + * Sample code: Deployments_Delete. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().delete("myResourceGroup", "myDeployment", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..c3735d53ca41 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Deployments GetByResourceGroup. */ +public final class DeploymentsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Get.json + */ + /** + * Sample code: Deployments_Get. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().getByResourceGroupWithResponse("myResourceGroup", "myDeployment", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..57f20be3c44f --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Deployments ListByResourceGroup. */ +public final class DeploymentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_ListByResourceGroup.json + */ + /** + * Sample code: Deployments_ListByResourceGroup. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsListByResourceGroup(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().listByResourceGroup("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListSamples.java new file mode 100644 index 000000000000..73c0bc0714cc --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Deployments List. */ +public final class DeploymentsListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_List.json + */ + /** + * Sample code: Deployments_List. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().list(Context.NONE); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsUpdateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsUpdateSamples.java new file mode 100644 index 000000000000..a50cc5ecce7d --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.models.NginxDeployment; + +/** Samples for Deployments Update. */ +public final class DeploymentsUpdateSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Deployments_Update.json + */ + /** + * Sample code: Deployments_Update. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + NginxDeployment resource = + manager + .deployments() + .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/OperationsListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/OperationsListSamples.java new file mode 100644 index 000000000000..001e066ebf5f --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2021-05-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to NginxManager. + */ + public static void operationsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/nginx/ci.yml b/sdk/nginx/ci.yml new file mode 100644 index 000000000000..98a41af4c47d --- /dev/null +++ b/sdk/nginx/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.yml + - sdk/nginx/azure-resourcemanager-nginx/ + exclude: + - sdk/nginx/pom.xml + - sdk/nginx/azure-resourcemanager-nginx/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.yml + - sdk/nginx/azure-resourcemanager-nginx/ + exclude: + - sdk/nginx/pom.xml + - sdk/nginx/azure-resourcemanager-nginx/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: nginx + Artifacts: + - name: azure-resourcemanager-nginx + groupId: com.azure.resourcemanager + safeName: azureresourcemanagernginx diff --git a/sdk/nginx/pom.xml b/sdk/nginx/pom.xml new file mode 100644 index 000000000000..d8401eda1108 --- /dev/null +++ b/sdk/nginx/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-nginx-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-nginx + + + +