diff --git a/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md index 772330bd6b85..f53468ae18fa 100644 --- a/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md +++ b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-07-05) +- Azure Resource Manager Avs client library for Java. This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2021-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-13) diff --git a/sdk/avs/azure-resourcemanager-avs/README.md b/sdk/avs/azure-resourcemanager-avs/README.md index 0c7963e07a00..680bae456f7f 100644 --- a/sdk/avs/azure-resourcemanager-avs/README.md +++ b/sdk/avs/azure-resourcemanager-avs/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Avs client library for Java. -This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2020-03-20. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2021-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-avs - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,13 +74,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## 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). +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). 1. Fork it 1. Create your feature branch (`git checkout -b my-new-feature`) @@ -93,7 +95,7 @@ For details on contributing to this repository, see the [contributing guide](htt [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 +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/avs/azure-resourcemanager-avs/pom.xml b/sdk/avs/azure-resourcemanager-avs/pom.xml index 762cdfb2637a..c48aad7174b4 100644 --- a/sdk/avs/azure-resourcemanager-avs/pom.xml +++ b/sdk/avs/azure-resourcemanager-avs/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-avs - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-avs + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Avs Management - This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2020-03-20. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Avs Management + This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2021-06-01. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.18.0 - - - com.azure - azure-core-management - 1.3.1 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java index a6720c45e730..d120122eda13 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,23 +16,40 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.AvsClient; +import com.azure.resourcemanager.avs.implementation.AddonsImpl; import com.azure.resourcemanager.avs.implementation.AuthorizationsImpl; import com.azure.resourcemanager.avs.implementation.AvsClientBuilder; +import com.azure.resourcemanager.avs.implementation.CloudLinksImpl; import com.azure.resourcemanager.avs.implementation.ClustersImpl; +import com.azure.resourcemanager.avs.implementation.DatastoresImpl; +import com.azure.resourcemanager.avs.implementation.GlobalReachConnectionsImpl; import com.azure.resourcemanager.avs.implementation.HcxEnterpriseSitesImpl; import com.azure.resourcemanager.avs.implementation.LocationsImpl; import com.azure.resourcemanager.avs.implementation.OperationsImpl; import com.azure.resourcemanager.avs.implementation.PrivateCloudsImpl; +import com.azure.resourcemanager.avs.implementation.ScriptCmdletsImpl; +import com.azure.resourcemanager.avs.implementation.ScriptExecutionsImpl; +import com.azure.resourcemanager.avs.implementation.ScriptPackagesImpl; +import com.azure.resourcemanager.avs.implementation.WorkloadNetworksImpl; +import com.azure.resourcemanager.avs.models.Addons; import com.azure.resourcemanager.avs.models.Authorizations; +import com.azure.resourcemanager.avs.models.CloudLinks; import com.azure.resourcemanager.avs.models.Clusters; +import com.azure.resourcemanager.avs.models.Datastores; +import com.azure.resourcemanager.avs.models.GlobalReachConnections; import com.azure.resourcemanager.avs.models.HcxEnterpriseSites; import com.azure.resourcemanager.avs.models.Locations; import com.azure.resourcemanager.avs.models.Operations; import com.azure.resourcemanager.avs.models.PrivateClouds; +import com.azure.resourcemanager.avs.models.ScriptCmdlets; +import com.azure.resourcemanager.avs.models.ScriptExecutions; +import com.azure.resourcemanager.avs.models.ScriptPackages; +import com.azure.resourcemanager.avs.models.WorkloadNetworks; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -50,10 +66,26 @@ public final class AvsManager { private Clusters clusters; + private Datastores datastores; + private HcxEnterpriseSites hcxEnterpriseSites; private Authorizations authorizations; + private GlobalReachConnections globalReachConnections; + + private WorkloadNetworks workloadNetworks; + + private CloudLinks cloudLinks; + + private Addons addons; + + private ScriptPackages scriptPackages; + + private ScriptCmdlets scriptCmdlets; + + private ScriptExecutions scriptExecutions; + private final AvsClient clientObject; private AvsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -97,6 +129,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -136,6 +169,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { 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. * @@ -192,6 +236,9 @@ public AvsManager authenticate(TokenCredential credential, AzureProfile profile) userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -201,10 +248,7 @@ public AvsManager authenticate(TokenCredential credential, AzureProfile profile) HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); @@ -249,6 +293,14 @@ public Clusters clusters() { return clusters; } + /** @return Resource collection API of Datastores. */ + public Datastores datastores() { + if (this.datastores == null) { + this.datastores = new DatastoresImpl(clientObject.getDatastores(), this); + } + return datastores; + } + /** @return Resource collection API of HcxEnterpriseSites. */ public HcxEnterpriseSites hcxEnterpriseSites() { if (this.hcxEnterpriseSites == null) { @@ -265,6 +317,63 @@ public Authorizations authorizations() { return authorizations; } + /** @return Resource collection API of GlobalReachConnections. */ + public GlobalReachConnections globalReachConnections() { + if (this.globalReachConnections == null) { + this.globalReachConnections = + new GlobalReachConnectionsImpl(clientObject.getGlobalReachConnections(), this); + } + return globalReachConnections; + } + + /** @return Resource collection API of WorkloadNetworks. */ + public WorkloadNetworks workloadNetworks() { + if (this.workloadNetworks == null) { + this.workloadNetworks = new WorkloadNetworksImpl(clientObject.getWorkloadNetworks(), this); + } + return workloadNetworks; + } + + /** @return Resource collection API of CloudLinks. */ + public CloudLinks cloudLinks() { + if (this.cloudLinks == null) { + this.cloudLinks = new CloudLinksImpl(clientObject.getCloudLinks(), this); + } + return cloudLinks; + } + + /** @return Resource collection API of Addons. */ + public Addons addons() { + if (this.addons == null) { + this.addons = new AddonsImpl(clientObject.getAddons(), this); + } + return addons; + } + + /** @return Resource collection API of ScriptPackages. */ + public ScriptPackages scriptPackages() { + if (this.scriptPackages == null) { + this.scriptPackages = new ScriptPackagesImpl(clientObject.getScriptPackages(), this); + } + return scriptPackages; + } + + /** @return Resource collection API of ScriptCmdlets. */ + public ScriptCmdlets scriptCmdlets() { + if (this.scriptCmdlets == null) { + this.scriptCmdlets = new ScriptCmdletsImpl(clientObject.getScriptCmdlets(), this); + } + return scriptCmdlets; + } + + /** @return Resource collection API of ScriptExecutions. */ + public ScriptExecutions scriptExecutions() { + if (this.scriptExecutions == null) { + this.scriptExecutions = new ScriptExecutionsImpl(clientObject.getScriptExecutions(), this); + } + return scriptExecutions; + } + /** * @return Wrapped service client AvsClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java new file mode 100644 index 000000000000..f428bb60738e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.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.avs.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.avs.fluent.models.AddonInner; + +/** An instance of this class provides access to all the operations defined in AddonsClient. */ +public interface AddonsClient { + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner get(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner createOrUpdate(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner createOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String addonName, Context context); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateCloudName, String addonName); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @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 privateCloudName, String addonName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java index d2f526f7be75..88379d31edc5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java @@ -72,6 +72,13 @@ public interface AvsClient { */ ClustersClient getClusters(); + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + DatastoresClient getDatastores(); + /** * Gets the HcxEnterpriseSitesClient object to access its operations. * @@ -85,4 +92,53 @@ public interface AvsClient { * @return the AuthorizationsClient object. */ AuthorizationsClient getAuthorizations(); + + /** + * Gets the GlobalReachConnectionsClient object to access its operations. + * + * @return the GlobalReachConnectionsClient object. + */ + GlobalReachConnectionsClient getGlobalReachConnections(); + + /** + * Gets the WorkloadNetworksClient object to access its operations. + * + * @return the WorkloadNetworksClient object. + */ + WorkloadNetworksClient getWorkloadNetworks(); + + /** + * Gets the CloudLinksClient object to access its operations. + * + * @return the CloudLinksClient object. + */ + CloudLinksClient getCloudLinks(); + + /** + * Gets the AddonsClient object to access its operations. + * + * @return the AddonsClient object. + */ + AddonsClient getAddons(); + + /** + * Gets the ScriptPackagesClient object to access its operations. + * + * @return the ScriptPackagesClient object. + */ + ScriptPackagesClient getScriptPackages(); + + /** + * Gets the ScriptCmdletsClient object to access its operations. + * + * @return the ScriptCmdletsClient object. + */ + ScriptCmdletsClient getScriptCmdlets(); + + /** + * Gets the ScriptExecutionsClient object to access its operations. + * + * @return the ScriptExecutionsClient object. + */ + ScriptExecutionsClient getScriptExecutions(); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/CloudLinksClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/CloudLinksClient.java new file mode 100644 index 000000000000..facc519f6a28 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/CloudLinksClient.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.CloudLinkInner; + +/** An instance of this class provides access to all the operations defined in CloudLinksClient. */ +public interface CloudLinksClient { + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudLinkInner get(String resourceGroupName, String privateCloudName, String cloudLinkName); + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context); + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudLinkInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink); + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudLinkInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String cloudLinkName, + CloudLinkInner cloudLink, + Context context); + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudLinkInner createOrUpdate( + String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink); + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudLinkInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String cloudLinkName, + CloudLinkInner cloudLink, + Context context); + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String cloudLinkName); + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context); + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String cloudLinkName); + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java new file mode 100644 index 000000000000..8ec6b6554c76 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.DatastoreInner; + +/** An instance of this class provides access to all the operations defined in DatastoresClient. */ +public interface DatastoresClient { + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatastoreInner get(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatastoreInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore); + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatastoreInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context); + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatastoreInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore); + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatastoreInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java new file mode 100644 index 000000000000..8d356f7f0219 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.GlobalReachConnectionInner; + +/** An instance of this class provides access to all the operations defined in GlobalReachConnectionsClient. */ +public interface GlobalReachConnectionsClient { + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalReachConnectionInner get(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @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 global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateCloudName, String globalReachConnectionName); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @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 privateCloudName, String globalReachConnectionName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java index b6b663941fde..fda61e8fb858 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java @@ -266,6 +266,112 @@ PrivateCloudInner update( @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String privateCloudName, Context context); + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateVcenterPassword( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateVcenterPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateNsxtPassword( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateNsxtPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context); + /** * List the admin credentials for the private cloud. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptCmdletsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptCmdletsClient.java new file mode 100644 index 000000000000..7ebee0d5b628 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptCmdletsClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; + +/** An instance of this class provides access to all the operations defined in ScriptCmdletsClient. */ +public interface ScriptCmdletsClient { + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, String scriptPackageName); + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context); + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cmdlet available for script execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScriptCmdletInner get( + String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName); + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @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 cmdlet available for script execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptPackageName, + String scriptCmdletName, + Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptExecutionsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptExecutionsClient.java new file mode 100644 index 000000000000..16ec4c77ba72 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptExecutionsClient.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.ScriptExecutionInner; +import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in ScriptExecutionsClient. */ +public interface ScriptExecutionsClient { + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScriptExecutionInner get(String resourceGroupName, String privateCloudName, String scriptExecutionName); + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context); + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScriptExecutionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution); + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ScriptExecutionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution, + Context context); + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScriptExecutionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution); + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScriptExecutionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution, + Context context); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String scriptExecutionName); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context); + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScriptExecutionInner getExecutionLogs( + String resourceGroupName, String privateCloudName, String scriptExecutionName); + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An + * empty array will return nothing. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getExecutionLogsWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + List scriptOutputStreamType, + Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptPackagesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptPackagesClient.java new file mode 100644 index 000000000000..3634ad3b3ffd --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ScriptPackagesClient.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.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; + +/** An instance of this class provides access to all the operations defined in ScriptPackagesClient. */ +public interface ScriptPackagesClient { + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 script Package resources available for execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScriptPackageInner get(String resourceGroupName, String privateCloudName, String scriptPackageName); + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 script Package resources available for execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java new file mode 100644 index 000000000000..e3a7e6f7f863 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java @@ -0,0 +1,1991 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; + +/** An instance of this class provides access to all the operations defined in WorkloadNetworksClient. */ +public interface WorkloadNetworksClient { + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSegments(String resourceGroupName, String privateCloudName); + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDhcp(String resourceGroupName, String privateCloudName); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDhcp( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, String privateCloudName); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @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 dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGateways(String resourceGroupName, String privateCloudName); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @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 deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVMGroups(String resourceGroupName, String privateCloudName); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVirtualMachineInner getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @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 virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsServices(String resourceGroupName, String privateCloudName); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner getDnsService( + String resourceGroupName, String privateCloudName, String dnsServiceId); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName, Context context); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsZones(String resourceGroupName, String privateCloudName); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context); + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName); + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPublicIPs( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPublicIpInner getPublicIp(String resourceGroupName, String privateCloudName, String publicIpId); + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPublicIpWithResponse( + String resourceGroupName, String privateCloudName, String publicIpId, Context context); + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp); + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + Context context); + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPublicIpInner createPublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp); + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPublicIpInner createPublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + Context context); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeletePublicIp( + String resourceGroupName, String publicIpId, String privateCloudName); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeletePublicIp( + String resourceGroupName, String publicIpId, String privateCloudName, Context context); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java new file mode 100644 index 000000000000..a52acdcab5d1 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.AddonProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An addon resource. */ +@Fluent +public final class AddonInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonInner.class); + + /* + * The properties of an addon resource + */ + @JsonProperty(value = "properties") + private AddonProperties properties; + + /** + * Get the properties property: The properties of an addon resource. + * + * @return the properties value. + */ + public AddonProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of an addon resource. + * + * @param properties the properties value to set. + * @return the AddonInner object itself. + */ + public AddonInner withProperties(AddonProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkInner.java new file mode 100644 index 000000000000..838f75001d9d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.CloudLinkStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A cloud link resource. */ +@JsonFlatten +@Fluent +public class CloudLinkInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudLinkInner.class); + + /* + * The state of the cloud link. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private CloudLinkStatus status; + + /* + * Identifier of the other private cloud participating in the link. + */ + @JsonProperty(value = "properties.linkedCloud") + private String linkedCloud; + + /** + * Get the status property: The state of the cloud link. + * + * @return the status value. + */ + public CloudLinkStatus status() { + return this.status; + } + + /** + * Get the linkedCloud property: Identifier of the other private cloud participating in the link. + * + * @return the linkedCloud value. + */ + public String linkedCloud() { + return this.linkedCloud; + } + + /** + * Set the linkedCloud property: Identifier of the other private cloud participating in the link. + * + * @param linkedCloud the linkedCloud value to set. + * @return the CloudLinkInner object itself. + */ + public CloudLinkInner withLinkedCloud(String linkedCloud) { + this.linkedCloud = linkedCloud; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java new file mode 100644 index 000000000000..7bb6368492e1 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.DatastoreProvisioningState; +import com.azure.resourcemanager.avs.models.DiskPoolVolume; +import com.azure.resourcemanager.avs.models.NetAppVolume; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A datastore resource. */ +@JsonFlatten +@Fluent +public class DatastoreInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatastoreInner.class); + + /* + * The state of the datastore provisioning + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DatastoreProvisioningState provisioningState; + + /* + * An Azure NetApp Files volume + */ + @JsonProperty(value = "properties.netAppVolume") + private NetAppVolume netAppVolume; + + /* + * An iSCSI volume + */ + @JsonProperty(value = "properties.diskPoolVolume") + private DiskPoolVolume diskPoolVolume; + + /** + * Get the provisioningState property: The state of the datastore provisioning. + * + * @return the provisioningState value. + */ + public DatastoreProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the netAppVolume property: An Azure NetApp Files volume. + * + * @return the netAppVolume value. + */ + public NetAppVolume netAppVolume() { + return this.netAppVolume; + } + + /** + * Set the netAppVolume property: An Azure NetApp Files volume. + * + * @param netAppVolume the netAppVolume value to set. + * @return the DatastoreInner object itself. + */ + public DatastoreInner withNetAppVolume(NetAppVolume netAppVolume) { + this.netAppVolume = netAppVolume; + return this; + } + + /** + * Get the diskPoolVolume property: An iSCSI volume. + * + * @return the diskPoolVolume value. + */ + public DiskPoolVolume diskPoolVolume() { + return this.diskPoolVolume; + } + + /** + * Set the diskPoolVolume property: An iSCSI volume. + * + * @param diskPoolVolume the diskPoolVolume value to set. + * @return the DatastoreInner object itself. + */ + public DatastoreInner withDiskPoolVolume(DiskPoolVolume diskPoolVolume) { + this.diskPoolVolume = diskPoolVolume; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (netAppVolume() != null) { + netAppVolume().validate(); + } + if (diskPoolVolume() != null) { + diskPoolVolume().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java new file mode 100644 index 000000000000..899656b7c46c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A global reach connection resource. */ +@JsonFlatten +@Fluent +public class GlobalReachConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalReachConnectionInner.class); + + /* + * The state of the ExpressRoute Circuit Authorization provisioning + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GlobalReachConnectionProvisioningState provisioningState; + + /* + * The network used for global reach carved out from the original network + * block provided for the private cloud + */ + @JsonProperty(value = "properties.addressPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String addressPrefix; + + /* + * Authorization key from the peer express route used for the global reach + * connection + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /* + * The connection status of the global reach connection + */ + @JsonProperty(value = "properties.circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private GlobalReachConnectionStatus circuitConnectionStatus; + + /* + * Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection + */ + @JsonProperty(value = "properties.peerExpressRouteCircuit") + private String peerExpressRouteCircuit; + + /** + * Get the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. + * + * @return the provisioningState value. + */ + public GlobalReachConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the addressPrefix property: The network used for global reach carved out from the original network block + * provided for the private cloud. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Get the authorizationKey property: Authorization key from the peer express route used for the global reach + * connection. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey property: Authorization key from the peer express route used for the global reach + * connection. + * + * @param authorizationKey the authorizationKey value to set. + * @return the GlobalReachConnectionInner object itself. + */ + public GlobalReachConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the circuitConnectionStatus property: The connection status of the global reach connection. + * + * @return the circuitConnectionStatus value. + */ + public GlobalReachConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * + * @return the peerExpressRouteCircuit value. + */ + public String peerExpressRouteCircuit() { + return this.peerExpressRouteCircuit; + } + + /** + * Set the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * + * @param peerExpressRouteCircuit the peerExpressRouteCircuit value to set. + * @return the GlobalReachConnectionInner object itself. + */ + public GlobalReachConnectionInner withPeerExpressRouteCircuit(String peerExpressRouteCircuit) { + this.peerExpressRouteCircuit = peerExpressRouteCircuit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java index 2a86b952bb4f..aaf41537437f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java @@ -74,7 +74,7 @@ public class PrivateCloudInner extends Resource { * (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and * 22 */ - @JsonProperty(value = "properties.networkBlock", required = true) + @JsonProperty(value = "properties.networkBlock") private String networkBlock; /* @@ -121,6 +121,12 @@ public class PrivateCloudInner extends Resource { @JsonProperty(value = "properties.nsxtCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) private String nsxtCertificateThumbprint; + /* + * Array of cloud link IDs from other clouds that connect to this one + */ + @JsonProperty(value = "properties.externalCloudLinks", access = JsonProperty.Access.WRITE_ONLY) + private List externalCloudLinks; + /** * Get the sku property: The private cloud SKU. * @@ -348,6 +354,15 @@ public String nsxtCertificateThumbprint() { return this.nsxtCertificateThumbprint; } + /** + * Get the externalCloudLinks property: Array of cloud link IDs from other clouds that connect to this one. + * + * @return the externalCloudLinks value. + */ + public List externalCloudLinks() { + return this.externalCloudLinks; + } + /** {@inheritDoc} */ @Override public PrivateCloudInner withLocation(String location) { @@ -387,10 +402,5 @@ public void validate() { if (endpoints() != null) { endpoints().validate(); } - if (networkBlock() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property networkBlock in model PrivateCloudInner")); - } } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java new file mode 100644 index 000000000000..94d0a74d30b9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.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.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.ScriptParameter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A cmdlet available for script execution. */ +@JsonFlatten +@Immutable +public class ScriptCmdletInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptCmdletInner.class); + + /* + * Description of the scripts functionality + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Recommended time limit for execution + */ + @JsonProperty(value = "properties.timeout", access = JsonProperty.Access.WRITE_ONLY) + private String timeout; + + /* + * Parameters the script will accept + */ + @JsonProperty(value = "properties.parameters", access = JsonProperty.Access.WRITE_ONLY) + private List parameters; + + /** + * Get the description property: Description of the scripts functionality. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the timeout property: Recommended time limit for execution. + * + * @return the timeout value. + */ + public String timeout() { + return this.timeout; + } + + /** + * Get the parameters property: Parameters the script will accept. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java new file mode 100644 index 000000000000..29aab961d714 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; +import com.azure.resourcemanager.avs.models.ScriptExecutionProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An instance of a script executed by a user - custom or AVS. */ +@JsonFlatten +@Fluent +public class ScriptExecutionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptExecutionInner.class); + + /* + * A reference to the script cmdlet resource if user is running a AVS + * script + */ + @JsonProperty(value = "properties.scriptCmdletId") + private String scriptCmdletId; + + /* + * Parameters the script will accept + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /* + * Parameters that will be hidden/not visible to ARM, such as passwords and + * credentials + */ + @JsonProperty(value = "properties.hiddenParameters") + private List hiddenParameters; + + /* + * Error message if the script was able to run, but if the script itself + * had errors or powershell threw an exception + */ + @JsonProperty(value = "properties.failureReason") + private String failureReason; + + /* + * Time limit for execution + */ + @JsonProperty(value = "properties.timeout") + private String timeout; + + /* + * Time to live for the resource. If not provided, will be available for 60 + * days + */ + @JsonProperty(value = "properties.retention") + private String retention; + + /* + * Time the script execution was submitted + */ + @JsonProperty(value = "properties.submittedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime submittedAt; + + /* + * Time the script execution was started + */ + @JsonProperty(value = "properties.startedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedAt; + + /* + * Time the script execution was finished + */ + @JsonProperty(value = "properties.finishedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime finishedAt; + + /* + * The state of the script execution resource + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ScriptExecutionProvisioningState provisioningState; + + /* + * Standard output stream from the powershell execution + */ + @JsonProperty(value = "properties.output") + private List output; + + /* + * User-defined dictionary. + */ + @JsonProperty(value = "properties.namedOutputs") + private Map namedOutputs; + + /* + * Standard information out stream from the powershell execution + */ + @JsonProperty(value = "properties.information", access = JsonProperty.Access.WRITE_ONLY) + private List information; + + /* + * Standard warning out stream from the powershell execution + */ + @JsonProperty(value = "properties.warnings", access = JsonProperty.Access.WRITE_ONLY) + private List warnings; + + /* + * Standard error output stream from the powershell execution + */ + @JsonProperty(value = "properties.errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * Get the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS script. + * + * @return the scriptCmdletId value. + */ + public String scriptCmdletId() { + return this.scriptCmdletId; + } + + /** + * Set the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS script. + * + * @param scriptCmdletId the scriptCmdletId value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withScriptCmdletId(String scriptCmdletId) { + this.scriptCmdletId = scriptCmdletId; + return this; + } + + /** + * Get the parameters property: Parameters the script will accept. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters the script will accept. + * + * @param parameters the parameters value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as passwords and + * credentials. + * + * @return the hiddenParameters value. + */ + public List hiddenParameters() { + return this.hiddenParameters; + } + + /** + * Set the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as passwords and + * credentials. + * + * @param hiddenParameters the hiddenParameters value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withHiddenParameters(List hiddenParameters) { + this.hiddenParameters = hiddenParameters; + return this; + } + + /** + * Get the failureReason property: Error message if the script was able to run, but if the script itself had errors + * or powershell threw an exception. + * + * @return the failureReason value. + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Set the failureReason property: Error message if the script was able to run, but if the script itself had errors + * or powershell threw an exception. + * + * @param failureReason the failureReason value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withFailureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * Get the timeout property: Time limit for execution. + * + * @return the timeout value. + */ + public String timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Time limit for execution. + * + * @param timeout the timeout value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withTimeout(String timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the retention property: Time to live for the resource. If not provided, will be available for 60 days. + * + * @return the retention value. + */ + public String retention() { + return this.retention; + } + + /** + * Set the retention property: Time to live for the resource. If not provided, will be available for 60 days. + * + * @param retention the retention value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withRetention(String retention) { + this.retention = retention; + return this; + } + + /** + * Get the submittedAt property: Time the script execution was submitted. + * + * @return the submittedAt value. + */ + public OffsetDateTime submittedAt() { + return this.submittedAt; + } + + /** + * Get the startedAt property: Time the script execution was started. + * + * @return the startedAt value. + */ + public OffsetDateTime startedAt() { + return this.startedAt; + } + + /** + * Get the finishedAt property: Time the script execution was finished. + * + * @return the finishedAt value. + */ + public OffsetDateTime finishedAt() { + return this.finishedAt; + } + + /** + * Get the provisioningState property: The state of the script execution resource. + * + * @return the provisioningState value. + */ + public ScriptExecutionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the output property: Standard output stream from the powershell execution. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** + * Set the output property: Standard output stream from the powershell execution. + * + * @param output the output value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withOutput(List output) { + this.output = output; + return this; + } + + /** + * Get the namedOutputs property: User-defined dictionary. + * + * @return the namedOutputs value. + */ + public Map namedOutputs() { + return this.namedOutputs; + } + + /** + * Set the namedOutputs property: User-defined dictionary. + * + * @param namedOutputs the namedOutputs value to set. + * @return the ScriptExecutionInner object itself. + */ + public ScriptExecutionInner withNamedOutputs(Map namedOutputs) { + this.namedOutputs = namedOutputs; + return this; + } + + /** + * Get the information property: Standard information out stream from the powershell execution. + * + * @return the information value. + */ + public List information() { + return this.information; + } + + /** + * Get the warnings property: Standard warning out stream from the powershell execution. + * + * @return the warnings value. + */ + public List warnings() { + return this.warnings; + } + + /** + * Get the errors property: Standard error output stream from the powershell execution. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + if (hiddenParameters() != null) { + hiddenParameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java new file mode 100644 index 000000000000..372da6dd2dec --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Script Package resources available for execution. */ +@JsonFlatten +@Immutable +public class ScriptPackageInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptPackageInner.class); + + /* + * User friendly description of the package + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Module version + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Get the description property: User friendly description of the package. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the version property: Module version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java new file mode 100644 index 000000000000..60e0c24d723c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpEntity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX DHCP. */ +@Fluent +public final class WorkloadNetworkDhcpInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpInner.class); + + /* + * DHCP properties. + */ + @JsonProperty(value = "properties") + private WorkloadNetworkDhcpEntity properties; + + /** + * Get the properties property: DHCP properties. + * + * @return the properties value. + */ + public WorkloadNetworkDhcpEntity properties() { + return this.properties; + } + + /** + * Set the properties property: DHCP properties. + * + * @param properties the properties value to set. + * @return the WorkloadNetworkDhcpInner object itself. + */ + public WorkloadNetworkDhcpInner withProperties(WorkloadNetworkDhcpEntity properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java new file mode 100644 index 000000000000..237872d1bd2f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.DnsServiceStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX DNS Service. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkDnsServiceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsServiceInner.class); + + /* + * Display name of the DNS Service. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * DNS service IP of the DNS Service. + */ + @JsonProperty(value = "properties.dnsServiceIp") + private String dnsServiceIp; + + /* + * Default DNS zone of the DNS Service. + */ + @JsonProperty(value = "properties.defaultDnsZone") + private String defaultDnsZone; + + /* + * FQDN zones of the DNS Service. + */ + @JsonProperty(value = "properties.fqdnZones") + private List fqdnZones; + + /* + * DNS Service log level. + */ + @JsonProperty(value = "properties.logLevel") + private DnsServiceLogLevelEnum logLevel; + + /* + * DNS Service status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private DnsServiceStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDnsServiceProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the DNS Service. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DNS Service. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the dnsServiceIp property: DNS service IP of the DNS Service. + * + * @return the dnsServiceIp value. + */ + public String dnsServiceIp() { + return this.dnsServiceIp; + } + + /** + * Set the dnsServiceIp property: DNS service IP of the DNS Service. + * + * @param dnsServiceIp the dnsServiceIp value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withDnsServiceIp(String dnsServiceIp) { + this.dnsServiceIp = dnsServiceIp; + return this; + } + + /** + * Get the defaultDnsZone property: Default DNS zone of the DNS Service. + * + * @return the defaultDnsZone value. + */ + public String defaultDnsZone() { + return this.defaultDnsZone; + } + + /** + * Set the defaultDnsZone property: Default DNS zone of the DNS Service. + * + * @param defaultDnsZone the defaultDnsZone value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withDefaultDnsZone(String defaultDnsZone) { + this.defaultDnsZone = defaultDnsZone; + return this; + } + + /** + * Get the fqdnZones property: FQDN zones of the DNS Service. + * + * @return the fqdnZones value. + */ + public List fqdnZones() { + return this.fqdnZones; + } + + /** + * Set the fqdnZones property: FQDN zones of the DNS Service. + * + * @param fqdnZones the fqdnZones value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withFqdnZones(List fqdnZones) { + this.fqdnZones = fqdnZones; + return this; + } + + /** + * Get the logLevel property: DNS Service log level. + * + * @return the logLevel value. + */ + public DnsServiceLogLevelEnum logLevel() { + return this.logLevel; + } + + /** + * Set the logLevel property: DNS Service log level. + * + * @param logLevel the logLevel value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withLogLevel(DnsServiceLogLevelEnum logLevel) { + this.logLevel = logLevel; + return this; + } + + /** + * Get the status property: DNS Service status. + * + * @return the status value. + */ + public DnsServiceStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkDnsServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java new file mode 100644 index 000000000000..ab9f9c002bda --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.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.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX DNS Zone. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkDnsZoneInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsZoneInner.class); + + /* + * Display name of the DNS Zone. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Domain names of the DNS Zone. + */ + @JsonProperty(value = "properties.domain") + private List domain; + + /* + * DNS Server IP array of the DNS Zone. + */ + @JsonProperty(value = "properties.dnsServerIps") + private List dnsServerIps; + + /* + * Source IP of the DNS Zone. + */ + @JsonProperty(value = "properties.sourceIp") + private String sourceIp; + + /* + * Number of DNS Services using the DNS zone. + */ + @JsonProperty(value = "properties.dnsServices") + private Long dnsServices; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDnsZoneProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the DNS Zone. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DNS Zone. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the domain property: Domain names of the DNS Zone. + * + * @return the domain value. + */ + public List domain() { + return this.domain; + } + + /** + * Set the domain property: Domain names of the DNS Zone. + * + * @param domain the domain value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDomain(List domain) { + this.domain = domain; + return this; + } + + /** + * Get the dnsServerIps property: DNS Server IP array of the DNS Zone. + * + * @return the dnsServerIps value. + */ + public List dnsServerIps() { + return this.dnsServerIps; + } + + /** + * Set the dnsServerIps property: DNS Server IP array of the DNS Zone. + * + * @param dnsServerIps the dnsServerIps value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDnsServerIps(List dnsServerIps) { + this.dnsServerIps = dnsServerIps; + return this; + } + + /** + * Get the sourceIp property: Source IP of the DNS Zone. + * + * @return the sourceIp value. + */ + public String sourceIp() { + return this.sourceIp; + } + + /** + * Set the sourceIp property: Source IP of the DNS Zone. + * + * @param sourceIp the sourceIp value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withSourceIp(String sourceIp) { + this.sourceIp = sourceIp; + return this; + } + + /** + * Get the dnsServices property: Number of DNS Services using the DNS zone. + * + * @return the dnsServices value. + */ + public Long dnsServices() { + return this.dnsServices; + } + + /** + * Set the dnsServices property: Number of DNS Services using the DNS zone. + * + * @param dnsServices the dnsServices value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDnsServices(Long dnsServices) { + this.dnsServices = dnsServices; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkDnsZoneProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java new file mode 100644 index 000000000000..941d791f1645 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX Gateway. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkGatewayInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkGatewayInner.class); + + /* + * Display name of the DHCP entity. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * NSX Gateway Path. + */ + @JsonProperty(value = "properties.path", access = JsonProperty.Access.WRITE_ONLY) + private String path; + + /** + * Get the displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DHCP entity. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkGatewayInner object itself. + */ + public WorkloadNetworkGatewayInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the path property: NSX Gateway Path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java new file mode 100644 index 000000000000..a28735c0b825 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.PortMirroringStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX Port Mirroring. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkPortMirroringInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkPortMirroringInner.class); + + /* + * Display name of the port mirroring profile. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Direction of port mirroring profile. + */ + @JsonProperty(value = "properties.direction") + private PortMirroringDirectionEnum direction; + + /* + * Source VM Group. + */ + @JsonProperty(value = "properties.source") + private String source; + + /* + * Destination VM Group. + */ + @JsonProperty(value = "properties.destination") + private String destination; + + /* + * Port Mirroring Status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private PortMirroringStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkPortMirroringProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the port mirroring profile. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the port mirroring profile. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the direction property: Direction of port mirroring profile. + * + * @return the direction value. + */ + public PortMirroringDirectionEnum direction() { + return this.direction; + } + + /** + * Set the direction property: Direction of port mirroring profile. + * + * @param direction the direction value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withDirection(PortMirroringDirectionEnum direction) { + this.direction = direction; + return this; + } + + /** + * Get the source property: Source VM Group. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source VM Group. + * + * @param source the source value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination VM Group. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Destination VM Group. + * + * @param destination the destination value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the status property: Port Mirroring Status. + * + * @return the status value. + */ + public PortMirroringStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkPortMirroringProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java new file mode 100644 index 000000000000..cd916299cb8f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX Public IP Block. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkPublicIpInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkPublicIpInner.class); + + /* + * Display name of the Public IP Block. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Number of Public IPs requested. + */ + @JsonProperty(value = "properties.numberOfPublicIPs") + private Long numberOfPublicIPs; + + /* + * CIDR Block of the Public IP Block. + */ + @JsonProperty(value = "properties.publicIPBlock", access = JsonProperty.Access.WRITE_ONLY) + private String publicIpBlock; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkPublicIpProvisioningState provisioningState; + + /** + * Get the displayName property: Display name of the Public IP Block. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the Public IP Block. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkPublicIpInner object itself. + */ + public WorkloadNetworkPublicIpInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the numberOfPublicIPs property: Number of Public IPs requested. + * + * @return the numberOfPublicIPs value. + */ + public Long numberOfPublicIPs() { + return this.numberOfPublicIPs; + } + + /** + * Set the numberOfPublicIPs property: Number of Public IPs requested. + * + * @param numberOfPublicIPs the numberOfPublicIPs value to set. + * @return the WorkloadNetworkPublicIpInner object itself. + */ + public WorkloadNetworkPublicIpInner withNumberOfPublicIPs(Long numberOfPublicIPs) { + this.numberOfPublicIPs = numberOfPublicIPs; + return this; + } + + /** + * Get the publicIpBlock property: CIDR Block of the Public IP Block. + * + * @return the publicIpBlock value. + */ + public String publicIpBlock() { + return this.publicIpBlock; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkPublicIpProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java new file mode 100644 index 000000000000..7c2bf99df503 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.SegmentStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX Segment. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkSegmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentInner.class); + + /* + * Display name of the segment. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Gateway which to connect segment to. + */ + @JsonProperty(value = "properties.connectedGateway") + private String connectedGateway; + + /* + * Subnet which to connect segment to. + */ + @JsonProperty(value = "properties.subnet") + private WorkloadNetworkSegmentSubnet subnet; + + /* + * Port Vif which segment is associated with. + */ + @JsonProperty(value = "properties.portVif", access = JsonProperty.Access.WRITE_ONLY) + private List portVif; + + /* + * Segment status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private SegmentStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkSegmentProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the segment. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the segment. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the connectedGateway property: Gateway which to connect segment to. + * + * @return the connectedGateway value. + */ + public String connectedGateway() { + return this.connectedGateway; + } + + /** + * Set the connectedGateway property: Gateway which to connect segment to. + * + * @param connectedGateway the connectedGateway value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withConnectedGateway(String connectedGateway) { + this.connectedGateway = connectedGateway; + return this; + } + + /** + * Get the subnet property: Subnet which to connect segment to. + * + * @return the subnet value. + */ + public WorkloadNetworkSegmentSubnet subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Subnet which to connect segment to. + * + * @param subnet the subnet value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withSubnet(WorkloadNetworkSegmentSubnet subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the portVif property: Port Vif which segment is associated with. + * + * @return the portVif value. + */ + public List portVif() { + return this.portVif; + } + + /** + * Get the status property: Segment status. + * + * @return the status value. + */ + public SegmentStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkSegmentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (portVif() != null) { + portVif().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java new file mode 100644 index 000000000000..510d3a0e19f2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.VMGroupStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX VM Group. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkVMGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVMGroupInner.class); + + /* + * Display name of the VM group. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Virtual machine members of this group. + */ + @JsonProperty(value = "properties.members") + private List members; + + /* + * VM Group status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private VMGroupStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkVMGroupProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the VM group. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the VM group. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkVMGroupInner object itself. + */ + public WorkloadNetworkVMGroupInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the members property: Virtual machine members of this group. + * + * @return the members value. + */ + public List members() { + return this.members; + } + + /** + * Set the members property: Virtual machine members of this group. + * + * @param members the members value to set. + * @return the WorkloadNetworkVMGroupInner object itself. + */ + public WorkloadNetworkVMGroupInner withMembers(List members) { + this.members = members; + return this; + } + + /** + * Get the status property: VM Group status. + * + * @return the status value. + */ + public VMGroupStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkVMGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkVMGroupInner object itself. + */ + public WorkloadNetworkVMGroupInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java new file mode 100644 index 000000000000..680961140548 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.VMTypeEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX Virtual Machine. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkVirtualMachineInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVirtualMachineInner.class); + + /* + * Display name of the VM. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Virtual machine type. + */ + @JsonProperty(value = "properties.vmType", access = JsonProperty.Access.WRITE_ONLY) + private VMTypeEnum vmType; + + /** + * Get the displayName property: Display name of the VM. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the VM. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkVirtualMachineInner object itself. + */ + public WorkloadNetworkVirtualMachineInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the vmType property: Virtual machine type. + * + * @return the vmType value. + */ + public VMTypeEnum vmType() { + return this.vmType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java new file mode 100644 index 000000000000..fa3fbc5a6658 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.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.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.azure.resourcemanager.avs.models.Addon; +import com.azure.resourcemanager.avs.models.AddonProperties; + +public final class AddonImpl implements Addon, Addon.Definition, Addon.Update { + private AddonInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AddonProperties properties() { + return this.innerModel().properties(); + } + + public AddonInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String addonName; + + public AddonImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public Addon create() { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), Context.NONE); + return this; + } + + public Addon create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), context); + return this; + } + + AddonImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new AddonInner(); + this.serviceManager = serviceManager; + this.addonName = name; + } + + public AddonImpl update() { + return this; + } + + public Addon apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), Context.NONE); + return this; + } + + public Addon apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), context); + return this; + } + + AddonImpl(AddonInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.addonName = Utils.getValueFromIdByName(innerObject.id(), "addons"); + } + + public Addon refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .getWithResponse(resourceGroupName, privateCloudName, addonName, Context.NONE) + .getValue(); + return this; + } + + public Addon refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .getWithResponse(resourceGroupName, privateCloudName, addonName, context) + .getValue(); + return this; + } + + public AddonImpl withProperties(AddonProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java new file mode 100644 index 000000000000..847990c45d0f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java @@ -0,0 +1,1093 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.AddonsClient; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.azure.resourcemanager.avs.models.AddonList; +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 AddonsClient. */ +public final class AddonsClientImpl implements AddonsClient { + private final ClientLogger logger = new ClientLogger(AddonsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AddonsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of AddonsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AddonsClientImpl(AvsClientImpl client) { + this.service = RestProxy.create(AddonsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientAddons to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientAddons") + private interface AddonsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("addonName") String addonName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("addonName") String addonName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AddonInner addon, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("addonName") String addonName, + @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 addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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 addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName 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, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName 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, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, String addonName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, addonName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner get(String resourceGroupName, String privateCloudName, String addonName) { + return getAsync(resourceGroupName, privateCloudName, addonName).block(); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, addonName, context).block(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + return Mono.error(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + addon, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + return Mono.error(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + addon, + accept, + context); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AddonInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, addonName, addon); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AddonInner.class, AddonInner.class, Context.NONE); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AddonInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, addonName, addon, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AddonInner.class, AddonInner.class, context); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon).getSyncPoller(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context).getSyncPoller(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner createOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon).block(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner createOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context).block(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName 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, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String addonName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName, addonName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, addonName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String addonName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName).getSyncPoller(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName, context).getSyncPoller(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String addonName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 privateCloudName, String addonName) { + deleteAsync(resourceGroupName, privateCloudName, addonName).block(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @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 privateCloudName, String addonName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, addonName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java new file mode 100644 index 000000000000..abdae483097d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.AddonsClient; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.azure.resourcemanager.avs.models.Addon; +import com.azure.resourcemanager.avs.models.Addons; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AddonsImpl implements Addons { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonsImpl.class); + + private final AddonsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public AddonsImpl(AddonsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new AddonImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new AddonImpl(inner1, this.manager())); + } + + public Addon get(String resourceGroupName, String privateCloudName, String addonName) { + AddonInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, addonName); + if (inner != null) { + return new AddonImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, addonName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AddonImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String addonName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, addonName); + } + + public void delete(String resourceGroupName, String privateCloudName, String addonName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, addonName, context); + } + + public Addon 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, addonName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, addonName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + this.delete(resourceGroupName, privateCloudName, addonName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + this.delete(resourceGroupName, privateCloudName, addonName, context); + } + + private AddonsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public AddonImpl define(String name) { + return new AddonImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java index e1885413f3e0..58bba57d842a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java @@ -21,13 +21,21 @@ 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.avs.fluent.AddonsClient; import com.azure.resourcemanager.avs.fluent.AuthorizationsClient; import com.azure.resourcemanager.avs.fluent.AvsClient; +import com.azure.resourcemanager.avs.fluent.CloudLinksClient; import com.azure.resourcemanager.avs.fluent.ClustersClient; +import com.azure.resourcemanager.avs.fluent.DatastoresClient; +import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; import com.azure.resourcemanager.avs.fluent.LocationsClient; import com.azure.resourcemanager.avs.fluent.OperationsClient; import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; +import com.azure.resourcemanager.avs.fluent.ScriptCmdletsClient; +import com.azure.resourcemanager.avs.fluent.ScriptExecutionsClient; +import com.azure.resourcemanager.avs.fluent.ScriptPackagesClient; +import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -163,6 +171,18 @@ public ClustersClient getClusters() { return this.clusters; } + /** The DatastoresClient object to access its operations. */ + private final DatastoresClient datastores; + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + public DatastoresClient getDatastores() { + return this.datastores; + } + /** The HcxEnterpriseSitesClient object to access its operations. */ private final HcxEnterpriseSitesClient hcxEnterpriseSites; @@ -187,6 +207,90 @@ public AuthorizationsClient getAuthorizations() { return this.authorizations; } + /** The GlobalReachConnectionsClient object to access its operations. */ + private final GlobalReachConnectionsClient globalReachConnections; + + /** + * Gets the GlobalReachConnectionsClient object to access its operations. + * + * @return the GlobalReachConnectionsClient object. + */ + public GlobalReachConnectionsClient getGlobalReachConnections() { + return this.globalReachConnections; + } + + /** The WorkloadNetworksClient object to access its operations. */ + private final WorkloadNetworksClient workloadNetworks; + + /** + * Gets the WorkloadNetworksClient object to access its operations. + * + * @return the WorkloadNetworksClient object. + */ + public WorkloadNetworksClient getWorkloadNetworks() { + return this.workloadNetworks; + } + + /** The CloudLinksClient object to access its operations. */ + private final CloudLinksClient cloudLinks; + + /** + * Gets the CloudLinksClient object to access its operations. + * + * @return the CloudLinksClient object. + */ + public CloudLinksClient getCloudLinks() { + return this.cloudLinks; + } + + /** The AddonsClient object to access its operations. */ + private final AddonsClient addons; + + /** + * Gets the AddonsClient object to access its operations. + * + * @return the AddonsClient object. + */ + public AddonsClient getAddons() { + return this.addons; + } + + /** The ScriptPackagesClient object to access its operations. */ + private final ScriptPackagesClient scriptPackages; + + /** + * Gets the ScriptPackagesClient object to access its operations. + * + * @return the ScriptPackagesClient object. + */ + public ScriptPackagesClient getScriptPackages() { + return this.scriptPackages; + } + + /** The ScriptCmdletsClient object to access its operations. */ + private final ScriptCmdletsClient scriptCmdlets; + + /** + * Gets the ScriptCmdletsClient object to access its operations. + * + * @return the ScriptCmdletsClient object. + */ + public ScriptCmdletsClient getScriptCmdlets() { + return this.scriptCmdlets; + } + + /** The ScriptExecutionsClient object to access its operations. */ + private final ScriptExecutionsClient scriptExecutions; + + /** + * Gets the ScriptExecutionsClient object to access its operations. + * + * @return the ScriptExecutionsClient object. + */ + public ScriptExecutionsClient getScriptExecutions() { + return this.scriptExecutions; + } + /** * Initializes an instance of AvsClient client. * @@ -209,13 +313,21 @@ public AuthorizationsClient getAuthorizations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-03-20"; + this.apiVersion = "2021-06-01"; this.operations = new OperationsClientImpl(this); this.locations = new LocationsClientImpl(this); this.privateClouds = new PrivateCloudsClientImpl(this); this.clusters = new ClustersClientImpl(this); + this.datastores = new DatastoresClientImpl(this); this.hcxEnterpriseSites = new HcxEnterpriseSitesClientImpl(this); this.authorizations = new AuthorizationsClientImpl(this); + this.globalReachConnections = new GlobalReachConnectionsClientImpl(this); + this.workloadNetworks = new WorkloadNetworksClientImpl(this); + this.cloudLinks = new CloudLinksClientImpl(this); + this.addons = new AddonsClientImpl(this); + this.scriptPackages = new ScriptPackagesClientImpl(this); + this.scriptCmdlets = new ScriptCmdletsClientImpl(this); + this.scriptExecutions = new ScriptExecutionsClientImpl(this); } /** diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinkImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinkImpl.java new file mode 100644 index 000000000000..04aadc494ec6 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinkImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; +import com.azure.resourcemanager.avs.models.CloudLink; +import com.azure.resourcemanager.avs.models.CloudLinkStatus; + +public final class CloudLinkImpl implements CloudLink, CloudLink.Definition, CloudLink.Update { + private CloudLinkInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CloudLinkStatus status() { + return this.innerModel().status(); + } + + public String linkedCloud() { + return this.innerModel().linkedCloud(); + } + + public CloudLinkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String cloudLinkName; + + public CloudLinkImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public CloudLink create() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudLinks() + .createOrUpdate(resourceGroupName, privateCloudName, cloudLinkName, this.innerModel(), Context.NONE); + return this; + } + + public CloudLink create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudLinks() + .createOrUpdate(resourceGroupName, privateCloudName, cloudLinkName, this.innerModel(), context); + return this; + } + + CloudLinkImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new CloudLinkInner(); + this.serviceManager = serviceManager; + this.cloudLinkName = name; + } + + public CloudLinkImpl update() { + return this; + } + + public CloudLink apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudLinks() + .createOrUpdate(resourceGroupName, privateCloudName, cloudLinkName, this.innerModel(), Context.NONE); + return this; + } + + public CloudLink apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudLinks() + .createOrUpdate(resourceGroupName, privateCloudName, cloudLinkName, this.innerModel(), context); + return this; + } + + CloudLinkImpl(CloudLinkInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.cloudLinkName = Utils.getValueFromIdByName(innerObject.id(), "cloudLinks"); + } + + public CloudLink refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudLinks() + .getWithResponse(resourceGroupName, privateCloudName, cloudLinkName, Context.NONE) + .getValue(); + return this; + } + + public CloudLink refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudLinks() + .getWithResponse(resourceGroupName, privateCloudName, cloudLinkName, context) + .getValue(); + return this; + } + + public CloudLinkImpl withLinkedCloud(String linkedCloud) { + this.innerModel().withLinkedCloud(linkedCloud); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java new file mode 100644 index 000000000000..b48ea493c304 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java @@ -0,0 +1,1116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.CloudLinksClient; +import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; +import com.azure.resourcemanager.avs.models.CloudLinkList; +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 CloudLinksClient. */ +public final class CloudLinksClientImpl implements CloudLinksClient { + private final ClientLogger logger = new ClientLogger(CloudLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudLinksService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of CloudLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudLinksClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(CloudLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientCloudLinks to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientCloudLinks") + private interface CloudLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/cloudLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/cloudLinks/{cloudLinkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("cloudLinkName") String cloudLinkName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/cloudLinks/{cloudLinkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("cloudLinkName") String cloudLinkName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CloudLinkInner cloudLink, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/cloudLinks/{cloudLinkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("cloudLinkName") String cloudLinkName, + @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 cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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 cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName 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, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + cloudLinkName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName 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, + privateCloudName, + cloudLinkName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, String cloudLinkName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudLinkInner get(String resourceGroupName, String privateCloudName, String cloudLinkName) { + return getAsync(resourceGroupName, privateCloudName, cloudLinkName).block(); + } + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, context).block(); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + if (cloudLink == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); + } else { + cloudLink.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + cloudLinkName, + this.client.getApiVersion(), + cloudLink, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String cloudLinkName, + CloudLinkInner cloudLink, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + if (cloudLink == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); + } else { + cloudLink.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + cloudLinkName, + this.client.getApiVersion(), + cloudLink, + accept, + context); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudLinkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudLinkInner.class, CloudLinkInner.class, Context.NONE); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudLinkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String cloudLinkName, + CloudLinkInner cloudLink, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudLinkInner.class, CloudLinkInner.class, context); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudLinkInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink).getSyncPoller(); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudLinkInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String cloudLinkName, + CloudLinkInner cloudLink, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context) + .getSyncPoller(); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String cloudLinkName, + CloudLinkInner cloudLink, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudLinkInner createOrUpdate( + String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink).block(); + } + + /** + * Create or update a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param cloudLink A cloud link in the private cloud. + * @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 cloud link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudLinkInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String cloudLinkName, + CloudLinkInner cloudLink, + Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, cloudLinkName, cloudLink, context).block(); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + cloudLinkName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName 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, + privateCloudName, + cloudLinkName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, cloudLinkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String cloudLinkName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName).getSyncPoller(); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName, context).getSyncPoller(); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String cloudLinkName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, cloudLinkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String cloudLinkName) { + deleteAsync(resourceGroupName, privateCloudName, cloudLinkName).block(); + } + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, cloudLinkName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of cloud links. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of cloud links. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksImpl.java new file mode 100644 index 000000000000..bf4cbf3ee8fa --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.CloudLinksClient; +import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; +import com.azure.resourcemanager.avs.models.CloudLink; +import com.azure.resourcemanager.avs.models.CloudLinks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CloudLinksImpl implements CloudLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudLinksImpl.class); + + private final CloudLinksClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public CloudLinksImpl(CloudLinksClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new CloudLinkImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new CloudLinkImpl(inner1, this.manager())); + } + + public CloudLink get(String resourceGroupName, String privateCloudName, String cloudLinkName) { + CloudLinkInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, cloudLinkName); + if (inner != null) { + return new CloudLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, cloudLinkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String cloudLinkName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, cloudLinkName); + } + + public void delete(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, cloudLinkName, context); + } + + public CloudLink 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String cloudLinkName = Utils.getValueFromIdByName(id, "cloudLinks"); + if (cloudLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudLinks'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, cloudLinkName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String cloudLinkName = Utils.getValueFromIdByName(id, "cloudLinks"); + if (cloudLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudLinks'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, cloudLinkName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String cloudLinkName = Utils.getValueFromIdByName(id, "cloudLinks"); + if (cloudLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudLinks'.", id))); + } + this.delete(resourceGroupName, privateCloudName, cloudLinkName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String cloudLinkName = Utils.getValueFromIdByName(id, "cloudLinks"); + if (cloudLinkName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudLinks'.", id))); + } + this.delete(resourceGroupName, privateCloudName, cloudLinkName, context); + } + + private CloudLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public CloudLinkImpl define(String name) { + return new CloudLinkImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java new file mode 100644 index 000000000000..e5ebe29633b4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.azure.resourcemanager.avs.models.Datastore; +import com.azure.resourcemanager.avs.models.DatastoreProvisioningState; +import com.azure.resourcemanager.avs.models.DiskPoolVolume; +import com.azure.resourcemanager.avs.models.NetAppVolume; + +public final class DatastoreImpl implements Datastore, Datastore.Definition, Datastore.Update { + private DatastoreInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatastoreProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetAppVolume netAppVolume() { + return this.innerModel().netAppVolume(); + } + + public DiskPoolVolume diskPoolVolume() { + return this.innerModel().diskPoolVolume(); + } + + public DatastoreInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String clusterName; + + private String datastoreName; + + public DatastoreImpl withExistingCluster(String resourceGroupName, String privateCloudName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + this.clusterName = clusterName; + return this; + } + + public Datastore create() { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .createOrUpdate( + resourceGroupName, privateCloudName, clusterName, datastoreName, this.innerModel(), Context.NONE); + return this; + } + + public Datastore create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .createOrUpdate( + resourceGroupName, privateCloudName, clusterName, datastoreName, this.innerModel(), context); + return this; + } + + DatastoreImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new DatastoreInner(); + this.serviceManager = serviceManager; + this.datastoreName = name; + } + + public DatastoreImpl update() { + return this; + } + + public Datastore apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .createOrUpdate( + resourceGroupName, privateCloudName, clusterName, datastoreName, this.innerModel(), Context.NONE); + return this; + } + + public Datastore apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .createOrUpdate( + resourceGroupName, privateCloudName, clusterName, datastoreName, this.innerModel(), context); + return this; + } + + DatastoreImpl(DatastoreInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.datastoreName = Utils.getValueFromIdByName(innerObject.id(), "datastores"); + } + + public Datastore refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, Context.NONE) + .getValue(); + return this; + } + + public Datastore refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, context) + .getValue(); + return this; + } + + public DatastoreImpl withNetAppVolume(NetAppVolume netAppVolume) { + this.innerModel().withNetAppVolume(netAppVolume); + return this; + } + + public DatastoreImpl withDiskPoolVolume(DiskPoolVolume diskPoolVolume) { + this.innerModel().withDiskPoolVolume(diskPoolVolume); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java new file mode 100644 index 000000000000..ee56af5d7964 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java @@ -0,0 +1,1221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.DatastoresClient; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.azure.resourcemanager.avs.models.DatastoreList; +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 DatastoresClient. */ +public final class DatastoresClientImpl implements DatastoresClient { + private final ClientLogger logger = new ClientLogger(DatastoresClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DatastoresService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of DatastoresClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatastoresClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(DatastoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientDatastores to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientDatastores") + private interface DatastoresService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatastoreInner datastore, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, + @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 datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + 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 datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName)); + } + + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @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 paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName, context)); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName 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, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatastoreInner get( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return getAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).block(); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context).block(); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + return Mono.error(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + datastore, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + return Mono.error(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + datastore, + accept, + context); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatastoreInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatastoreInner.class, DatastoreInner.class, Context.NONE); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatastoreInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatastoreInner.class, DatastoreInner.class, context); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatastoreInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore) + .getSyncPoller(); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatastoreInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context) + .getSyncPoller(); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatastoreInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore).block(); + } + + /** + * Create or update a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatastoreInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context) + .block(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName 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, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).getSyncPoller(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context) + .getSyncPoller(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + deleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).block(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java new file mode 100644 index 000000000000..5b9860db13ad --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.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.avs.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.avs.fluent.DatastoresClient; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.azure.resourcemanager.avs.models.Datastore; +import com.azure.resourcemanager.avs.models.Datastores; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DatastoresImpl implements Datastores { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatastoresImpl.class); + + private final DatastoresClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public DatastoresImpl(DatastoresClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, clusterName); + return Utils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); + } + + public Datastore get(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + DatastoreInner inner = + this.serviceClient().get(resourceGroupName, privateCloudName, clusterName, datastoreName); + if (inner != null) { + return new DatastoreImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatastoreImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, clusterName, datastoreName); + } + + public void delete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + } + + public Datastore 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + return this + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + this.delete(resourceGroupName, privateCloudName, clusterName, datastoreName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + this.delete(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + } + + private DatastoresClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public DatastoreImpl define(String name) { + return new DatastoreImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java new file mode 100644 index 000000000000..af7b3a5be8cb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.azure.resourcemanager.avs.models.GlobalReachConnection; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus; + +public final class GlobalReachConnectionImpl + implements GlobalReachConnection, GlobalReachConnection.Definition, GlobalReachConnection.Update { + private GlobalReachConnectionInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GlobalReachConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public GlobalReachConnectionStatus circuitConnectionStatus() { + return this.innerModel().circuitConnectionStatus(); + } + + public String peerExpressRouteCircuit() { + return this.innerModel().peerExpressRouteCircuit(); + } + + public GlobalReachConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String globalReachConnectionName; + + public GlobalReachConnectionImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public GlobalReachConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public GlobalReachConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), context); + return this; + } + + GlobalReachConnectionImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new GlobalReachConnectionInner(); + this.serviceManager = serviceManager; + this.globalReachConnectionName = name; + } + + public GlobalReachConnectionImpl update() { + return this; + } + + public GlobalReachConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public GlobalReachConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), context); + return this; + } + + GlobalReachConnectionImpl( + GlobalReachConnectionInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.globalReachConnectionName = Utils.getValueFromIdByName(innerObject.id(), "globalReachConnections"); + } + + public GlobalReachConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, Context.NONE) + .getValue(); + return this; + } + + public GlobalReachConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, context) + .getValue(); + return this; + } + + public GlobalReachConnectionImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public GlobalReachConnectionImpl withPeerExpressRouteCircuit(String peerExpressRouteCircuit) { + this.innerModel().withPeerExpressRouteCircuit(peerExpressRouteCircuit); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java new file mode 100644 index 000000000000..07bb1e085f58 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java @@ -0,0 +1,1179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionList; +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 GlobalReachConnectionsClient. */ +public final class GlobalReachConnectionsClientImpl implements GlobalReachConnectionsClient { + private final ClientLogger logger = new ClientLogger(GlobalReachConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GlobalReachConnectionsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of GlobalReachConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GlobalReachConnectionsClientImpl(AvsClientImpl client) { + this.service = + RestProxy + .create(GlobalReachConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientGlobalReachConnections to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientGlobalReach") + private interface GlobalReachConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GlobalReachConnectionInner globalReachConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @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 global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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 global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName 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, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @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 global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName 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, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalReachConnectionInner get( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return getAsync(resourceGroupName, privateCloudName, globalReachConnectionName).block(); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @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 global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context).block(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + globalReachConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + globalReachConnection, + accept, + context); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GlobalReachConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GlobalReachConnectionInner.class, + GlobalReachConnectionInner.class, + Context.NONE); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GlobalReachConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GlobalReachConnectionInner.class, + GlobalReachConnectionInner.class, + context); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection) + .getSyncPoller(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context) + .getSyncPoller(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + return createOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection) + .block(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @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 global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + return createOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context) + .block(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName 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, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).getSyncPoller(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context) + .getSyncPoller(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 privateCloudName, String globalReachConnectionName) { + deleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).block(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @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 privateCloudName, String globalReachConnectionName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java new file mode 100644 index 000000000000..7bce17a0f1aa --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.GlobalReachConnectionsClient; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.azure.resourcemanager.avs.models.GlobalReachConnection; +import com.azure.resourcemanager.avs.models.GlobalReachConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GlobalReachConnectionsImpl implements GlobalReachConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalReachConnectionsImpl.class); + + private final GlobalReachConnectionsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public GlobalReachConnectionsImpl( + GlobalReachConnectionsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new GlobalReachConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new GlobalReachConnectionImpl(inner1, this.manager())); + } + + public GlobalReachConnection get( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + GlobalReachConnectionInner inner = + this.serviceClient().get(resourceGroupName, privateCloudName, globalReachConnectionName); + if (inner != null) { + return new GlobalReachConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GlobalReachConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, globalReachConnectionName); + } + + public void delete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, globalReachConnectionName, context); + } + + public GlobalReachConnection 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + this.delete(resourceGroupName, privateCloudName, globalReachConnectionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + this.delete(resourceGroupName, privateCloudName, globalReachConnectionName, context); + } + + private GlobalReachConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public GlobalReachConnectionImpl define(String name) { + return new GlobalReachConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java index c79acbb8f081..bf2d5202b92b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java @@ -117,6 +117,15 @@ public String nsxtCertificateThumbprint() { return this.innerModel().nsxtCertificateThumbprint(); } + public List externalCloudLinks() { + List inner = this.innerModel().externalCloudLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -218,6 +227,22 @@ public PrivateCloud refresh(Context context) { return this; } + public void rotateVcenterPassword() { + serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName); + } + + public void rotateVcenterPassword(Context context) { + serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName, context); + } + + public void rotateNsxtPassword() { + serviceManager.privateClouds().rotateNsxtPassword(resourceGroupName, privateCloudName); + } + + public void rotateNsxtPassword(Context context) { + serviceManager.privateClouds().rotateNsxtPassword(resourceGroupName, privateCloudName, context); + } + public AdminCredentials listAdminCredentials() { return serviceManager.privateClouds().listAdminCredentials(resourceGroupName, privateCloudName); } @@ -243,11 +268,6 @@ public PrivateCloudImpl withSku(Sku sku) { return this; } - public PrivateCloudImpl withNetworkBlock(String networkBlock) { - this.innerModel().withNetworkBlock(networkBlock); - return this; - } - public PrivateCloudImpl withTags(Map tags) { if (isInCreateMode()) { this.innerModel().withTags(tags); @@ -293,6 +313,11 @@ public PrivateCloudImpl withCircuit(Circuit circuit) { return this; } + public PrivateCloudImpl withNetworkBlock(String networkBlock) { + this.innerModel().withNetworkBlock(networkBlock); + return this; + } + public PrivateCloudImpl withVcenterPassword(String vcenterPassword) { this.innerModel().withVcenterPassword(vcenterPassword); return this; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java index 5655f9f4f961..ce020fa74b97 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java @@ -156,6 +156,36 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/rotateVcenterPassword") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateVcenterPassword( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/rotateNsxtPassword") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateNsxtPassword( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" @@ -1409,6 +1439,476 @@ public void delete(String resourceGroupName, String privateCloudName, Context co deleteAsync(resourceGroupName, privateCloudName, context).block(); } + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateVcenterPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rotateVcenterPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateVcenterPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rotateVcenterPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateVcenterPasswordAsync( + String resourceGroupName, String privateCloudName) { + Mono>> mono = + rotateVcenterPasswordWithResponseAsync(resourceGroupName, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateVcenterPasswordAsync( + String resourceGroupName, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rotateVcenterPasswordWithResponseAsync(resourceGroupName, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateVcenterPassword( + String resourceGroupName, String privateCloudName) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName).getSyncPoller(); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateVcenterPassword( + String resourceGroupName, String privateCloudName, Context context) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName, Context context) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 rotateVcenterPassword(String resourceGroupName, String privateCloudName) { + rotateVcenterPasswordAsync(resourceGroupName, privateCloudName).block(); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { + rotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context).block(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateNsxtPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rotateNsxtPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateNsxtPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rotateNsxtPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateNsxtPasswordAsync( + String resourceGroupName, String privateCloudName) { + Mono>> mono = + rotateNsxtPasswordWithResponseAsync(resourceGroupName, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateNsxtPasswordAsync( + String resourceGroupName, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rotateNsxtPasswordWithResponseAsync(resourceGroupName, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateNsxtPassword( + String resourceGroupName, String privateCloudName) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName).getSyncPoller(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateNsxtPassword( + String resourceGroupName, String privateCloudName, Context context) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateNsxtPasswordAsync(String resourceGroupName, String privateCloudName) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateNsxtPasswordAsync(String resourceGroupName, String privateCloudName, Context context) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 rotateNsxtPassword(String resourceGroupName, String privateCloudName) { + rotateNsxtPasswordAsync(resourceGroupName, privateCloudName).block(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { + rotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context).block(); + } + /** * List the admin credentials for the private cloud. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java index 58be2793a90c..af80bf751db7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java @@ -81,6 +81,22 @@ public void delete(String resourceGroupName, String privateCloudName, Context co this.serviceClient().delete(resourceGroupName, privateCloudName, context); } + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName) { + this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName); + } + + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { + this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName, context); + } + + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName) { + this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName); + } + + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { + this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName, context); + } + public AdminCredentials listAdminCredentials(String resourceGroupName, String privateCloudName) { AdminCredentialsInner inner = this.serviceClient().listAdminCredentials(resourceGroupName, privateCloudName); if (inner != null) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletImpl.java new file mode 100644 index 000000000000..f43ea792a3e8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletImpl.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.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; +import com.azure.resourcemanager.avs.models.ScriptCmdlet; +import com.azure.resourcemanager.avs.models.ScriptParameter; +import java.util.Collections; +import java.util.List; + +public final class ScriptCmdletImpl implements ScriptCmdlet { + private ScriptCmdletInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + ScriptCmdletImpl(ScriptCmdletInner innerObject, com.azure.resourcemanager.avs.AvsManager 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 description() { + return this.innerModel().description(); + } + + public String timeout() { + return this.innerModel().timeout(); + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ScriptCmdletInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java new file mode 100644 index 000000000000..3c391137457a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java @@ -0,0 +1,574 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.ScriptCmdletsClient; +import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; +import com.azure.resourcemanager.avs.models.ScriptCmdletsList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScriptCmdletsClient. */ +public final class ScriptCmdletsClientImpl implements ScriptCmdletsClient { + private final ClientLogger logger = new ClientLogger(ScriptCmdletsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ScriptCmdletsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of ScriptCmdletsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScriptCmdletsClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(ScriptCmdletsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientScriptCmdlets to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientScriptCmdle") + private interface ScriptCmdletsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @PathParam("scriptPackageName") String scriptPackageName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptPackageName") String scriptPackageName, + @PathParam("scriptCmdletName") String scriptCmdletName, + @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); + } + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + scriptPackageName, + 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())); + } + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName 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, + privateCloudName, + this.client.getApiVersion(), + scriptPackageName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, scriptPackageName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, scriptPackageName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, String scriptPackageName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, scriptPackageName)); + } + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 pageable list of scripts/cmdlets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, scriptPackageName, context)); + } + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cmdlet available for script execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + if (scriptCmdletName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptCmdletName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptPackageName, + scriptCmdletName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @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 cmdlet available for script execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String scriptPackageName, + String scriptCmdletName, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + if (scriptCmdletName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptCmdletName 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, + privateCloudName, + scriptPackageName, + scriptCmdletName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cmdlet available for script execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cmdlet available for script execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScriptCmdletInner get( + String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName) { + return getAsync(resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName).block(); + } + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @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 cmdlet available for script execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptPackageName, + String scriptCmdletName, + Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName, 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 pageable list of scripts/cmdlets. + */ + @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 pageable list of scripts/cmdlets. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsImpl.java new file mode 100644 index 000000000000..28a63f5d3b58 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsImpl.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.ScriptCmdletsClient; +import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; +import com.azure.resourcemanager.avs.models.ScriptCmdlet; +import com.azure.resourcemanager.avs.models.ScriptCmdlets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ScriptCmdletsImpl implements ScriptCmdlets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptCmdletsImpl.class); + + private final ScriptCmdletsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public ScriptCmdletsImpl(ScriptCmdletsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String privateCloudName, String scriptPackageName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, scriptPackageName); + return Utils.mapPage(inner, inner1 -> new ScriptCmdletImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, scriptPackageName, context); + return Utils.mapPage(inner, inner1 -> new ScriptCmdletImpl(inner1, this.manager())); + } + + public ScriptCmdlet get( + String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName) { + ScriptCmdletInner inner = + this.serviceClient().get(resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName); + if (inner != null) { + return new ScriptCmdletImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptPackageName, + String scriptCmdletName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ScriptCmdletImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ScriptCmdletsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionImpl.java new file mode 100644 index 000000000000..3ce2d3856606 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionImpl.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; +import com.azure.resourcemanager.avs.models.ScriptExecution; +import com.azure.resourcemanager.avs.models.ScriptExecutionParameter; +import com.azure.resourcemanager.avs.models.ScriptExecutionProvisioningState; +import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ScriptExecutionImpl implements ScriptExecution, ScriptExecution.Definition, ScriptExecution.Update { + private ScriptExecutionInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String scriptCmdletId() { + return this.innerModel().scriptCmdletId(); + } + + public List parameters() { + List inner = this.innerModel().parameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List hiddenParameters() { + List inner = this.innerModel().hiddenParameters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String failureReason() { + return this.innerModel().failureReason(); + } + + public String timeout() { + return this.innerModel().timeout(); + } + + public String retention() { + return this.innerModel().retention(); + } + + public OffsetDateTime submittedAt() { + return this.innerModel().submittedAt(); + } + + public OffsetDateTime startedAt() { + return this.innerModel().startedAt(); + } + + public OffsetDateTime finishedAt() { + return this.innerModel().finishedAt(); + } + + public ScriptExecutionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List output() { + List inner = this.innerModel().output(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Map namedOutputs() { + Map inner = this.innerModel().namedOutputs(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List information() { + List inner = this.innerModel().information(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List warnings() { + List inner = this.innerModel().warnings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ScriptExecutionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String scriptExecutionName; + + public ScriptExecutionImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public ScriptExecution create() { + this.innerObject = + serviceManager + .serviceClient() + .getScriptExecutions() + .createOrUpdate( + resourceGroupName, privateCloudName, scriptExecutionName, this.innerModel(), Context.NONE); + return this; + } + + public ScriptExecution create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScriptExecutions() + .createOrUpdate(resourceGroupName, privateCloudName, scriptExecutionName, this.innerModel(), context); + return this; + } + + ScriptExecutionImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new ScriptExecutionInner(); + this.serviceManager = serviceManager; + this.scriptExecutionName = name; + } + + public ScriptExecutionImpl update() { + return this; + } + + public ScriptExecution apply() { + this.innerObject = + serviceManager + .serviceClient() + .getScriptExecutions() + .createOrUpdate( + resourceGroupName, privateCloudName, scriptExecutionName, this.innerModel(), Context.NONE); + return this; + } + + public ScriptExecution apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScriptExecutions() + .createOrUpdate(resourceGroupName, privateCloudName, scriptExecutionName, this.innerModel(), context); + return this; + } + + ScriptExecutionImpl(ScriptExecutionInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.scriptExecutionName = Utils.getValueFromIdByName(innerObject.id(), "scriptExecutions"); + } + + public ScriptExecution refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getScriptExecutions() + .getWithResponse(resourceGroupName, privateCloudName, scriptExecutionName, Context.NONE) + .getValue(); + return this; + } + + public ScriptExecution refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScriptExecutions() + .getWithResponse(resourceGroupName, privateCloudName, scriptExecutionName, context) + .getValue(); + return this; + } + + public ScriptExecution getExecutionLogs() { + return serviceManager + .scriptExecutions() + .getExecutionLogs(resourceGroupName, privateCloudName, scriptExecutionName); + } + + public Response getExecutionLogsWithResponse( + List scriptOutputStreamType, Context context) { + return serviceManager + .scriptExecutions() + .getExecutionLogsWithResponse( + resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType, context); + } + + public ScriptExecutionImpl withScriptCmdletId(String scriptCmdletId) { + this.innerModel().withScriptCmdletId(scriptCmdletId); + return this; + } + + public ScriptExecutionImpl withParameters(List parameters) { + this.innerModel().withParameters(parameters); + return this; + } + + public ScriptExecutionImpl withHiddenParameters(List hiddenParameters) { + this.innerModel().withHiddenParameters(hiddenParameters); + return this; + } + + public ScriptExecutionImpl withFailureReason(String failureReason) { + this.innerModel().withFailureReason(failureReason); + return this; + } + + public ScriptExecutionImpl withTimeout(String timeout) { + this.innerModel().withTimeout(timeout); + return this; + } + + public ScriptExecutionImpl withRetention(String retention) { + this.innerModel().withRetention(retention); + return this; + } + + public ScriptExecutionImpl withOutput(List output) { + this.innerModel().withOutput(output); + return this; + } + + public ScriptExecutionImpl withNamedOutputs(Map namedOutputs) { + this.innerModel().withNamedOutputs(namedOutputs); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java new file mode 100644 index 000000000000..7beb2bd995d8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java @@ -0,0 +1,1396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.ScriptExecutionsClient; +import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; +import com.azure.resourcemanager.avs.models.ScriptExecutionsList; +import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScriptExecutionsClient. */ +public final class ScriptExecutionsClientImpl implements ScriptExecutionsClient { + private final ClientLogger logger = new ClientLogger(ScriptExecutionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ScriptExecutionsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of ScriptExecutionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScriptExecutionsClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(ScriptExecutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientScriptExecutions to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientScriptExecu") + private interface ScriptExecutionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptExecutions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptExecutions/{scriptExecutionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptExecutions/{scriptExecutionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScriptExecutionInner scriptExecution, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptExecutions/{scriptExecutionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getExecutionLogs( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptExecutionName") String scriptExecutionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") List scriptOutputStreamType, + @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 an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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())); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName 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, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName 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, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScriptExecutionInner get(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + return getAsync(resourceGroupName, privateCloudName, scriptExecutionName).block(); + } + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName, context).block(); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + if (scriptExecution == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); + } else { + scriptExecution.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + scriptExecution, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + if (scriptExecution == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); + } else { + scriptExecution.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + scriptExecution, + accept, + context); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ScriptExecutionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ScriptExecutionInner.class, + ScriptExecutionInner.class, + Context.NONE); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ScriptExecutionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScriptExecutionInner.class, ScriptExecutionInner.class, context); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScriptExecutionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution) + .getSyncPoller(); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ScriptExecutionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, context) + .getSyncPoller(); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScriptExecutionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution).block(); + } + + /** + * Create or update a script execution resource in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptExecution A script running in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScriptExecutionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + ScriptExecutionInner scriptExecution, + Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptExecution, context) + .block(); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName 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, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, scriptExecutionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).getSyncPoller(); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName, context).getSyncPoller(); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, scriptExecutionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + deleteAsync(resourceGroupName, privateCloudName, scriptExecutionName).block(); + } + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, scriptExecutionName, context).block(); + } + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An + * empty array will return nothing. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getExecutionLogsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + List scriptOutputStreamType) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getExecutionLogs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + scriptOutputStreamType, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An + * empty array will return nothing. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getExecutionLogsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + List scriptOutputStreamType, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getExecutionLogs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptExecutionName, + this.client.getApiVersion(), + scriptOutputStreamType, + accept, + context); + } + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An + * empty array will return nothing. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getExecutionLogsAsync( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + List scriptOutputStreamType) { + return getExecutionLogsWithResponseAsync( + resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getExecutionLogsAsync( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + final List scriptOutputStreamType = null; + return getExecutionLogsWithResponseAsync( + resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScriptExecutionInner getExecutionLogs( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + final List scriptOutputStreamType = null; + return getExecutionLogsAsync(resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType) + .block(); + } + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An + * empty array will return nothing. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExecutionLogsWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + List scriptOutputStreamType, + Context context) { + return getExecutionLogsWithResponseAsync( + resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType, 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 pageable list of script executions. + */ + @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 pageable list of script executions. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsImpl.java new file mode 100644 index 000000000000..68b7f3fa15de --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.ScriptExecutionsClient; +import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; +import com.azure.resourcemanager.avs.models.ScriptExecution; +import com.azure.resourcemanager.avs.models.ScriptExecutions; +import com.azure.resourcemanager.avs.models.ScriptOutputStreamType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +public final class ScriptExecutionsImpl implements ScriptExecutions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptExecutionsImpl.class); + + private final ScriptExecutionsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public ScriptExecutionsImpl( + ScriptExecutionsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new ScriptExecutionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new ScriptExecutionImpl(inner1, this.manager())); + } + + public ScriptExecution get(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + ScriptExecutionInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, scriptExecutionName); + if (inner != null) { + return new ScriptExecutionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, scriptExecutionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ScriptExecutionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, scriptExecutionName); + } + + public void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, scriptExecutionName, context); + } + + public ScriptExecution getExecutionLogs( + String resourceGroupName, String privateCloudName, String scriptExecutionName) { + ScriptExecutionInner inner = + this.serviceClient().getExecutionLogs(resourceGroupName, privateCloudName, scriptExecutionName); + if (inner != null) { + return new ScriptExecutionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getExecutionLogsWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + List scriptOutputStreamType, + Context context) { + Response inner = + this + .serviceClient() + .getExecutionLogsWithResponse( + resourceGroupName, privateCloudName, scriptExecutionName, scriptOutputStreamType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ScriptExecutionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ScriptExecution 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String scriptExecutionName = Utils.getValueFromIdByName(id, "scriptExecutions"); + if (scriptExecutionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'scriptExecutions'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, scriptExecutionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String scriptExecutionName = Utils.getValueFromIdByName(id, "scriptExecutions"); + if (scriptExecutionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'scriptExecutions'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, scriptExecutionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String scriptExecutionName = Utils.getValueFromIdByName(id, "scriptExecutions"); + if (scriptExecutionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'scriptExecutions'.", id))); + } + this.delete(resourceGroupName, privateCloudName, scriptExecutionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String scriptExecutionName = Utils.getValueFromIdByName(id, "scriptExecutions"); + if (scriptExecutionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'scriptExecutions'.", id))); + } + this.delete(resourceGroupName, privateCloudName, scriptExecutionName, context); + } + + private ScriptExecutionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public ScriptExecutionImpl define(String name) { + return new ScriptExecutionImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackageImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackageImpl.java new file mode 100644 index 000000000000..06de4c6f986b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackageImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; +import com.azure.resourcemanager.avs.models.ScriptPackage; + +public final class ScriptPackageImpl implements ScriptPackage { + private ScriptPackageInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + ScriptPackageImpl(ScriptPackageInner innerObject, com.azure.resourcemanager.avs.AvsManager 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 description() { + return this.innerModel().description(); + } + + public String version() { + return this.innerModel().version(); + } + + public ScriptPackageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java new file mode 100644 index 000000000000..793b2bcf0742 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.ScriptPackagesClient; +import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; +import com.azure.resourcemanager.avs.models.ScriptPackagesList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScriptPackagesClient. */ +public final class ScriptPackagesClientImpl implements ScriptPackagesClient { + private final ClientLogger logger = new ClientLogger(ScriptPackagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ScriptPackagesService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of ScriptPackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScriptPackagesClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(ScriptPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientScriptPackages to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientScriptPacka") + private interface ScriptPackagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptPackages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/scriptPackages/{scriptPackageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("scriptPackageName") String scriptPackageName, + @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); + } + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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())); + } + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName 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, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return script Package resources available for execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + scriptPackageName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 script Package resources available for execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName 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, + privateCloudName, + scriptPackageName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return script Package resources available for execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String scriptPackageName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, scriptPackageName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return script Package resources available for execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScriptPackageInner get(String resourceGroupName, String privateCloudName, String scriptPackageName) { + return getAsync(resourceGroupName, privateCloudName, scriptPackageName).block(); + } + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 script Package resources available for execution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, scriptPackageName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesImpl.java new file mode 100644 index 000000000000..bdc1a43bb7fd --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.ScriptPackagesClient; +import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; +import com.azure.resourcemanager.avs.models.ScriptPackage; +import com.azure.resourcemanager.avs.models.ScriptPackages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ScriptPackagesImpl implements ScriptPackages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptPackagesImpl.class); + + private final ScriptPackagesClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public ScriptPackagesImpl( + ScriptPackagesClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new ScriptPackageImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new ScriptPackageImpl(inner1, this.manager())); + } + + public ScriptPackage get(String resourceGroupName, String privateCloudName, String scriptPackageName) { + ScriptPackageInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, scriptPackageName); + if (inner != null) { + return new ScriptPackageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, scriptPackageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ScriptPackageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ScriptPackagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java new file mode 100644 index 000000000000..bfc1e0825a34 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpEntity; + +public final class WorkloadNetworkDhcpImpl + implements WorkloadNetworkDhcp, WorkloadNetworkDhcp.Definition, WorkloadNetworkDhcp.Update { + private WorkloadNetworkDhcpInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public WorkloadNetworkDhcpEntity properties() { + return this.innerModel().properties(); + } + + public WorkloadNetworkDhcpInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String dhcpId; + + public WorkloadNetworkDhcpImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkDhcp create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDhcp create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDhcpImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkDhcpInner(); + this.serviceManager = serviceManager; + this.dhcpId = name; + } + + public WorkloadNetworkDhcpImpl update() { + return this; + } + + public WorkloadNetworkDhcp apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDhcp apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDhcpImpl( + WorkloadNetworkDhcpInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.dhcpId = Utils.getValueFromIdByName(innerObject.id(), "dhcpConfigurations"); + } + + public WorkloadNetworkDhcp refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkDhcp refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context) + .getValue(); + return this; + } + + public WorkloadNetworkDhcpImpl withProperties(WorkloadNetworkDhcpEntity properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java new file mode 100644 index 000000000000..065a33946b7b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.DnsServiceStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkDnsServiceImpl + implements WorkloadNetworkDnsService, WorkloadNetworkDnsService.Definition, WorkloadNetworkDnsService.Update { + private WorkloadNetworkDnsServiceInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String dnsServiceIp() { + return this.innerModel().dnsServiceIp(); + } + + public String defaultDnsZone() { + return this.innerModel().defaultDnsZone(); + } + + public List fqdnZones() { + List inner = this.innerModel().fqdnZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DnsServiceLogLevelEnum logLevel() { + return this.innerModel().logLevel(); + } + + public DnsServiceStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkDnsServiceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkDnsServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String dnsServiceId; + + public WorkloadNetworkDnsServiceImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkDnsService create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsServiceImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkDnsServiceInner(); + this.serviceManager = serviceManager; + this.dnsServiceId = name; + } + + public WorkloadNetworkDnsServiceImpl update() { + return this; + } + + public WorkloadNetworkDnsService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsServiceImpl( + WorkloadNetworkDnsServiceInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.dnsServiceId = Utils.getValueFromIdByName(innerObject.id(), "dnsServices"); + } + + public WorkloadNetworkDnsService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkDnsService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context) + .getValue(); + return this; + } + + public WorkloadNetworkDnsServiceImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkDnsServiceImpl withDnsServiceIp(String dnsServiceIp) { + this.innerModel().withDnsServiceIp(dnsServiceIp); + return this; + } + + public WorkloadNetworkDnsServiceImpl withDefaultDnsZone(String defaultDnsZone) { + this.innerModel().withDefaultDnsZone(defaultDnsZone); + return this; + } + + public WorkloadNetworkDnsServiceImpl withFqdnZones(List fqdnZones) { + this.innerModel().withFqdnZones(fqdnZones); + return this; + } + + public WorkloadNetworkDnsServiceImpl withLogLevel(DnsServiceLogLevelEnum logLevel) { + this.innerModel().withLogLevel(logLevel); + return this; + } + + public WorkloadNetworkDnsServiceImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java new file mode 100644 index 000000000000..45375171375d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkDnsZoneImpl + implements WorkloadNetworkDnsZone, WorkloadNetworkDnsZone.Definition, WorkloadNetworkDnsZone.Update { + private WorkloadNetworkDnsZoneInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List domain() { + List inner = this.innerModel().domain(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dnsServerIps() { + List inner = this.innerModel().dnsServerIps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String sourceIp() { + return this.innerModel().sourceIp(); + } + + public Long dnsServices() { + return this.innerModel().dnsServices(); + } + + public WorkloadNetworkDnsZoneProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkDnsZoneInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String dnsZoneId; + + public WorkloadNetworkDnsZoneImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkDnsZone create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsZone create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsZoneImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkDnsZoneInner(); + this.serviceManager = serviceManager; + this.dnsZoneId = name; + } + + public WorkloadNetworkDnsZoneImpl update() { + return this; + } + + public WorkloadNetworkDnsZone apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsZone apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsZoneImpl( + WorkloadNetworkDnsZoneInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.dnsZoneId = Utils.getValueFromIdByName(innerObject.id(), "dnsZones"); + } + + public WorkloadNetworkDnsZone refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkDnsZone refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context) + .getValue(); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDomain(List domain) { + this.innerModel().withDomain(domain); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDnsServerIps(List dnsServerIps) { + this.innerModel().withDnsServerIps(dnsServerIps); + return this; + } + + public WorkloadNetworkDnsZoneImpl withSourceIp(String sourceIp) { + this.innerModel().withSourceIp(sourceIp); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDnsServices(Long dnsServices) { + this.innerModel().withDnsServices(dnsServices); + return this; + } + + public WorkloadNetworkDnsZoneImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java new file mode 100644 index 000000000000..247cb4768154 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; + +public final class WorkloadNetworkGatewayImpl implements WorkloadNetworkGateway { + private WorkloadNetworkGatewayInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + WorkloadNetworkGatewayImpl( + WorkloadNetworkGatewayInner innerObject, com.azure.resourcemanager.avs.AvsManager 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 displayName() { + return this.innerModel().displayName(); + } + + public String path() { + return this.innerModel().path(); + } + + public WorkloadNetworkGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java new file mode 100644 index 000000000000..5c4b88ba6572 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.PortMirroringStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProvisioningState; + +public final class WorkloadNetworkPortMirroringImpl + implements WorkloadNetworkPortMirroring, + WorkloadNetworkPortMirroring.Definition, + WorkloadNetworkPortMirroring.Update { + private WorkloadNetworkPortMirroringInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public PortMirroringDirectionEnum direction() { + return this.innerModel().direction(); + } + + public String source() { + return this.innerModel().source(); + } + + public String destination() { + return this.innerModel().destination(); + } + + public PortMirroringStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkPortMirroringProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkPortMirroringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String portMirroringId; + + public WorkloadNetworkPortMirroringImpl withExistingPrivateCloud( + String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkPortMirroring create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createPortMirroring( + resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkPortMirroring create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createPortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), context); + return this; + } + + WorkloadNetworkPortMirroringImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkPortMirroringInner(); + this.serviceManager = serviceManager; + this.portMirroringId = name; + } + + public WorkloadNetworkPortMirroringImpl update() { + return this; + } + + public WorkloadNetworkPortMirroring apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updatePortMirroring( + resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkPortMirroring apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updatePortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), context); + return this; + } + + WorkloadNetworkPortMirroringImpl( + WorkloadNetworkPortMirroringInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.portMirroringId = Utils.getValueFromIdByName(innerObject.id(), "portMirroringProfiles"); + } + + public WorkloadNetworkPortMirroring refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkPortMirroring refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context) + .getValue(); + return this; + } + + public WorkloadNetworkPortMirroringImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkPortMirroringImpl withDirection(PortMirroringDirectionEnum direction) { + this.innerModel().withDirection(direction); + return this; + } + + public WorkloadNetworkPortMirroringImpl withSource(String source) { + this.innerModel().withSource(source); + return this; + } + + public WorkloadNetworkPortMirroringImpl withDestination(String destination) { + this.innerModel().withDestination(destination); + return this; + } + + public WorkloadNetworkPortMirroringImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPublicIpImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPublicIpImpl.java new file mode 100644 index 000000000000..705f280d4197 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPublicIpImpl.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.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIp; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIpProvisioningState; + +public final class WorkloadNetworkPublicIpImpl implements WorkloadNetworkPublicIp, WorkloadNetworkPublicIp.Definition { + private WorkloadNetworkPublicIpInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + WorkloadNetworkPublicIpImpl( + WorkloadNetworkPublicIpInner innerObject, com.azure.resourcemanager.avs.AvsManager 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 displayName() { + return this.innerModel().displayName(); + } + + public Long numberOfPublicIPs() { + return this.innerModel().numberOfPublicIPs(); + } + + public String publicIpBlock() { + return this.innerModel().publicIpBlock(); + } + + public WorkloadNetworkPublicIpProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public WorkloadNetworkPublicIpInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String publicIpId; + + public WorkloadNetworkPublicIpImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkPublicIp create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createPublicIp(resourceGroupName, privateCloudName, publicIpId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkPublicIp create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createPublicIp(resourceGroupName, privateCloudName, publicIpId, this.innerModel(), context); + return this; + } + + WorkloadNetworkPublicIpImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkPublicIpInner(); + this.serviceManager = serviceManager; + this.publicIpId = name; + } + + public WorkloadNetworkPublicIp refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkPublicIp refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, context) + .getValue(); + return this; + } + + public WorkloadNetworkPublicIpImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkPublicIpImpl withNumberOfPublicIPs(Long numberOfPublicIPs) { + this.innerModel().withNumberOfPublicIPs(numberOfPublicIPs); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java new file mode 100644 index 000000000000..7590a94e302a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.models.SegmentStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkSegmentImpl + implements WorkloadNetworkSegment, WorkloadNetworkSegment.Definition, WorkloadNetworkSegment.Update { + private WorkloadNetworkSegmentInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String connectedGateway() { + return this.innerModel().connectedGateway(); + } + + public WorkloadNetworkSegmentSubnet subnet() { + return this.innerModel().subnet(); + } + + public List portVif() { + List inner = this.innerModel().portVif(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SegmentStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkSegmentProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkSegmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String segmentId; + + public WorkloadNetworkSegmentImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkSegment create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkSegment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), context); + return this; + } + + WorkloadNetworkSegmentImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkSegmentInner(); + this.serviceManager = serviceManager; + this.segmentId = name; + } + + public WorkloadNetworkSegmentImpl update() { + return this; + } + + public WorkloadNetworkSegment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkSegment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), context); + return this; + } + + WorkloadNetworkSegmentImpl( + WorkloadNetworkSegmentInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.segmentId = Utils.getValueFromIdByName(innerObject.id(), "segments"); + } + + public WorkloadNetworkSegment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkSegment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context) + .getValue(); + return this; + } + + public WorkloadNetworkSegmentImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkSegmentImpl withConnectedGateway(String connectedGateway) { + this.innerModel().withConnectedGateway(connectedGateway); + return this; + } + + public WorkloadNetworkSegmentImpl withSubnet(WorkloadNetworkSegmentSubnet subnet) { + this.innerModel().withSubnet(subnet); + return this; + } + + public WorkloadNetworkSegmentImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java new file mode 100644 index 000000000000..0a06a88331ef --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.models.VMGroupStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkVMGroupImpl + implements WorkloadNetworkVMGroup, WorkloadNetworkVMGroup.Definition, WorkloadNetworkVMGroup.Update { + private WorkloadNetworkVMGroupInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List members() { + List inner = this.innerModel().members(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VMGroupStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkVMGroupProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkVMGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String vmGroupId; + + public WorkloadNetworkVMGroupImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkVMGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkVMGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), context); + return this; + } + + WorkloadNetworkVMGroupImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkVMGroupInner(); + this.serviceManager = serviceManager; + this.vmGroupId = name; + } + + public WorkloadNetworkVMGroupImpl update() { + return this; + } + + public WorkloadNetworkVMGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkVMGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), context); + return this; + } + + WorkloadNetworkVMGroupImpl( + WorkloadNetworkVMGroupInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.vmGroupId = Utils.getValueFromIdByName(innerObject.id(), "vmGroups"); + } + + public WorkloadNetworkVMGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkVMGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context) + .getValue(); + return this; + } + + public WorkloadNetworkVMGroupImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkVMGroupImpl withMembers(List members) { + this.innerModel().withMembers(members); + return this; + } + + public WorkloadNetworkVMGroupImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java new file mode 100644 index 000000000000..97a8bb2ea3bf --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.azure.resourcemanager.avs.models.VMTypeEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; + +public final class WorkloadNetworkVirtualMachineImpl implements WorkloadNetworkVirtualMachine { + private WorkloadNetworkVirtualMachineInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + WorkloadNetworkVirtualMachineImpl( + WorkloadNetworkVirtualMachineInner innerObject, com.azure.resourcemanager.avs.AvsManager 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 displayName() { + return this.innerModel().displayName(); + } + + public VMTypeEnum vmType() { + return this.innerModel().vmType(); + } + + public WorkloadNetworkVirtualMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java new file mode 100644 index 000000000000..7d94663eb0b5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java @@ -0,0 +1,10752 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServicesList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZonesList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIPsList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentsList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupsList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachinesList; +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 WorkloadNetworksClient. */ +public final class WorkloadNetworksClientImpl implements WorkloadNetworksClient { + private final ClientLogger logger = new ClientLogger(WorkloadNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkloadNetworksService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of WorkloadNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkloadNetworksClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(WorkloadNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientWorkloadNetworks to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientWorkloadNet") + private interface WorkloadNetworksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSegments( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSegment( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createSegments( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateSegments( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteSegment( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("dhcpId") String dhcpId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dhcpId") String dhcpId, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dhcpId") String dhcpId, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dhcpId") String dhcpId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/gateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGateways( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("gatewayId") String gatewayId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("portMirroringId") String portMirroringId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createPortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("portMirroringId") String portMirroringId, + @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("portMirroringId") String portMirroringId, + @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deletePortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("portMirroringId") String portMirroringId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVMGroups( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("vmGroupId") String vmGroupId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("vmGroupId") String vmGroupId, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("vmGroupId") String vmGroupId, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("vmGroupId") String vmGroupId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachines( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachine( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("virtualMachineId") String virtualMachineId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDnsServices( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsServiceId") String dnsServiceId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsServiceId") String dnsServiceId, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsServiceId") String dnsServiceId, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("dnsServiceId") String dnsServiceId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDnsZones( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsZoneId") String dnsZoneId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsZoneId") String dnsZoneId, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsZoneId") String dnsZoneId, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("dnsZoneId") String dnsZoneId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/publicIPs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPublicIPs( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPublicIp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("publicIPId") String publicIpId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createPublicIp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("publicIPId") String publicIpId, + @BodyParam("application/json") WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deletePublicIp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("publicIPId") String publicIpId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSegmentsNext( + @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> listDhcpNext( + @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> listGatewaysNext( + @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> listPortMirroringNext( + @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> listVMGroupsNext( + @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> listVirtualMachinesNext( + @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> listDnsServicesNext( + @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> listDnsZonesNext( + @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> listPublicIPsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSegmentsAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listSegmentsNextSinglePageAsync(nextLink)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSegmentsAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listSegmentsNextSinglePageAsync(nextLink, context)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSegments(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId) { + return getSegmentAsync(resourceGroupName, privateCloudName, segmentId).block(); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context).block(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + Mono>> mono = + createSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + Context.NONE); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createSegmentsWithResponseAsync( + resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + context); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .getSyncPoller(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .getSyncPoller(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .block(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + Mono>> mono = + updateSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + Context.NONE); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateSegmentsWithResponseAsync( + resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + context); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .getSyncPoller(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .getSyncPoller(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @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 nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .block(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + Mono>> mono = + deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).getSyncPoller(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).getSyncPoller(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { + deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).block(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context) { + deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).block(); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listDhcpNextSinglePageAsync(nextLink)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDhcpAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listDhcpNextSinglePageAsync(nextLink, context)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDhcp( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDhcpWithResponseAsync( + String resourceGroupName, String dhcpId, String privateCloudName) { + 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 (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dhcpId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @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 dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDhcpWithResponseAsync( + String resourceGroupName, String dhcpId, String privateCloudName, 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 (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dhcpId, + privateCloudName, + accept, + context); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDhcpAsync( + String resourceGroupName, String dhcpId, String privateCloudName) { + return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, String privateCloudName) { + return getDhcpAsync(resourceGroupName, dhcpId, privateCloudName).block(); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @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 dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context) { + return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName, context).block(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + Mono>> mono = + createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + Context.NONE); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + context); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).getSyncPoller(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .getSyncPoller(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + Mono>> mono = + updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + Context.NONE); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + context); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).getSyncPoller(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .getSyncPoller(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @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 nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDhcpWithResponseAsync( + String resourceGroupName, String privateCloudName, String dhcpId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDhcpWithResponseAsync( + String resourceGroupName, String privateCloudName, String dhcpId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + accept, + context); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDhcpAsync( + String resourceGroupName, String privateCloudName, String dhcpId) { + Mono>> mono = + deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDhcpAsync( + String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).getSyncPoller(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).getSyncPoller(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDhcpAsync( + String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { + deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).block(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).block(); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listGateways( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listGateways( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGatewaysAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listGatewaysNextSinglePageAsync(nextLink)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGatewaysAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listGatewaysNextSinglePageAsync(nextLink, context)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGateways(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGatewayWithResponseAsync( + String resourceGroupName, String privateCloudName, String gatewayId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + gatewayId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGatewayWithResponseAsync( + String resourceGroupName, String privateCloudName, String gatewayId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + gatewayId, + accept, + context); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getGatewayAsync( + String resourceGroupName, String privateCloudName, String gatewayId) { + return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId) { + return getGatewayAsync(resourceGroupName, privateCloudName, gatewayId).block(); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context) { + return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId, context).block(); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPortMirroringAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listPortMirroringNextSinglePageAsync(nextLink)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPortMirroringAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listPortMirroringNextSinglePageAsync(nextLink, context)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPortMirroringWithResponseAsync( + String resourceGroupName, String privateCloudName, String portMirroringId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPortMirroringWithResponseAsync( + String resourceGroupName, String privateCloudName, String portMirroringId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + accept, + context); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPortMirroringAsync( + String resourceGroupName, String privateCloudName, String portMirroringId) { + return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId) { + return getPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId).block(); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context) { + return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId, context).block(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createPortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createPortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + Mono>> mono = + createPortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + Context.NONE); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createPortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + context); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .getSyncPoller(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .getSyncPoller(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createPortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createPortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return createPortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .block(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return createPortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .block(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + Mono>> mono = + updatePortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + Context.NONE); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + context); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .getSyncPoller(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .getSyncPoller(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return updatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .block(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @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 nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return updatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .block(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePortMirroringWithResponseAsync( + String resourceGroupName, String portMirroringId, String privateCloudName) { + 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 (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deletePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + portMirroringId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePortMirroringWithResponseAsync( + String resourceGroupName, String portMirroringId, String privateCloudName, 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 (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deletePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + portMirroringId, + privateCloudName, + accept, + context); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName) { + Mono>> mono = + deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context) + .getSyncPoller(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { + deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).block(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @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 deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context).block(); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVMGroups( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVMGroups( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVMGroupsAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listVMGroupsNextSinglePageAsync(nextLink)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVMGroupsAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listVMGroupsNextSinglePageAsync(nextLink, context)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVMGroupWithResponseAsync( + String resourceGroupName, String privateCloudName, String vmGroupId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVMGroupWithResponseAsync( + String resourceGroupName, String privateCloudName, String vmGroupId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + accept, + context); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVMGroupAsync( + String resourceGroupName, String privateCloudName, String vmGroupId) { + return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) { + return getVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId).block(); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context) { + return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, context).block(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + Mono>> mono = + createVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + Context.NONE); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createVMGroupWithResponseAsync( + resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + context); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .getSyncPoller(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .getSyncPoller(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .block(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + Mono>> mono = + updateVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + Context.NONE); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateVMGroupWithResponseAsync( + resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + context); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .getSyncPoller(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .getSyncPoller(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .block(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteVMGroupWithResponseAsync( + String resourceGroupName, String vmGroupId, String privateCloudName) { + 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 (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + vmGroupId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteVMGroupWithResponseAsync( + String resourceGroupName, String vmGroupId, String privateCloudName, 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 (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + vmGroupId, + privateCloudName, + accept, + context); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteVMGroupAsync( + String resourceGroupName, String vmGroupId, String privateCloudName) { + Mono>> mono = + deleteVMGroupWithResponseAsync(resourceGroupName, vmGroupId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteVMGroupAsync( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteVMGroupWithResponseAsync(resourceGroupName, vmGroupId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteVMGroupAsync( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { + deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).block(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).block(); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVirtualMachines( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVirtualMachines( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachinesAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachinesAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink, context)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineWithResponseAsync( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (virtualMachineId == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVirtualMachine( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + virtualMachineId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @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 virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineWithResponseAsync( + String resourceGroupName, String privateCloudName, String virtualMachineId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (virtualMachineId == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVirtualMachine( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + virtualMachineId, + accept, + context); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineAsync( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVirtualMachineInner getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + return getVirtualMachineAsync(resourceGroupName, privateCloudName, virtualMachineId).block(); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @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 virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context) { + return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId, context) + .block(); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDnsServices( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDnsServices( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsServicesAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listDnsServicesNextSinglePageAsync(nextLink)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsServicesAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listDnsServicesNextSinglePageAsync(nextLink, context)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsServiceWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsServiceWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsServiceId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + accept, + context); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDnsServiceAsync( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner getDnsService( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + return getDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId).block(); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context) { + return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId, context).block(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginCreateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + Mono>> mono = + createDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + Context.NONE); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginCreateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + context); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .getSyncPoller(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginCreateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .getSyncPoller(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginCreateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .block(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return createDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .block(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginUpdateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + Mono>> mono = + updateDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + Context.NONE); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginUpdateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + context); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .getSyncPoller(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginUpdateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .getSyncPoller(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginUpdateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .block(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @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 nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return updateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .block(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsServiceWithResponseAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName) { + 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 (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsServiceId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsServiceWithResponseAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName, 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 (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsServiceId, + privateCloudName, + accept, + context); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsServiceAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName) { + Mono>> mono = + deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsServiceAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, String privateCloudName) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsServiceAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) { + deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).block(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).block(); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDnsZones( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDnsZones( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsZonesAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listDnsZonesNextSinglePageAsync(nextLink)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsZonesAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listDnsZonesNextSinglePageAsync(nextLink, context)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsZoneWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsZoneId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsZoneWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsZoneId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + accept, + context); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDnsZoneAsync( + String resourceGroupName, String privateCloudName, String dnsZoneId) { + return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) { + return getDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId).block(); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context) { + return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, context).block(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + Mono>> mono = + createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + Context.NONE); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDnsZoneWithResponseAsync( + resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + context); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .getSyncPoller(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .getSyncPoller(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .block(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + Mono>> mono = + updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + Context.NONE); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDnsZoneWithResponseAsync( + resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + context); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .getSyncPoller(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .getSyncPoller(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @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 nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .block(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsZoneWithResponseAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName) { + 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 (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsZoneId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsZoneWithResponseAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName, 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 (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsZoneId, + privateCloudName, + accept, + context); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsZoneAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName) { + Mono>> mono = + deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsZoneAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, String privateCloudName) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsZoneAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) { + deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).block(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).block(); + } + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublicIPsSinglePageAsync( + String resourceGroupName, String privateCloudName) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPublicIPs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + 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 of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublicIPsSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPublicIPs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPublicIPsAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listPublicIPsSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listPublicIPsNextSinglePageAsync(nextLink)); + } + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPublicIPsAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listPublicIPsSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listPublicIPsNextSinglePageAsync(nextLink, context)); + } + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPublicIPs( + String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listPublicIPsAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPublicIPs( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listPublicIPsAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPublicIpWithResponseAsync( + String resourceGroupName, String privateCloudName, String publicIpId) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIpId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPublicIp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + publicIpId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPublicIpWithResponseAsync( + String resourceGroupName, String privateCloudName, String publicIpId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIpId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPublicIp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + publicIpId, + accept, + context); + } + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPublicIpAsync( + String resourceGroupName, String privateCloudName, String publicIpId) { + return getPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPublicIpInner getPublicIp( + String resourceGroupName, String privateCloudName, String publicIpId) { + return getPublicIpAsync(resourceGroupName, privateCloudName, publicIpId).block(); + } + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPublicIpWithResponse( + String resourceGroupName, String privateCloudName, String publicIpId, Context context) { + return getPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId, context).block(); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createPublicIpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIpId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + if (workloadNetworkPublicIp == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null.")); + } else { + workloadNetworkPublicIp.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createPublicIp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + publicIpId, + workloadNetworkPublicIp, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createPublicIpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIpId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + if (workloadNetworkPublicIp == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null.")); + } else { + workloadNetworkPublicIp.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createPublicIp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + publicIpId, + workloadNetworkPublicIp, + accept, + context); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPublicIpInner> beginCreatePublicIpAsync( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + Mono>> mono = + createPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPublicIpInner.class, + WorkloadNetworkPublicIpInner.class, + Context.NONE); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPublicIpInner> beginCreatePublicIpAsync( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createPublicIpWithResponseAsync( + resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPublicIpInner.class, + WorkloadNetworkPublicIpInner.class, + context); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + return beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp) + .getSyncPoller(); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + Context context) { + return beginCreatePublicIpAsync( + resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context) + .getSyncPoller(); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createPublicIpAsync( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + return beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createPublicIpAsync( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + Context context) { + return beginCreatePublicIpAsync( + resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPublicIpInner createPublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + return createPublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp).block(); + } + + /** + * Create a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param workloadNetworkPublicIp NSX Public IP Block. + * @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 nSX Public IP Block. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPublicIpInner createPublicIp( + String resourceGroupName, + String privateCloudName, + String publicIpId, + WorkloadNetworkPublicIpInner workloadNetworkPublicIp, + Context context) { + return createPublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context) + .block(); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePublicIpWithResponseAsync( + String resourceGroupName, String publicIpId, String privateCloudName) { + 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 (publicIpId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deletePublicIp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + publicIpId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePublicIpWithResponseAsync( + String resourceGroupName, String publicIpId, String privateCloudName, 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 (publicIpId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deletePublicIp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + publicIpId, + privateCloudName, + accept, + context); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeletePublicIpAsync( + String resourceGroupName, String publicIpId, String privateCloudName) { + Mono>> mono = + deletePublicIpWithResponseAsync(resourceGroupName, publicIpId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeletePublicIpAsync( + String resourceGroupName, String publicIpId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deletePublicIpWithResponseAsync(resourceGroupName, publicIpId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeletePublicIp( + String resourceGroupName, String publicIpId, String privateCloudName) { + return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeletePublicIp( + String resourceGroupName, String publicIpId, String privateCloudName, Context context) { + return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePublicIpAsync(String resourceGroupName, String publicIpId, String privateCloudName) { + return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePublicIpAsync( + String resourceGroupName, String publicIpId, String privateCloudName, Context context) { + return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName) { + deletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).block(); + } + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context) { + deletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsNextSinglePageAsync(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.listSegmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsNextSinglePageAsync( + 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 + .listSegmentsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpNextSinglePageAsync(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.listDhcpNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpNextSinglePageAsync( + 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 + .listDhcpNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysNextSinglePageAsync(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.listGatewaysNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysNextSinglePageAsync( + 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 + .listGatewaysNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringNextSinglePageAsync( + 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.listPortMirroringNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringNextSinglePageAsync( + 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 + .listPortMirroringNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsNextSinglePageAsync(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.listVMGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsNextSinglePageAsync( + 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 + .listVMGroupsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesNextSinglePageAsync( + 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.listVirtualMachinesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesNextSinglePageAsync( + 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 + .listVirtualMachinesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesNextSinglePageAsync(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.listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesNextSinglePageAsync( + 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 + .listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesNextSinglePageAsync(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.listDnsZonesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesNextSinglePageAsync( + 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 + .listDnsZonesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublicIPsNextSinglePageAsync(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.listPublicIPsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPublicIPsNextSinglePageAsync( + 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 + .listPublicIPsNext(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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java new file mode 100644 index 000000000000..43cb44aaed03 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java @@ -0,0 +1,1242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.WorkloadNetworksClient; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIp; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; +import com.azure.resourcemanager.avs.models.WorkloadNetworks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkloadNetworksImpl implements WorkloadNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworksImpl.class); + + private final WorkloadNetworksClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public WorkloadNetworksImpl( + WorkloadNetworksClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listSegments(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listSegments(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkSegmentImpl(inner1, this.manager())); + } + + public PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listSegments(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkSegmentImpl(inner1, this.manager())); + } + + public WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, String segmentId) { + WorkloadNetworkSegmentInner inner = + this.serviceClient().getSegment(resourceGroupName, privateCloudName, segmentId); + if (inner != null) { + return new WorkloadNetworkSegmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + Response inner = + this.serviceClient().getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkSegmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { + this.serviceClient().deleteSegment(resourceGroupName, privateCloudName, segmentId); + } + + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context) { + this.serviceClient().deleteSegment(resourceGroupName, privateCloudName, segmentId, context); + } + + public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listDhcp(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDhcpImpl(inner1, this.manager())); + } + + public PagedIterable listDhcp( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listDhcp(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDhcpImpl(inner1, this.manager())); + } + + public WorkloadNetworkDhcp getDhcp(String resourceGroupName, String dhcpId, String privateCloudName) { + WorkloadNetworkDhcpInner inner = this.serviceClient().getDhcp(resourceGroupName, dhcpId, privateCloudName); + if (inner != null) { + return new WorkloadNetworkDhcpImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context) { + Response inner = + this.serviceClient().getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkDhcpImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { + this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, dhcpId); + } + + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, dhcpId, context); + } + + public PagedIterable listGateways(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listGateways(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listGateways(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkGatewayImpl(inner1, this.manager())); + } + + public WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, String gatewayId) { + WorkloadNetworkGatewayInner inner = + this.serviceClient().getGateway(resourceGroupName, privateCloudName, gatewayId); + if (inner != null) { + return new WorkloadNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context) { + Response inner = + this.serviceClient().getGatewayWithResponse(resourceGroupName, privateCloudName, gatewayId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkPortMirroringImpl(inner1, this.manager())); + } + + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkPortMirroringImpl(inner1, this.manager())); + } + + public WorkloadNetworkPortMirroring getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId) { + WorkloadNetworkPortMirroringInner inner = + this.serviceClient().getPortMirroring(resourceGroupName, privateCloudName, portMirroringId); + if (inner != null) { + return new WorkloadNetworkPortMirroringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context) { + Response inner = + this + .serviceClient() + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkPortMirroringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { + this.serviceClient().deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName); + } + + public void deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + this.serviceClient().deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, context); + } + + public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listVMGroups(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVMGroupImpl(inner1, this.manager())); + } + + public PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listVMGroups(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVMGroupImpl(inner1, this.manager())); + } + + public WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) { + WorkloadNetworkVMGroupInner inner = + this.serviceClient().getVMGroup(resourceGroupName, privateCloudName, vmGroupId); + if (inner != null) { + return new WorkloadNetworkVMGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context) { + Response inner = + this.serviceClient().getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkVMGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { + this.serviceClient().deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName); + } + + public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + this.serviceClient().deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, context); + } + + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listVirtualMachines(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listVirtualMachines(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVirtualMachineImpl(inner1, this.manager())); + } + + public WorkloadNetworkVirtualMachine getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + WorkloadNetworkVirtualMachineInner inner = + this.serviceClient().getVirtualMachine(resourceGroupName, privateCloudName, virtualMachineId); + if (inner != null) { + return new WorkloadNetworkVirtualMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineWithResponse(resourceGroupName, privateCloudName, virtualMachineId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkVirtualMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listDnsServices(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listDnsServices(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsServiceImpl(inner1, this.manager())); + } + + public PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listDnsServices(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsServiceImpl(inner1, this.manager())); + } + + public WorkloadNetworkDnsService getDnsService( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + WorkloadNetworkDnsServiceInner inner = + this.serviceClient().getDnsService(resourceGroupName, privateCloudName, dnsServiceId); + if (inner != null) { + return new WorkloadNetworkDnsServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context) { + Response inner = + this.serviceClient().getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkDnsServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) { + this.serviceClient().deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName); + } + + public void deleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + this.serviceClient().deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, context); + } + + public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listDnsZones(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsZoneImpl(inner1, this.manager())); + } + + public PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listDnsZones(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsZoneImpl(inner1, this.manager())); + } + + public WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) { + WorkloadNetworkDnsZoneInner inner = + this.serviceClient().getDnsZone(resourceGroupName, privateCloudName, dnsZoneId); + if (inner != null) { + return new WorkloadNetworkDnsZoneImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context) { + Response inner = + this.serviceClient().getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkDnsZoneImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) { + this.serviceClient().deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName); + } + + public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + this.serviceClient().deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, context); + } + + public PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listPublicIPs(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkPublicIpImpl(inner1, this.manager())); + } + + public PagedIterable listPublicIPs( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listPublicIPs(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkPublicIpImpl(inner1, this.manager())); + } + + public WorkloadNetworkPublicIp getPublicIp(String resourceGroupName, String privateCloudName, String publicIpId) { + WorkloadNetworkPublicIpInner inner = + this.serviceClient().getPublicIp(resourceGroupName, privateCloudName, publicIpId); + if (inner != null) { + return new WorkloadNetworkPublicIpImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPublicIpWithResponse( + String resourceGroupName, String privateCloudName, String publicIpId, Context context) { + Response inner = + this.serviceClient().getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkPublicIpImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName) { + this.serviceClient().deletePublicIp(resourceGroupName, publicIpId, privateCloudName); + } + + public void deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context) { + this.serviceClient().deletePublicIp(resourceGroupName, publicIpId, privateCloudName, context); + } + + public WorkloadNetworkSegment getSegmentById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + return this.getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE).getValue(); + } + + public Response getSegmentByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + return this.getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context); + } + + public WorkloadNetworkDhcp getDhcpById(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 dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + return this.getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE).getValue(); + } + + public Response getDhcpByIdWithResponse(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 dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + return this.getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context); + } + + public WorkloadNetworkPortMirroring getPortMirroringById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + return this + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE) + .getValue(); + } + + public Response getPortMirroringByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + return this.getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context); + } + + public WorkloadNetworkVMGroup getVMGroupById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + return this.getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE).getValue(); + } + + public Response getVMGroupByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + return this.getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context); + } + + public WorkloadNetworkDnsService getDnsServiceById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + return this + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE) + .getValue(); + } + + public Response getDnsServiceByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + return this.getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context); + } + + public WorkloadNetworkDnsZone getDnsZoneById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + return this.getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE).getValue(); + } + + public Response getDnsZoneByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + return this.getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context); + } + + public WorkloadNetworkPublicIp getPublicIpById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String publicIpId = Utils.getValueFromIdByName(id, "publicIPs"); + if (publicIpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); + } + return this.getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, Context.NONE).getValue(); + } + + public Response getPublicIpByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String publicIpId = Utils.getValueFromIdByName(id, "publicIPs"); + if (publicIpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); + } + return this.getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, context); + } + + public void deleteSegmentById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + this.deleteSegment(resourceGroupName, privateCloudName, segmentId, Context.NONE); + } + + public void deleteSegmentByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + this.deleteSegment(resourceGroupName, privateCloudName, segmentId, context); + } + + public void deleteDhcpById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + this.deleteDhcp(resourceGroupName, privateCloudName, dhcpId, Context.NONE); + } + + public void deleteDhcpByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + this.deleteDhcp(resourceGroupName, privateCloudName, dhcpId, context); + } + + public void deletePortMirroringById(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 portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, Context.NONE); + } + + public void deletePortMirroringByIdWithResponse(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 portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, context); + } + + public void deleteVMGroupById(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 vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, Context.NONE); + } + + public void deleteVMGroupByIdWithResponse(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 vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, context); + } + + public void deleteDnsServiceById(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 dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, Context.NONE); + } + + public void deleteDnsServiceByIdWithResponse(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 dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, context); + } + + public void deleteDnsZoneById(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 dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, Context.NONE); + } + + public void deleteDnsZoneByIdWithResponse(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 dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, context); + } + + public void deletePublicIpById(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 publicIpId = Utils.getValueFromIdByName(id, "publicIPs"); + if (publicIpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deletePublicIp(resourceGroupName, publicIpId, privateCloudName, Context.NONE); + } + + public void deletePublicIpByIdWithResponse(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 publicIpId = Utils.getValueFromIdByName(id, "publicIPs"); + if (publicIpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicIPs'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deletePublicIp(resourceGroupName, publicIpId, privateCloudName, context); + } + + private WorkloadNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public WorkloadNetworkSegmentImpl defineSegments(String name) { + return new WorkloadNetworkSegmentImpl(name, this.manager()); + } + + public WorkloadNetworkDhcpImpl defineDhcp(String name) { + return new WorkloadNetworkDhcpImpl(name, this.manager()); + } + + public WorkloadNetworkPortMirroringImpl definePortMirroring(String name) { + return new WorkloadNetworkPortMirroringImpl(name, this.manager()); + } + + public WorkloadNetworkVMGroupImpl defineVMGroup(String name) { + return new WorkloadNetworkVMGroupImpl(name, this.manager()); + } + + public WorkloadNetworkDnsServiceImpl defineDnsService(String name) { + return new WorkloadNetworkDnsServiceImpl(name, this.manager()); + } + + public WorkloadNetworkDnsZoneImpl defineDnsZone(String name) { + return new WorkloadNetworkDnsZoneImpl(name, this.manager()); + } + + public WorkloadNetworkPublicIpImpl definePublicIp(String name) { + return new WorkloadNetworkPublicIpImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java new file mode 100644 index 000000000000..980b007256c6 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; + +/** An immutable client-side representation of Addon. */ +public interface Addon { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The properties of an addon resource. + * + * @return the properties value. + */ + AddonProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.AddonInner object. + * + * @return the inner object. + */ + AddonInner innerModel(); + + /** The entirety of the Addon definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Addon definition stages. */ + interface DefinitionStages { + /** The first stage of the Addon definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Addon definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the Addon 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Addon create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Addon create(Context context); + } + /** The stage of the Addon definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of an addon resource. + * + * @param properties The properties of an addon resource. + * @return the next definition stage. + */ + WithCreate withProperties(AddonProperties properties); + } + } + /** + * Begins update for the Addon resource. + * + * @return the stage of resource update. + */ + Addon.Update update(); + + /** The template for Addon update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Addon apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Addon apply(Context context); + } + /** The Addon update stages. */ + interface UpdateStages { + /** The stage of the Addon update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of an addon resource. + * + * @param properties The properties of an addon resource. + * @return the next definition stage. + */ + Update withProperties(AddonProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Addon refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Addon refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java new file mode 100644 index 000000000000..f5e45d024a9f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The properties of an HCX addon. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "addonType") +@JsonTypeName("HCX") +@Fluent +public final class AddonHcxProperties extends AddonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonHcxProperties.class); + + /* + * The HCX offer, example VMware MaaS Cloud Provider (Enterprise) + */ + @JsonProperty(value = "offer", required = true) + private String offer; + + /** + * Get the offer property: The HCX offer, example VMware MaaS Cloud Provider (Enterprise). + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: The HCX offer, example VMware MaaS Cloud Provider (Enterprise). + * + * @param offer the offer value to set. + * @return the AddonHcxProperties object itself. + */ + public AddonHcxProperties withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (offer() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property offer in model AddonHcxProperties")); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java new file mode 100644 index 000000000000..abec9b8b2c5a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of addons. */ +@Immutable +public final class AddonList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java new file mode 100644 index 000000000000..20727cbb2d95 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The properties of an addon. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "addonType", + defaultImpl = AddonProperties.class) +@JsonTypeName("AddonProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SRM", value = AddonSrmProperties.class), + @JsonSubTypes.Type(name = "VR", value = AddonVrProperties.class), + @JsonSubTypes.Type(name = "HCX", value = AddonHcxProperties.class) +}) +@Immutable +public class AddonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonProperties.class); + + /* + * The state of the addon provisioning + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AddonProvisioningState provisioningState; + + /** + * Get the provisioningState property: The state of the addon provisioning. + * + * @return the provisioningState value. + */ + public AddonProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java new file mode 100644 index 000000000000..e5149cb2d39c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AddonProvisioningState. */ +public final class AddonProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AddonProvisioningState. */ + public static final AddonProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AddonProvisioningState. */ + public static final AddonProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for AddonProvisioningState. */ + public static final AddonProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Building for AddonProvisioningState. */ + public static final AddonProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for AddonProvisioningState. */ + public static final AddonProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for AddonProvisioningState. */ + public static final AddonProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a AddonProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddonProvisioningState. + */ + @JsonCreator + public static AddonProvisioningState fromString(String name) { + return fromString(name, AddonProvisioningState.class); + } + + /** @return known AddonProvisioningState values. */ + public static Collection values() { + return values(AddonProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java new file mode 100644 index 000000000000..0fe55973af36 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The properties of a Site Recovery Manager (SRM) addon. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "addonType") +@JsonTypeName("SRM") +@Fluent +public final class AddonSrmProperties extends AddonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonSrmProperties.class); + + /* + * The Site Recovery Manager (SRM) license + */ + @JsonProperty(value = "licenseKey", required = true) + private String licenseKey; + + /** + * Get the licenseKey property: The Site Recovery Manager (SRM) license. + * + * @return the licenseKey value. + */ + public String licenseKey() { + return this.licenseKey; + } + + /** + * Set the licenseKey property: The Site Recovery Manager (SRM) license. + * + * @param licenseKey the licenseKey value to set. + * @return the AddonSrmProperties object itself. + */ + public AddonSrmProperties withLicenseKey(String licenseKey) { + this.licenseKey = licenseKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (licenseKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property licenseKey in model AddonSrmProperties")); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java new file mode 100644 index 000000000000..e2de340fd99f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AddonType. */ +public final class AddonType extends ExpandableStringEnum { + /** Static value SRM for AddonType. */ + public static final AddonType SRM = fromString("SRM"); + + /** Static value VR for AddonType. */ + public static final AddonType VR = fromString("VR"); + + /** Static value HCX for AddonType. */ + public static final AddonType HCX = fromString("HCX"); + + /** + * Creates or finds a AddonType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddonType. + */ + @JsonCreator + public static AddonType fromString(String name) { + return fromString(name, AddonType.class); + } + + /** @return known AddonType values. */ + public static Collection values() { + return values(AddonType.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java new file mode 100644 index 000000000000..6435a9f27174 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The properties of a vSphere Replication (VR) addon. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "addonType") +@JsonTypeName("VR") +@Fluent +public final class AddonVrProperties extends AddonProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonVrProperties.class); + + /* + * The vSphere Replication Server (VRS) count + */ + @JsonProperty(value = "vrsCount", required = true) + private int vrsCount; + + /** + * Get the vrsCount property: The vSphere Replication Server (VRS) count. + * + * @return the vrsCount value. + */ + public int vrsCount() { + return this.vrsCount; + } + + /** + * Set the vrsCount property: The vSphere Replication Server (VRS) count. + * + * @param vrsCount the vrsCount value to set. + * @return the AddonVrProperties object itself. + */ + public AddonVrProperties withVrsCount(int vrsCount) { + this.vrsCount = vrsCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java new file mode 100644 index 000000000000..d13c1a4397a5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.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.avs.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 Addons. */ +public interface Addons { + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of addons. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of addons. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + Addon get(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateCloudName, String addonName); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @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 privateCloudName, String addonName, Context context); + + /** + * Get an addon by name in a private cloud. + * + * @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 an addon by name in a private cloud. + */ + Addon getById(String id); + + /** + * Get an addon by name in a private cloud. + * + * @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 an addon by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a addon in a private cloud. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a addon in a private cloud. + * + * @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 Addon resource. + * + * @param name resource name. + * @return the first stage of the new Addon definition. + */ + Addon.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLink.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLink.java new file mode 100644 index 000000000000..6d228c66e7fb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLink.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.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; + +/** An immutable client-side representation of CloudLink. */ +public interface CloudLink { + /** + * 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 status property: The state of the cloud link. + * + * @return the status value. + */ + CloudLinkStatus status(); + + /** + * Gets the linkedCloud property: Identifier of the other private cloud participating in the link. + * + * @return the linkedCloud value. + */ + String linkedCloud(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.CloudLinkInner object. + * + * @return the inner object. + */ + CloudLinkInner innerModel(); + + /** The entirety of the CloudLink definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CloudLink definition stages. */ + interface DefinitionStages { + /** The first stage of the CloudLink definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CloudLink definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the CloudLink 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.WithLinkedCloud { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudLink create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudLink create(Context context); + } + /** The stage of the CloudLink definition allowing to specify linkedCloud. */ + interface WithLinkedCloud { + /** + * Specifies the linkedCloud property: Identifier of the other private cloud participating in the link.. + * + * @param linkedCloud Identifier of the other private cloud participating in the link. + * @return the next definition stage. + */ + WithCreate withLinkedCloud(String linkedCloud); + } + } + /** + * Begins update for the CloudLink resource. + * + * @return the stage of resource update. + */ + CloudLink.Update update(); + + /** The template for CloudLink update. */ + interface Update extends UpdateStages.WithLinkedCloud { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudLink apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudLink apply(Context context); + } + /** The CloudLink update stages. */ + interface UpdateStages { + /** The stage of the CloudLink update allowing to specify linkedCloud. */ + interface WithLinkedCloud { + /** + * Specifies the linkedCloud property: Identifier of the other private cloud participating in the link.. + * + * @param linkedCloud Identifier of the other private cloud participating in the link. + * @return the next definition stage. + */ + Update withLinkedCloud(String linkedCloud); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudLink refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudLink refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkList.java new file mode 100644 index 000000000000..8edb8a431cb2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.CloudLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of cloud links. */ +@Immutable +public final class CloudLinkList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudLinkList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkStatus.java new file mode 100644 index 000000000000..cb60c0711ea2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinkStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CloudLinkStatus. */ +public final class CloudLinkStatus extends ExpandableStringEnum { + /** Static value Active for CloudLinkStatus. */ + public static final CloudLinkStatus ACTIVE = fromString("Active"); + + /** Static value Building for CloudLinkStatus. */ + public static final CloudLinkStatus BUILDING = fromString("Building"); + + /** Static value Deleting for CloudLinkStatus. */ + public static final CloudLinkStatus DELETING = fromString("Deleting"); + + /** Static value Failed for CloudLinkStatus. */ + public static final CloudLinkStatus FAILED = fromString("Failed"); + + /** Static value Disconnected for CloudLinkStatus. */ + public static final CloudLinkStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a CloudLinkStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudLinkStatus. + */ + @JsonCreator + public static CloudLinkStatus fromString(String name) { + return fromString(name, CloudLinkStatus.class); + } + + /** @return known CloudLinkStatus values. */ + public static Collection values() { + return values(CloudLinkStatus.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinks.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinks.java new file mode 100644 index 000000000000..29fc017548fd --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CloudLinks.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.avs.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 CloudLinks. */ +public interface CloudLinks { + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of cloud links. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of cloud links. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + CloudLink get(String resourceGroupName, String privateCloudName, String cloudLinkName); + + /** + * Get an cloud link by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an cloud link by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String cloudLinkName, Context context); + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String cloudLinkName); + + /** + * Delete a cloud link in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param cloudLinkName Name of the cloud link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context); + + /** + * Get an cloud link by name in a private cloud. + * + * @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 an cloud link by name in a private cloud. + */ + CloudLink getById(String id); + + /** + * Get an cloud link by name in a private cloud. + * + * @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 an cloud link by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a cloud link in a private cloud. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a cloud link in a private cloud. + * + * @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 CloudLink resource. + * + * @param name resource name. + * @return the first stage of the new CloudLink definition. + */ + CloudLink.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java index ddaec0dd4937..ead58744acfd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java @@ -10,7 +10,7 @@ /** The properties of a cluster. */ @Immutable -public final class ClusterProperties extends ManagementCluster { +public final class ClusterProperties extends CommonClusterProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterProperties.class); /** {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CommonClusterProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CommonClusterProperties.java new file mode 100644 index 000000000000..37688fa202e6 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CommonClusterProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The common properties of a cluster. */ +@Fluent +public class CommonClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CommonClusterProperties.class); + + /* + * The cluster size + */ + @JsonProperty(value = "clusterSize") + private Integer clusterSize; + + /* + * The state of the cluster provisioning + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterProvisioningState provisioningState; + + /* + * The identity + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private Integer clusterId; + + /* + * The hosts + */ + @JsonProperty(value = "hosts", access = JsonProperty.Access.WRITE_ONLY) + private List hosts; + + /** + * Get the clusterSize property: The cluster size. + * + * @return the clusterSize value. + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the clusterSize property: The cluster size. + * + * @param clusterSize the clusterSize value to set. + * @return the CommonClusterProperties object itself. + */ + public CommonClusterProperties withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + + /** + * Get the provisioningState property: The state of the cluster provisioning. + * + * @return the provisioningState value. + */ + public ClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterId property: The identity. + * + * @return the clusterId value. + */ + public Integer clusterId() { + return this.clusterId; + } + + /** + * Get the hosts property: The hosts. + * + * @return the hosts value. + */ + public List hosts() { + return this.hosts; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java new file mode 100644 index 000000000000..b09805e2964b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; + +/** An immutable client-side representation of Datastore. */ +public interface Datastore { + /** + * 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 provisioningState property: The state of the datastore provisioning. + * + * @return the provisioningState value. + */ + DatastoreProvisioningState provisioningState(); + + /** + * Gets the netAppVolume property: An Azure NetApp Files volume. + * + * @return the netAppVolume value. + */ + NetAppVolume netAppVolume(); + + /** + * Gets the diskPoolVolume property: An iSCSI volume. + * + * @return the diskPoolVolume value. + */ + DiskPoolVolume diskPoolVolume(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.DatastoreInner object. + * + * @return the inner object. + */ + DatastoreInner innerModel(); + + /** The entirety of the Datastore definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Datastore definition stages. */ + interface DefinitionStages { + /** The first stage of the Datastore definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Datastore definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String privateCloudName, String clusterName); + } + /** + * The stage of the Datastore 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.WithNetAppVolume, DefinitionStages.WithDiskPoolVolume { + /** + * Executes the create request. + * + * @return the created resource. + */ + Datastore create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Datastore create(Context context); + } + /** The stage of the Datastore definition allowing to specify netAppVolume. */ + interface WithNetAppVolume { + /** + * Specifies the netAppVolume property: An Azure NetApp Files volume. + * + * @param netAppVolume An Azure NetApp Files volume. + * @return the next definition stage. + */ + WithCreate withNetAppVolume(NetAppVolume netAppVolume); + } + /** The stage of the Datastore definition allowing to specify diskPoolVolume. */ + interface WithDiskPoolVolume { + /** + * Specifies the diskPoolVolume property: An iSCSI volume. + * + * @param diskPoolVolume An iSCSI volume. + * @return the next definition stage. + */ + WithCreate withDiskPoolVolume(DiskPoolVolume diskPoolVolume); + } + } + /** + * Begins update for the Datastore resource. + * + * @return the stage of resource update. + */ + Datastore.Update update(); + + /** The template for Datastore update. */ + interface Update extends UpdateStages.WithNetAppVolume, UpdateStages.WithDiskPoolVolume { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Datastore apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Datastore apply(Context context); + } + /** The Datastore update stages. */ + interface UpdateStages { + /** The stage of the Datastore update allowing to specify netAppVolume. */ + interface WithNetAppVolume { + /** + * Specifies the netAppVolume property: An Azure NetApp Files volume. + * + * @param netAppVolume An Azure NetApp Files volume. + * @return the next definition stage. + */ + Update withNetAppVolume(NetAppVolume netAppVolume); + } + /** The stage of the Datastore update allowing to specify diskPoolVolume. */ + interface WithDiskPoolVolume { + /** + * Specifies the diskPoolVolume property: An iSCSI volume. + * + * @param diskPoolVolume An iSCSI volume. + * @return the next definition stage. + */ + Update withDiskPoolVolume(DiskPoolVolume diskPoolVolume); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Datastore refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Datastore refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java new file mode 100644 index 000000000000..0e7688f6f27d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of datastores. */ +@Immutable +public final class DatastoreList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatastoreList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProvisioningState.java new file mode 100644 index 000000000000..5e421f1c07dc --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProvisioningState.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatastoreProvisioningState. */ +public final class DatastoreProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Pending for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState PENDING = fromString("Pending"); + + /** Static value Creating for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates or finds a DatastoreProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatastoreProvisioningState. + */ + @JsonCreator + public static DatastoreProvisioningState fromString(String name) { + return fromString(name, DatastoreProvisioningState.class); + } + + /** @return known DatastoreProvisioningState values. */ + public static Collection values() { + return values(DatastoreProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java new file mode 100644 index 000000000000..e6c8e4f32c36 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 Datastores. */ +public interface Datastores { + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of datastores. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * List datastores in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @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 paged list of datastores. + */ + PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + Datastore get(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Get a datastore in a private cloud cluster. + * + * @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 datastore in a private cloud cluster. + */ + Datastore getById(String id); + + /** + * Get a datastore in a private cloud cluster. + * + * @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 datastore in a private cloud cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a datastore in a private cloud cluster. + * + * @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 Datastore resource. + * + * @param name resource name. + * @return the first stage of the new Datastore definition. + */ + Datastore.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java new file mode 100644 index 000000000000..499ed9b7e829 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DhcpTypeEnum. */ +public final class DhcpTypeEnum extends ExpandableStringEnum { + /** Static value SERVER for DhcpTypeEnum. */ + public static final DhcpTypeEnum SERVER = fromString("SERVER"); + + /** Static value RELAY for DhcpTypeEnum. */ + public static final DhcpTypeEnum RELAY = fromString("RELAY"); + + /** + * Creates or finds a DhcpTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding DhcpTypeEnum. + */ + @JsonCreator + public static DhcpTypeEnum fromString(String name) { + return fromString(name, DhcpTypeEnum.class); + } + + /** @return known DhcpTypeEnum values. */ + public static Collection values() { + return values(DhcpTypeEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java new file mode 100644 index 000000000000..4fdaaaaaa49b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An iSCSI volume from Microsoft.StoragePool provider. */ +@Fluent +public final class DiskPoolVolume { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolVolume.class); + + /* + * Azure resource ID of the iSCSI target + */ + @JsonProperty(value = "targetId", required = true) + private String targetId; + + /* + * Name of the LUN to be used for datastore + */ + @JsonProperty(value = "lunName", required = true) + private String lunName; + + /* + * Mode that describes whether the LUN has to be mounted as a datastore or + * attached as a LUN + */ + @JsonProperty(value = "mountOption") + private MountOptionEnum mountOption; + + /* + * Device path + */ + @JsonProperty(value = "path", access = JsonProperty.Access.WRITE_ONLY) + private String path; + + /** + * Get the targetId property: Azure resource ID of the iSCSI target. + * + * @return the targetId value. + */ + public String targetId() { + return this.targetId; + } + + /** + * Set the targetId property: Azure resource ID of the iSCSI target. + * + * @param targetId the targetId value to set. + * @return the DiskPoolVolume object itself. + */ + public DiskPoolVolume withTargetId(String targetId) { + this.targetId = targetId; + return this; + } + + /** + * Get the lunName property: Name of the LUN to be used for datastore. + * + * @return the lunName value. + */ + public String lunName() { + return this.lunName; + } + + /** + * Set the lunName property: Name of the LUN to be used for datastore. + * + * @param lunName the lunName value to set. + * @return the DiskPoolVolume object itself. + */ + public DiskPoolVolume withLunName(String lunName) { + this.lunName = lunName; + return this; + } + + /** + * Get the mountOption property: Mode that describes whether the LUN has to be mounted as a datastore or attached as + * a LUN. + * + * @return the mountOption value. + */ + public MountOptionEnum mountOption() { + return this.mountOption; + } + + /** + * Set the mountOption property: Mode that describes whether the LUN has to be mounted as a datastore or attached as + * a LUN. + * + * @param mountOption the mountOption value to set. + * @return the DiskPoolVolume object itself. + */ + public DiskPoolVolume withMountOption(MountOptionEnum mountOption) { + this.mountOption = mountOption; + return this; + } + + /** + * Get the path property: Device path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property targetId in model DiskPoolVolume")); + } + if (lunName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property lunName in model DiskPoolVolume")); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java new file mode 100644 index 000000000000..c6563e416b17 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DnsServiceLogLevelEnum. */ +public final class DnsServiceLogLevelEnum extends ExpandableStringEnum { + /** Static value DEBUG for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum DEBUG = fromString("DEBUG"); + + /** Static value INFO for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum INFO = fromString("INFO"); + + /** Static value WARNING for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum WARNING = fromString("WARNING"); + + /** Static value ERROR for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum ERROR = fromString("ERROR"); + + /** Static value FATAL for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum FATAL = fromString("FATAL"); + + /** + * Creates or finds a DnsServiceLogLevelEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsServiceLogLevelEnum. + */ + @JsonCreator + public static DnsServiceLogLevelEnum fromString(String name) { + return fromString(name, DnsServiceLogLevelEnum.class); + } + + /** @return known DnsServiceLogLevelEnum values. */ + public static Collection values() { + return values(DnsServiceLogLevelEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java new file mode 100644 index 000000000000..6da13ca6f03d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DnsServiceStatusEnum. */ +public final class DnsServiceStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS for DnsServiceStatusEnum. */ + public static final DnsServiceStatusEnum SUCCESS = fromString("SUCCESS"); + + /** Static value FAILURE for DnsServiceStatusEnum. */ + public static final DnsServiceStatusEnum FAILURE = fromString("FAILURE"); + + /** + * Creates or finds a DnsServiceStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsServiceStatusEnum. + */ + @JsonCreator + public static DnsServiceStatusEnum fromString(String name) { + return fromString(name, DnsServiceStatusEnum.class); + } + + /** @return known DnsServiceStatusEnum values. */ + public static Collection values() { + return values(DnsServiceStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java new file mode 100644 index 000000000000..6f37c17da71a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; + +/** An immutable client-side representation of GlobalReachConnection. */ +public interface GlobalReachConnection { + /** + * 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 provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. + * + * @return the provisioningState value. + */ + GlobalReachConnectionProvisioningState provisioningState(); + + /** + * Gets the addressPrefix property: The network used for global reach carved out from the original network block + * provided for the private cloud. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the authorizationKey property: Authorization key from the peer express route used for the global reach + * connection. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the circuitConnectionStatus property: The connection status of the global reach connection. + * + * @return the circuitConnectionStatus value. + */ + GlobalReachConnectionStatus circuitConnectionStatus(); + + /** + * Gets the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global + * reach connection. + * + * @return the peerExpressRouteCircuit value. + */ + String peerExpressRouteCircuit(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner object. + * + * @return the inner object. + */ + GlobalReachConnectionInner innerModel(); + + /** The entirety of the GlobalReachConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The GlobalReachConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the GlobalReachConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GlobalReachConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the GlobalReachConnection 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.WithAuthorizationKey, DefinitionStages.WithPeerExpressRouteCircuit { + /** + * Executes the create request. + * + * @return the created resource. + */ + GlobalReachConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GlobalReachConnection create(Context context); + } + /** The stage of the GlobalReachConnection definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: Authorization key from the peer express route used for the + * global reach connection. + * + * @param authorizationKey Authorization key from the peer express route used for the global reach + * connection. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** The stage of the GlobalReachConnection definition allowing to specify peerExpressRouteCircuit. */ + interface WithPeerExpressRouteCircuit { + /** + * Specifies the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in + * the global reach connection. + * + * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * @return the next definition stage. + */ + WithCreate withPeerExpressRouteCircuit(String peerExpressRouteCircuit); + } + } + /** + * Begins update for the GlobalReachConnection resource. + * + * @return the stage of resource update. + */ + GlobalReachConnection.Update update(); + + /** The template for GlobalReachConnection update. */ + interface Update extends UpdateStages.WithAuthorizationKey, UpdateStages.WithPeerExpressRouteCircuit { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GlobalReachConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GlobalReachConnection apply(Context context); + } + /** The GlobalReachConnection update stages. */ + interface UpdateStages { + /** The stage of the GlobalReachConnection update allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: Authorization key from the peer express route used for the + * global reach connection. + * + * @param authorizationKey Authorization key from the peer express route used for the global reach + * connection. + * @return the next definition stage. + */ + Update withAuthorizationKey(String authorizationKey); + } + /** The stage of the GlobalReachConnection update allowing to specify peerExpressRouteCircuit. */ + interface WithPeerExpressRouteCircuit { + /** + * Specifies the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in + * the global reach connection. + * + * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * @return the next definition stage. + */ + Update withPeerExpressRouteCircuit(String peerExpressRouteCircuit); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GlobalReachConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GlobalReachConnection refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java new file mode 100644 index 000000000000..0fe961e0c62f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of global reach connections. */ +@Immutable +public final class GlobalReachConnectionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalReachConnectionList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java new file mode 100644 index 000000000000..46e331c555ab --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GlobalReachConnectionProvisioningState. */ +public final class GlobalReachConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for GlobalReachConnectionProvisioningState. */ + public static final GlobalReachConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for GlobalReachConnectionProvisioningState. */ + public static final GlobalReachConnectionProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for GlobalReachConnectionProvisioningState. */ + public static final GlobalReachConnectionProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a GlobalReachConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GlobalReachConnectionProvisioningState. + */ + @JsonCreator + public static GlobalReachConnectionProvisioningState fromString(String name) { + return fromString(name, GlobalReachConnectionProvisioningState.class); + } + + /** @return known GlobalReachConnectionProvisioningState values. */ + public static Collection values() { + return values(GlobalReachConnectionProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java new file mode 100644 index 000000000000..d3c4ca0ffe32 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GlobalReachConnectionStatus. */ +public final class GlobalReachConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for GlobalReachConnectionStatus. */ + public static final GlobalReachConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Connecting for GlobalReachConnectionStatus. */ + public static final GlobalReachConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Disconnected for GlobalReachConnectionStatus. */ + public static final GlobalReachConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a GlobalReachConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding GlobalReachConnectionStatus. + */ + @JsonCreator + public static GlobalReachConnectionStatus fromString(String name) { + return fromString(name, GlobalReachConnectionStatus.class); + } + + /** @return known GlobalReachConnectionStatus values. */ + public static Collection values() { + return values(GlobalReachConnectionStatus.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java new file mode 100644 index 000000000000..861a4a862cd3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.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.avs.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 GlobalReachConnections. */ +public interface GlobalReachConnections { + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paged list of global reach connections. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 paged list of global reach connections. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 global reach connection by name in a private cloud. + */ + GlobalReachConnection get(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @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 global reach connection by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateCloudName, String globalReachConnectionName); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @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 privateCloudName, String globalReachConnectionName, Context context); + + /** + * Get a global reach connection by name in a private cloud. + * + * @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 global reach connection by name in a private cloud. + */ + GlobalReachConnection getById(String id); + + /** + * Get a global reach connection by name in a private cloud. + * + * @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 global reach connection by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a global reach connection in a private cloud. + * + * @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 GlobalReachConnection resource. + * + * @param name resource name. + * @return the first stage of the new GlobalReachConnection definition. + */ + GlobalReachConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java index 97f17ec58310..eeba5663db84 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java @@ -7,59 +7,12 @@ import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -/** The properties of a default cluster. */ +/** The properties of a management cluster. */ @Immutable -public class ManagementCluster extends ClusterUpdateProperties { +public final class ManagementCluster extends CommonClusterProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementCluster.class); - /* - * The state of the cluster provisioning - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ClusterProvisioningState provisioningState; - - /* - * The identity - */ - @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) - private Integer clusterId; - - /* - * The hosts - */ - @JsonProperty(value = "hosts", access = JsonProperty.Access.WRITE_ONLY) - private List hosts; - - /** - * Get the provisioningState property: The state of the cluster provisioning. - * - * @return the provisioningState value. - */ - public ClusterProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the clusterId property: The identity. - * - * @return the clusterId value. - */ - public Integer clusterId() { - return this.clusterId; - } - - /** - * Get the hosts property: The hosts. - * - * @return the hosts value. - */ - public List hosts() { - return this.hosts; - } - /** {@inheritDoc} */ @Override public ManagementCluster withClusterSize(Integer clusterSize) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MountOptionEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MountOptionEnum.java new file mode 100644 index 000000000000..3eb683764f9d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MountOptionEnum.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MountOptionEnum. */ +public final class MountOptionEnum extends ExpandableStringEnum { + /** Static value MOUNT for MountOptionEnum. */ + public static final MountOptionEnum MOUNT = fromString("MOUNT"); + + /** Static value ATTACH for MountOptionEnum. */ + public static final MountOptionEnum ATTACH = fromString("ATTACH"); + + /** + * Creates or finds a MountOptionEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding MountOptionEnum. + */ + @JsonCreator + public static MountOptionEnum fromString(String name) { + return fromString(name, MountOptionEnum.class); + } + + /** @return known MountOptionEnum values. */ + public static Collection values() { + return values(MountOptionEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java new file mode 100644 index 000000000000..0390a4183a87 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Azure NetApp Files volume from Microsoft.NetApp provider. */ +@Fluent +public final class NetAppVolume { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetAppVolume.class); + + /* + * Azure resource ID of the NetApp volume + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Azure resource ID of the NetApp volume. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Azure resource ID of the NetApp volume. + * + * @param id the id value to set. + * @return the NetAppVolume object itself. + */ + public NetAppVolume withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model NetAppVolume")); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OptionalParamEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OptionalParamEnum.java new file mode 100644 index 000000000000..e75365aff594 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OptionalParamEnum.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OptionalParamEnum. */ +public final class OptionalParamEnum extends ExpandableStringEnum { + /** Static value Optional for OptionalParamEnum. */ + public static final OptionalParamEnum OPTIONAL = fromString("Optional"); + + /** Static value Required for OptionalParamEnum. */ + public static final OptionalParamEnum REQUIRED = fromString("Required"); + + /** + * Creates or finds a OptionalParamEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding OptionalParamEnum. + */ + @JsonCreator + public static OptionalParamEnum fromString(String name) { + return fromString(name, OptionalParamEnum.class); + } + + /** @return known OptionalParamEnum values. */ + public static Collection values() { + return values(OptionalParamEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PSCredentialExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PSCredentialExecutionParameter.java new file mode 100644 index 000000000000..10b9df8042d6 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PSCredentialExecutionParameter.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** a powershell credential object. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Credential") +@Fluent +public final class PSCredentialExecutionParameter extends ScriptExecutionParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PSCredentialExecutionParameter.class); + + /* + * username for login + */ + @JsonProperty(value = "username") + private String username; + + /* + * password for login + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the username property: username for login. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: username for login. + * + * @param username the username value to set. + * @return the PSCredentialExecutionParameter object itself. + */ + public PSCredentialExecutionParameter withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: password for login. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: password for login. + * + * @param password the password value to set. + * @return the PSCredentialExecutionParameter object itself. + */ + public PSCredentialExecutionParameter withPassword(String password) { + this.password = password; + return this; + } + + /** {@inheritDoc} */ + @Override + public PSCredentialExecutionParameter withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java new file mode 100644 index 000000000000..d75a58eda10e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PortMirroringDirectionEnum. */ +public final class PortMirroringDirectionEnum extends ExpandableStringEnum { + /** Static value INGRESS, EGRESS, BIDIRECTIONAL for PortMirroringDirectionEnum. */ + public static final PortMirroringDirectionEnum INGRESS_EGRESS_BIDIRECTIONAL = + fromString("INGRESS, EGRESS, BIDIRECTIONAL"); + + /** + * Creates or finds a PortMirroringDirectionEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding PortMirroringDirectionEnum. + */ + @JsonCreator + public static PortMirroringDirectionEnum fromString(String name) { + return fromString(name, PortMirroringDirectionEnum.class); + } + + /** @return known PortMirroringDirectionEnum values. */ + public static Collection values() { + return values(PortMirroringDirectionEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java new file mode 100644 index 000000000000..80db3b35d43d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PortMirroringStatusEnum. */ +public final class PortMirroringStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS, FAILURE for PortMirroringStatusEnum. */ + public static final PortMirroringStatusEnum SUCCESS_FAILURE = fromString("SUCCESS, FAILURE"); + + /** + * Creates or finds a PortMirroringStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding PortMirroringStatusEnum. + */ + @JsonCreator + public static PortMirroringStatusEnum fromString(String name) { + return fromString(name, PortMirroringStatusEnum.class); + } + + /** @return known PortMirroringStatusEnum values. */ + public static Collection values() { + return values(PortMirroringStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java index 03923bf269e7..a6206fd9b4d4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java @@ -155,6 +155,13 @@ public interface PrivateCloud { */ String nsxtCertificateThumbprint(); + /** + * Gets the externalCloudLinks property: Array of cloud link IDs from other clouds that connect to this one. + * + * @return the externalCloudLinks value. + */ + List externalCloudLinks(); + /** * Gets the region of the resource. * @@ -182,7 +189,6 @@ interface Definition DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, - DefinitionStages.WithNetworkBlock, DefinitionStages.WithCreate { } /** The PrivateCloud definition stages. */ @@ -226,21 +232,7 @@ interface WithSku { * @param sku The private cloud SKU. * @return the next definition stage. */ - WithNetworkBlock withSku(Sku sku); - } - /** The stage of the PrivateCloud definition allowing to specify networkBlock. */ - interface WithNetworkBlock { - /** - * Specifies the networkBlock property: The block of addresses should be unique across VNet in your - * subscription as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D - * are between 0 and 255, and X is between 0 and 22. - * - * @param networkBlock The block of addresses should be unique across VNet in your subscription as well as - * on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and - * 255, and X is between 0 and 22. - * @return the next definition stage. - */ - WithCreate withNetworkBlock(String networkBlock); + WithCreate withSku(Sku sku); } /** * The stage of the PrivateCloud definition which contains all the minimum required properties for the resource @@ -252,6 +244,7 @@ interface WithCreate DefinitionStages.WithInternet, DefinitionStages.WithIdentitySources, DefinitionStages.WithCircuit, + DefinitionStages.WithNetworkBlock, DefinitionStages.WithVcenterPassword, DefinitionStages.WithNsxtPassword { /** @@ -319,6 +312,20 @@ interface WithCircuit { */ WithCreate withCircuit(Circuit circuit); } + /** The stage of the PrivateCloud definition allowing to specify networkBlock. */ + interface WithNetworkBlock { + /** + * Specifies the networkBlock property: The block of addresses should be unique across VNet in your + * subscription as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D + * are between 0 and 255, and X is between 0 and 22. + * + * @param networkBlock The block of addresses should be unique across VNet in your subscription as well as + * on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and + * 255, and X is between 0 and 22. + * @return the next definition stage. + */ + WithCreate withNetworkBlock(String networkBlock); + } /** The stage of the PrivateCloud definition allowing to specify vcenterPassword. */ interface WithVcenterPassword { /** @@ -375,7 +382,7 @@ interface UpdateStages { /** The stage of the PrivateCloud update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Resource tags.. + * Specifies the tags property: Resource tags. * * @param tags Resource tags. * @return the next definition stage. @@ -428,6 +435,42 @@ interface WithIdentitySources { */ PrivateCloud refresh(Context context); + /** + * Rotate the vCenter password. + * + * @throws com.azure.core.management.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 rotateVcenterPassword(); + + /** + * Rotate the vCenter password. + * + * @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 rotateVcenterPassword(Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @throws com.azure.core.management.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 rotateNsxtPassword(); + + /** + * Rotate the NSX-T Manager password. + * + * @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 rotateNsxtPassword(Context context); + /** * List the admin credentials for the private cloud. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java index 7b7cba390b7e..ee4f3d617564 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java @@ -86,6 +86,12 @@ public final class PrivateCloudProperties extends PrivateCloudUpdateProperties { @JsonProperty(value = "nsxtCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) private String nsxtCertificateThumbprint; + /* + * Array of cloud link IDs from other clouds that connect to this one + */ + @JsonProperty(value = "externalCloudLinks", access = JsonProperty.Access.WRITE_ONLY) + private List externalCloudLinks; + /** * Get the provisioningState property: The provisioning state. * @@ -233,6 +239,15 @@ public String nsxtCertificateThumbprint() { return this.nsxtCertificateThumbprint; } + /** + * Get the externalCloudLinks property: Array of cloud link IDs from other clouds that connect to this one. + * + * @return the externalCloudLinks value. + */ + public List externalCloudLinks() { + return this.externalCloudLinks; + } + /** {@inheritDoc} */ @Override public PrivateCloudProperties withManagementCluster(ManagementCluster managementCluster) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java index 55fe43ed44ac..16dc700121b5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java @@ -19,7 +19,7 @@ public class PrivateCloudUpdate { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateCloudUpdate.class); /* - * Resource tags. + * Resource tags */ @JsonProperty(value = "tags") private Map tags; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java index 9cf8165e0a6e..f1eefd6da32a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java @@ -102,6 +102,52 @@ Response getByResourceGroupWithResponse( */ void delete(String resourceGroupName, String privateCloudName, Context context); + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateVcenterPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateNsxtPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context); + /** * List the admin credentials for the private cloud. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlet.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlet.java new file mode 100644 index 000000000000..cab17dc55526 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlet.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; +import java.util.List; + +/** An immutable client-side representation of ScriptCmdlet. */ +public interface ScriptCmdlet { + /** + * 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 description property: Description of the scripts functionality. + * + * @return the description value. + */ + String description(); + + /** + * Gets the timeout property: Recommended time limit for execution. + * + * @return the timeout value. + */ + String timeout(); + + /** + * Gets the parameters property: Parameters the script will accept. + * + * @return the parameters value. + */ + List parameters(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner object. + * + * @return the inner object. + */ + ScriptCmdletInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlets.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlets.java new file mode 100644 index 000000000000..1804af8b0fd5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdlets.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.avs.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 ScriptCmdlets. */ +public interface ScriptCmdlets { + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 pageable list of scripts/cmdlets. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, String scriptPackageName); + + /** + * Return script cmdlet resources available for a private cloud to create a script execution resource on their + * Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 pageable list of scripts/cmdlets. + */ + PagedIterable list( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context); + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cmdlet available for script execution. + */ + ScriptCmdlet get( + String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName); + + /** + * Return information about a script cmdlet resource in a specific package on a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @param scriptCmdletName Name of the script cmdlet resource in the script package in the private cloud. + * @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 cmdlet available for script execution. + */ + Response getWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptPackageName, + String scriptCmdletName, + Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletsList.java new file mode 100644 index 000000000000..da41bb74f31a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptCmdletsList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pageable list of scripts/cmdlets. */ +@Immutable +public final class ScriptCmdletsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptCmdletsList.class); + + /* + * List of scripts + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of scripts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecution.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecution.java new file mode 100644 index 000000000000..dd7fd277b2a6 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecution.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ScriptExecution. */ +public interface ScriptExecution { + /** + * 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 scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS script. + * + * @return the scriptCmdletId value. + */ + String scriptCmdletId(); + + /** + * Gets the parameters property: Parameters the script will accept. + * + * @return the parameters value. + */ + List parameters(); + + /** + * Gets the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as passwords and + * credentials. + * + * @return the hiddenParameters value. + */ + List hiddenParameters(); + + /** + * Gets the failureReason property: Error message if the script was able to run, but if the script itself had errors + * or powershell threw an exception. + * + * @return the failureReason value. + */ + String failureReason(); + + /** + * Gets the timeout property: Time limit for execution. + * + * @return the timeout value. + */ + String timeout(); + + /** + * Gets the retention property: Time to live for the resource. If not provided, will be available for 60 days. + * + * @return the retention value. + */ + String retention(); + + /** + * Gets the submittedAt property: Time the script execution was submitted. + * + * @return the submittedAt value. + */ + OffsetDateTime submittedAt(); + + /** + * Gets the startedAt property: Time the script execution was started. + * + * @return the startedAt value. + */ + OffsetDateTime startedAt(); + + /** + * Gets the finishedAt property: Time the script execution was finished. + * + * @return the finishedAt value. + */ + OffsetDateTime finishedAt(); + + /** + * Gets the provisioningState property: The state of the script execution resource. + * + * @return the provisioningState value. + */ + ScriptExecutionProvisioningState provisioningState(); + + /** + * Gets the output property: Standard output stream from the powershell execution. + * + * @return the output value. + */ + List output(); + + /** + * Gets the namedOutputs property: User-defined dictionary. + * + * @return the namedOutputs value. + */ + Map namedOutputs(); + + /** + * Gets the information property: Standard information out stream from the powershell execution. + * + * @return the information value. + */ + List information(); + + /** + * Gets the warnings property: Standard warning out stream from the powershell execution. + * + * @return the warnings value. + */ + List warnings(); + + /** + * Gets the errors property: Standard error output stream from the powershell execution. + * + * @return the errors value. + */ + List errors(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner object. + * + * @return the inner object. + */ + ScriptExecutionInner innerModel(); + + /** The entirety of the ScriptExecution definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ScriptExecution definition stages. */ + interface DefinitionStages { + /** The first stage of the ScriptExecution definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ScriptExecution definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the ScriptExecution 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.WithScriptCmdletId, + DefinitionStages.WithParameters, + DefinitionStages.WithHiddenParameters, + DefinitionStages.WithFailureReason, + DefinitionStages.WithTimeout, + DefinitionStages.WithRetention, + DefinitionStages.WithOutput, + DefinitionStages.WithNamedOutputs { + /** + * Executes the create request. + * + * @return the created resource. + */ + ScriptExecution create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ScriptExecution create(Context context); + } + /** The stage of the ScriptExecution definition allowing to specify scriptCmdletId. */ + interface WithScriptCmdletId { + /** + * Specifies the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS + * script. + * + * @param scriptCmdletId A reference to the script cmdlet resource if user is running a AVS script. + * @return the next definition stage. + */ + WithCreate withScriptCmdletId(String scriptCmdletId); + } + /** The stage of the ScriptExecution definition allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: Parameters the script will accept. + * + * @param parameters Parameters the script will accept. + * @return the next definition stage. + */ + WithCreate withParameters(List parameters); + } + /** The stage of the ScriptExecution definition allowing to specify hiddenParameters. */ + interface WithHiddenParameters { + /** + * Specifies the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as + * passwords and credentials. + * + * @param hiddenParameters Parameters that will be hidden/not visible to ARM, such as passwords and + * credentials. + * @return the next definition stage. + */ + WithCreate withHiddenParameters(List hiddenParameters); + } + /** The stage of the ScriptExecution definition allowing to specify failureReason. */ + interface WithFailureReason { + /** + * Specifies the failureReason property: Error message if the script was able to run, but if the script + * itself had errors or powershell threw an exception. + * + * @param failureReason Error message if the script was able to run, but if the script itself had errors or + * powershell threw an exception. + * @return the next definition stage. + */ + WithCreate withFailureReason(String failureReason); + } + /** The stage of the ScriptExecution definition allowing to specify timeout. */ + interface WithTimeout { + /** + * Specifies the timeout property: Time limit for execution. + * + * @param timeout Time limit for execution. + * @return the next definition stage. + */ + WithCreate withTimeout(String timeout); + } + /** The stage of the ScriptExecution definition allowing to specify retention. */ + interface WithRetention { + /** + * Specifies the retention property: Time to live for the resource. If not provided, will be available for + * 60 days. + * + * @param retention Time to live for the resource. If not provided, will be available for 60 days. + * @return the next definition stage. + */ + WithCreate withRetention(String retention); + } + /** The stage of the ScriptExecution definition allowing to specify output. */ + interface WithOutput { + /** + * Specifies the output property: Standard output stream from the powershell execution. + * + * @param output Standard output stream from the powershell execution. + * @return the next definition stage. + */ + WithCreate withOutput(List output); + } + /** The stage of the ScriptExecution definition allowing to specify namedOutputs. */ + interface WithNamedOutputs { + /** + * Specifies the namedOutputs property: User-defined dictionary.. + * + * @param namedOutputs User-defined dictionary. + * @return the next definition stage. + */ + WithCreate withNamedOutputs(Map namedOutputs); + } + } + /** + * Begins update for the ScriptExecution resource. + * + * @return the stage of resource update. + */ + ScriptExecution.Update update(); + + /** The template for ScriptExecution update. */ + interface Update + extends UpdateStages.WithScriptCmdletId, + UpdateStages.WithParameters, + UpdateStages.WithHiddenParameters, + UpdateStages.WithFailureReason, + UpdateStages.WithTimeout, + UpdateStages.WithRetention, + UpdateStages.WithOutput, + UpdateStages.WithNamedOutputs { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ScriptExecution apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ScriptExecution apply(Context context); + } + /** The ScriptExecution update stages. */ + interface UpdateStages { + /** The stage of the ScriptExecution update allowing to specify scriptCmdletId. */ + interface WithScriptCmdletId { + /** + * Specifies the scriptCmdletId property: A reference to the script cmdlet resource if user is running a AVS + * script. + * + * @param scriptCmdletId A reference to the script cmdlet resource if user is running a AVS script. + * @return the next definition stage. + */ + Update withScriptCmdletId(String scriptCmdletId); + } + /** The stage of the ScriptExecution update allowing to specify parameters. */ + interface WithParameters { + /** + * Specifies the parameters property: Parameters the script will accept. + * + * @param parameters Parameters the script will accept. + * @return the next definition stage. + */ + Update withParameters(List parameters); + } + /** The stage of the ScriptExecution update allowing to specify hiddenParameters. */ + interface WithHiddenParameters { + /** + * Specifies the hiddenParameters property: Parameters that will be hidden/not visible to ARM, such as + * passwords and credentials. + * + * @param hiddenParameters Parameters that will be hidden/not visible to ARM, such as passwords and + * credentials. + * @return the next definition stage. + */ + Update withHiddenParameters(List hiddenParameters); + } + /** The stage of the ScriptExecution update allowing to specify failureReason. */ + interface WithFailureReason { + /** + * Specifies the failureReason property: Error message if the script was able to run, but if the script + * itself had errors or powershell threw an exception. + * + * @param failureReason Error message if the script was able to run, but if the script itself had errors or + * powershell threw an exception. + * @return the next definition stage. + */ + Update withFailureReason(String failureReason); + } + /** The stage of the ScriptExecution update allowing to specify timeout. */ + interface WithTimeout { + /** + * Specifies the timeout property: Time limit for execution. + * + * @param timeout Time limit for execution. + * @return the next definition stage. + */ + Update withTimeout(String timeout); + } + /** The stage of the ScriptExecution update allowing to specify retention. */ + interface WithRetention { + /** + * Specifies the retention property: Time to live for the resource. If not provided, will be available for + * 60 days. + * + * @param retention Time to live for the resource. If not provided, will be available for 60 days. + * @return the next definition stage. + */ + Update withRetention(String retention); + } + /** The stage of the ScriptExecution update allowing to specify output. */ + interface WithOutput { + /** + * Specifies the output property: Standard output stream from the powershell execution. + * + * @param output Standard output stream from the powershell execution. + * @return the next definition stage. + */ + Update withOutput(List output); + } + /** The stage of the ScriptExecution update allowing to specify namedOutputs. */ + interface WithNamedOutputs { + /** + * Specifies the namedOutputs property: User-defined dictionary.. + * + * @param namedOutputs User-defined dictionary. + * @return the next definition stage. + */ + Update withNamedOutputs(Map namedOutputs); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ScriptExecution refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ScriptExecution refresh(Context context); + + /** + * Return the logs for a script execution resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + ScriptExecution getExecutionLogs(); + + /** + * Return the logs for a script execution resource. + * + * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An + * empty array will return nothing. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + Response getExecutionLogsWithResponse( + List scriptOutputStreamType, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameter.java new file mode 100644 index 000000000000..814515ad07ce --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameter.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The arguments passed in to the execution. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = ScriptExecutionParameter.class) +@JsonTypeName("ScriptExecutionParameter") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SecureValue", value = ScriptSecureStringExecutionParameter.class), + @JsonSubTypes.Type(name = "Value", value = ScriptStringExecutionParameter.class), + @JsonSubTypes.Type(name = "Credential", value = PSCredentialExecutionParameter.class) +}) +@Fluent +public class ScriptExecutionParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptExecutionParameter.class); + + /* + * The parameter name + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The parameter name. + * + * @param name the name value to set. + * @return the ScriptExecutionParameter object itself. + */ + public ScriptExecutionParameter 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 ScriptExecutionParameter")); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameterType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameterType.java new file mode 100644 index 000000000000..da5513bd95b2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionParameterType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScriptExecutionParameterType. */ +public final class ScriptExecutionParameterType extends ExpandableStringEnum { + /** Static value Value for ScriptExecutionParameterType. */ + public static final ScriptExecutionParameterType VALUE = fromString("Value"); + + /** Static value SecureValue for ScriptExecutionParameterType. */ + public static final ScriptExecutionParameterType SECURE_VALUE = fromString("SecureValue"); + + /** Static value Credential for ScriptExecutionParameterType. */ + public static final ScriptExecutionParameterType CREDENTIAL = fromString("Credential"); + + /** + * Creates or finds a ScriptExecutionParameterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScriptExecutionParameterType. + */ + @JsonCreator + public static ScriptExecutionParameterType fromString(String name) { + return fromString(name, ScriptExecutionParameterType.class); + } + + /** @return known ScriptExecutionParameterType values. */ + public static Collection values() { + return values(ScriptExecutionParameterType.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProvisioningState.java new file mode 100644 index 000000000000..f56227df4120 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionProvisioningState.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScriptExecutionProvisioningState. */ +public final class ScriptExecutionProvisioningState extends ExpandableStringEnum { + /** Static value Pending for ScriptExecutionProvisioningState. */ + public static final ScriptExecutionProvisioningState PENDING = fromString("Pending"); + + /** Static value Running for ScriptExecutionProvisioningState. */ + public static final ScriptExecutionProvisioningState RUNNING = fromString("Running"); + + /** Static value Succeeded for ScriptExecutionProvisioningState. */ + public static final ScriptExecutionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ScriptExecutionProvisioningState. */ + public static final ScriptExecutionProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelling for ScriptExecutionProvisioningState. */ + public static final ScriptExecutionProvisioningState CANCELLING = fromString("Cancelling"); + + /** Static value Cancelled for ScriptExecutionProvisioningState. */ + public static final ScriptExecutionProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Deleting for ScriptExecutionProvisioningState. */ + public static final ScriptExecutionProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates or finds a ScriptExecutionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScriptExecutionProvisioningState. + */ + @JsonCreator + public static ScriptExecutionProvisioningState fromString(String name) { + return fromString(name, ScriptExecutionProvisioningState.class); + } + + /** @return known ScriptExecutionProvisioningState values. */ + public static Collection values() { + return values(ScriptExecutionProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutions.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutions.java new file mode 100644 index 000000000000..f2030938d913 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutions.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.avs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of ScriptExecutions. */ +public interface ScriptExecutions { + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + ScriptExecution get(String resourceGroupName, String privateCloudName, String scriptExecutionName); + + /** + * Get an script execution resource by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an script execution resource by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context); + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + ScriptExecution getExecutionLogs(String resourceGroupName, String privateCloudName, String scriptExecutionName); + + /** + * Return the logs for a script execution resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptExecutionName Name of the user-invoked script execution resource. + * @param scriptOutputStreamType Name of the desired output stream to return. If not provided, will return all. An + * empty array will return nothing. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an instance of a script executed by a user - custom or AVS. + */ + Response getExecutionLogsWithResponse( + String resourceGroupName, + String privateCloudName, + String scriptExecutionName, + List scriptOutputStreamType, + Context context); + + /** + * Get an script execution resource by name in a private cloud. + * + * @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 an script execution resource by name in a private cloud. + */ + ScriptExecution getById(String id); + + /** + * Get an script execution resource by name in a private cloud. + * + * @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 an script execution resource by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @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); + + /** + * Cancel a ScriptExecution in a private cloud. + * + * @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 ScriptExecution resource. + * + * @param name resource name. + * @return the first stage of the new ScriptExecution definition. + */ + ScriptExecution.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionsList.java new file mode 100644 index 000000000000..5da4b98db8f2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptExecutionsList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.ScriptExecutionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pageable list of script executions. */ +@Immutable +public final class ScriptExecutionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptExecutionsList.class); + + /* + * List of scripts + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of scripts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptOutputStreamType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptOutputStreamType.java new file mode 100644 index 000000000000..57465b43d52a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptOutputStreamType.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScriptOutputStreamType. */ +public final class ScriptOutputStreamType extends ExpandableStringEnum { + /** Static value Information for ScriptOutputStreamType. */ + public static final ScriptOutputStreamType INFORMATION = fromString("Information"); + + /** Static value Warning for ScriptOutputStreamType. */ + public static final ScriptOutputStreamType WARNING = fromString("Warning"); + + /** Static value Output for ScriptOutputStreamType. */ + public static final ScriptOutputStreamType OUTPUT = fromString("Output"); + + /** Static value Error for ScriptOutputStreamType. */ + public static final ScriptOutputStreamType ERROR = fromString("Error"); + + /** + * Creates or finds a ScriptOutputStreamType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScriptOutputStreamType. + */ + @JsonCreator + public static ScriptOutputStreamType fromString(String name) { + return fromString(name, ScriptOutputStreamType.class); + } + + /** @return known ScriptOutputStreamType values. */ + public static Collection values() { + return values(ScriptOutputStreamType.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackage.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackage.java new file mode 100644 index 000000000000..6e066fac34a5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackage.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; + +/** An immutable client-side representation of ScriptPackage. */ +public interface ScriptPackage { + /** + * 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 description property: User friendly description of the package. + * + * @return the description value. + */ + String description(); + + /** + * Gets the version property: Module version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner object. + * + * @return the inner object. + */ + ScriptPackageInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackages.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackages.java new file mode 100644 index 000000000000..b1329c266842 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackages.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 ScriptPackages. */ +public interface ScriptPackages { + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * Return script packages available for a private cloud to run on their Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the available script packages. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 script Package resources available for execution. + */ + ScriptPackage get(String resourceGroupName, String privateCloudName, String scriptPackageName); + + /** + * Return script package available to run on an Private Cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param scriptPackageName Name of the script package in the private cloud. + * @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 script Package resources available for execution. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String scriptPackageName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackagesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackagesList.java new file mode 100644 index 000000000000..7a54dc7398f9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptPackagesList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of the available script packages. */ +@Immutable +public final class ScriptPackagesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptPackagesList.class); + + /* + * List of script package resources + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of script package resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameter.java new file mode 100644 index 000000000000..8163edfe1004 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameter.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An parameter that the script will accept. */ +@Fluent +public final class ScriptParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptParameter.class); + + /* + * The type of parameter the script is expecting. psCredential is a + * PSCredentialObject + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ScriptParameterTypes type; + + /* + * The parameter name that the script will expect a parameter value for + */ + @JsonProperty(value = "name") + private String name; + + /* + * User friendly description of the parameter + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Should this parameter be visible to arm and passed in the parameters + * argument when executing + */ + @JsonProperty(value = "visibility", access = JsonProperty.Access.WRITE_ONLY) + private VisibilityParameterEnum visibility; + + /* + * Is this parameter required or optional + */ + @JsonProperty(value = "optional", access = JsonProperty.Access.WRITE_ONLY) + private OptionalParamEnum optional; + + /** + * Get the type property: The type of parameter the script is expecting. psCredential is a PSCredentialObject. + * + * @return the type value. + */ + public ScriptParameterTypes type() { + return this.type; + } + + /** + * Get the name property: The parameter name that the script will expect a parameter value for. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The parameter name that the script will expect a parameter value for. + * + * @param name the name value to set. + * @return the ScriptParameter object itself. + */ + public ScriptParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: User friendly description of the parameter. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the visibility property: Should this parameter be visible to arm and passed in the parameters argument when + * executing. + * + * @return the visibility value. + */ + public VisibilityParameterEnum visibility() { + return this.visibility; + } + + /** + * Get the optional property: Is this parameter required or optional. + * + * @return the optional value. + */ + public OptionalParamEnum optional() { + return this.optional; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameterTypes.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameterTypes.java new file mode 100644 index 000000000000..322040c554fb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptParameterTypes.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScriptParameterTypes. */ +public final class ScriptParameterTypes extends ExpandableStringEnum { + /** Static value String for ScriptParameterTypes. */ + public static final ScriptParameterTypes STRING = fromString("String"); + + /** Static value SecureString for ScriptParameterTypes. */ + public static final ScriptParameterTypes SECURE_STRING = fromString("SecureString"); + + /** Static value Credential for ScriptParameterTypes. */ + public static final ScriptParameterTypes CREDENTIAL = fromString("Credential"); + + /** Static value Int for ScriptParameterTypes. */ + public static final ScriptParameterTypes INT = fromString("Int"); + + /** Static value Bool for ScriptParameterTypes. */ + public static final ScriptParameterTypes BOOL = fromString("Bool"); + + /** Static value Float for ScriptParameterTypes. */ + public static final ScriptParameterTypes FLOAT = fromString("Float"); + + /** + * Creates or finds a ScriptParameterTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScriptParameterTypes. + */ + @JsonCreator + public static ScriptParameterTypes fromString(String name) { + return fromString(name, ScriptParameterTypes.class); + } + + /** @return known ScriptParameterTypes values. */ + public static Collection values() { + return values(ScriptParameterTypes.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptSecureStringExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptSecureStringExecutionParameter.java new file mode 100644 index 000000000000..68318d075fca --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptSecureStringExecutionParameter.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** a plain text value execution parameter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SecureValue") +@Fluent +public final class ScriptSecureStringExecutionParameter extends ScriptExecutionParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptSecureStringExecutionParameter.class); + + /* + * A secure value for the passed parameter, not to be stored in logs + */ + @JsonProperty(value = "secureValue") + private String secureValue; + + /** + * Get the secureValue property: A secure value for the passed parameter, not to be stored in logs. + * + * @return the secureValue value. + */ + public String secureValue() { + return this.secureValue; + } + + /** + * Set the secureValue property: A secure value for the passed parameter, not to be stored in logs. + * + * @param secureValue the secureValue value to set. + * @return the ScriptSecureStringExecutionParameter object itself. + */ + public ScriptSecureStringExecutionParameter withSecureValue(String secureValue) { + this.secureValue = secureValue; + return this; + } + + /** {@inheritDoc} */ + @Override + public ScriptSecureStringExecutionParameter withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptStringExecutionParameter.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptStringExecutionParameter.java new file mode 100644 index 000000000000..8a377ded9899 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ScriptStringExecutionParameter.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** a plain text value execution parameter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Value") +@Fluent +public final class ScriptStringExecutionParameter extends ScriptExecutionParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptStringExecutionParameter.class); + + /* + * The value for the passed parameter + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value property: The value for the passed parameter. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the passed parameter. + * + * @param value the value value to set. + * @return the ScriptStringExecutionParameter object itself. + */ + public ScriptStringExecutionParameter withValue(String value) { + this.value = value; + return this; + } + + /** {@inheritDoc} */ + @Override + public ScriptStringExecutionParameter withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java new file mode 100644 index 000000000000..a9b24ffea6f5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SegmentStatusEnum. */ +public final class SegmentStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS, FAILURE for SegmentStatusEnum. */ + public static final SegmentStatusEnum SUCCESS_FAILURE = fromString("SUCCESS, FAILURE"); + + /** + * Creates or finds a SegmentStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SegmentStatusEnum. + */ + @JsonCreator + public static SegmentStatusEnum fromString(String name) { + return fromString(name, SegmentStatusEnum.class); + } + + /** @return known SegmentStatusEnum values. */ + public static Collection values() { + return values(SegmentStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java new file mode 100644 index 000000000000..2bb961c1ff18 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGroupStatusEnum. */ +public final class VMGroupStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS, FAILURE for VMGroupStatusEnum. */ + public static final VMGroupStatusEnum SUCCESS_FAILURE = fromString("SUCCESS, FAILURE"); + + /** + * Creates or finds a VMGroupStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGroupStatusEnum. + */ + @JsonCreator + public static VMGroupStatusEnum fromString(String name) { + return fromString(name, VMGroupStatusEnum.class); + } + + /** @return known VMGroupStatusEnum values. */ + public static Collection values() { + return values(VMGroupStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java new file mode 100644 index 000000000000..6c92e2238673 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMTypeEnum. */ +public final class VMTypeEnum extends ExpandableStringEnum { + /** Static value REGULAR, EDGE, SERVICE for VMTypeEnum. */ + public static final VMTypeEnum REGULAR_EDGE_SERVICE = fromString("REGULAR, EDGE, SERVICE"); + + /** + * Creates or finds a VMTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMTypeEnum. + */ + @JsonCreator + public static VMTypeEnum fromString(String name) { + return fromString(name, VMTypeEnum.class); + } + + /** @return known VMTypeEnum values. */ + public static Collection values() { + return values(VMTypeEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VisibilityParameterEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VisibilityParameterEnum.java new file mode 100644 index 000000000000..a4d869f469f2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VisibilityParameterEnum.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VisibilityParameterEnum. */ +public final class VisibilityParameterEnum extends ExpandableStringEnum { + /** Static value Visible for VisibilityParameterEnum. */ + public static final VisibilityParameterEnum VISIBLE = fromString("Visible"); + + /** Static value Hidden for VisibilityParameterEnum. */ + public static final VisibilityParameterEnum HIDDEN = fromString("Hidden"); + + /** + * Creates or finds a VisibilityParameterEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding VisibilityParameterEnum. + */ + @JsonCreator + public static VisibilityParameterEnum fromString(String name) { + return fromString(name, VisibilityParameterEnum.class); + } + + /** @return known VisibilityParameterEnum values. */ + public static Collection values() { + return values(VisibilityParameterEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java new file mode 100644 index 000000000000..790822493138 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; + +/** An immutable client-side representation of WorkloadNetworkDhcp. */ +public interface WorkloadNetworkDhcp { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: DHCP properties. + * + * @return the properties value. + */ + WorkloadNetworkDhcpEntity properties(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner object. + * + * @return the inner object. + */ + WorkloadNetworkDhcpInner innerModel(); + + /** The entirety of the WorkloadNetworkDhcp definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkDhcp definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkDhcp definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkDhcp definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkDhcp 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkDhcp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkDhcp create(Context context); + } + /** The stage of the WorkloadNetworkDhcp definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: DHCP properties.. + * + * @param properties DHCP properties. + * @return the next definition stage. + */ + WithCreate withProperties(WorkloadNetworkDhcpEntity properties); + } + } + /** + * Begins update for the WorkloadNetworkDhcp resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkDhcp.Update update(); + + /** The template for WorkloadNetworkDhcp update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkDhcp apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkDhcp apply(Context context); + } + /** The WorkloadNetworkDhcp update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkDhcp update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: DHCP properties.. + * + * @param properties DHCP properties. + * @return the next definition stage. + */ + Update withProperties(WorkloadNetworkDhcpEntity properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkDhcp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkDhcp refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java new file mode 100644 index 000000000000..65e456dde323 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "dhcpType", + defaultImpl = WorkloadNetworkDhcpEntity.class) +@JsonTypeName("WorkloadNetworkDhcpEntity") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SERVER", value = WorkloadNetworkDhcpServer.class), + @JsonSubTypes.Type(name = "RELAY", value = WorkloadNetworkDhcpRelay.class) +}) +@Fluent +public class WorkloadNetworkDhcpEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpEntity.class); + + /* + * Display name of the DHCP entity. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * NSX Segments consuming DHCP. + */ + @JsonProperty(value = "segments", access = JsonProperty.Access.WRITE_ONLY) + private List segments; + + /* + * The provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDhcpProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "revision") + private Long revision; + + /** + * Get the displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DHCP entity. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkDhcpEntity object itself. + */ + public WorkloadNetworkDhcpEntity withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the segments property: NSX Segments consuming DHCP. + * + * @return the segments value. + */ + public List segments() { + return this.segments; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkDhcpProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkDhcpEntity object itself. + */ + public WorkloadNetworkDhcpEntity withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java new file mode 100644 index 000000000000..72fb3d17f6bb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX dhcp entities. */ +@Immutable +public final class WorkloadNetworkDhcpList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java new file mode 100644 index 000000000000..e39302dbb6ba --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkDhcpProvisioningState. */ +public final class WorkloadNetworkDhcpProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkDhcpProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkDhcpProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkDhcpProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkDhcpProvisioningState.class); + } + + /** @return known WorkloadNetworkDhcpProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkDhcpProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java new file mode 100644 index 000000000000..626989e0a187 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** NSX DHCP Relay. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dhcpType") +@JsonTypeName("RELAY") +@Fluent +public final class WorkloadNetworkDhcpRelay extends WorkloadNetworkDhcpEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpRelay.class); + + /* + * DHCP Relay Addresses. Max 3. + */ + @JsonProperty(value = "serverAddresses") + private List serverAddresses; + + /** + * Get the serverAddresses property: DHCP Relay Addresses. Max 3. + * + * @return the serverAddresses value. + */ + public List serverAddresses() { + return this.serverAddresses; + } + + /** + * Set the serverAddresses property: DHCP Relay Addresses. Max 3. + * + * @param serverAddresses the serverAddresses value to set. + * @return the WorkloadNetworkDhcpRelay object itself. + */ + public WorkloadNetworkDhcpRelay withServerAddresses(List serverAddresses) { + this.serverAddresses = serverAddresses; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpRelay withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpRelay withRevision(Long revision) { + super.withRevision(revision); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java new file mode 100644 index 000000000000..397faeaeef06 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** NSX DHCP Server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dhcpType") +@JsonTypeName("SERVER") +@Fluent +public final class WorkloadNetworkDhcpServer extends WorkloadNetworkDhcpEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpServer.class); + + /* + * DHCP Server Address. + */ + @JsonProperty(value = "serverAddress") + private String serverAddress; + + /* + * DHCP Server Lease Time. + */ + @JsonProperty(value = "leaseTime") + private Long leaseTime; + + /** + * Get the serverAddress property: DHCP Server Address. + * + * @return the serverAddress value. + */ + public String serverAddress() { + return this.serverAddress; + } + + /** + * Set the serverAddress property: DHCP Server Address. + * + * @param serverAddress the serverAddress value to set. + * @return the WorkloadNetworkDhcpServer object itself. + */ + public WorkloadNetworkDhcpServer withServerAddress(String serverAddress) { + this.serverAddress = serverAddress; + return this; + } + + /** + * Get the leaseTime property: DHCP Server Lease Time. + * + * @return the leaseTime value. + */ + public Long leaseTime() { + return this.leaseTime; + } + + /** + * Set the leaseTime property: DHCP Server Lease Time. + * + * @param leaseTime the leaseTime value to set. + * @return the WorkloadNetworkDhcpServer object itself. + */ + public WorkloadNetworkDhcpServer withLeaseTime(Long leaseTime) { + this.leaseTime = leaseTime; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpServer withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpServer withRevision(Long revision) { + super.withRevision(revision); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java new file mode 100644 index 000000000000..2f676481ae73 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkDnsService. */ +public interface WorkloadNetworkDnsService { + /** + * 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 displayName property: Display name of the DNS Service. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the dnsServiceIp property: DNS service IP of the DNS Service. + * + * @return the dnsServiceIp value. + */ + String dnsServiceIp(); + + /** + * Gets the defaultDnsZone property: Default DNS zone of the DNS Service. + * + * @return the defaultDnsZone value. + */ + String defaultDnsZone(); + + /** + * Gets the fqdnZones property: FQDN zones of the DNS Service. + * + * @return the fqdnZones value. + */ + List fqdnZones(); + + /** + * Gets the logLevel property: DNS Service log level. + * + * @return the logLevel value. + */ + DnsServiceLogLevelEnum logLevel(); + + /** + * Gets the status property: DNS Service status. + * + * @return the status value. + */ + DnsServiceStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkDnsServiceProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner object. + * + * @return the inner object. + */ + WorkloadNetworkDnsServiceInner innerModel(); + + /** The entirety of the WorkloadNetworkDnsService definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkDnsService definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkDnsService definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkDnsService 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.WithDisplayName, + DefinitionStages.WithDnsServiceIp, + DefinitionStages.WithDefaultDnsZone, + DefinitionStages.WithFqdnZones, + DefinitionStages.WithLogLevel, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkDnsService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkDnsService create(Context context); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Service.. + * + * @param displayName Display name of the DNS Service. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify dnsServiceIp. */ + interface WithDnsServiceIp { + /** + * Specifies the dnsServiceIp property: DNS service IP of the DNS Service.. + * + * @param dnsServiceIp DNS service IP of the DNS Service. + * @return the next definition stage. + */ + WithCreate withDnsServiceIp(String dnsServiceIp); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify defaultDnsZone. */ + interface WithDefaultDnsZone { + /** + * Specifies the defaultDnsZone property: Default DNS zone of the DNS Service.. + * + * @param defaultDnsZone Default DNS zone of the DNS Service. + * @return the next definition stage. + */ + WithCreate withDefaultDnsZone(String defaultDnsZone); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify fqdnZones. */ + interface WithFqdnZones { + /** + * Specifies the fqdnZones property: FQDN zones of the DNS Service.. + * + * @param fqdnZones FQDN zones of the DNS Service. + * @return the next definition stage. + */ + WithCreate withFqdnZones(List fqdnZones); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify logLevel. */ + interface WithLogLevel { + /** + * Specifies the logLevel property: DNS Service log level.. + * + * @param logLevel DNS Service log level. + * @return the next definition stage. + */ + WithCreate withLogLevel(DnsServiceLogLevelEnum logLevel); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkDnsService resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkDnsService.Update update(); + + /** The template for WorkloadNetworkDnsService update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDnsServiceIp, + UpdateStages.WithDefaultDnsZone, + UpdateStages.WithFqdnZones, + UpdateStages.WithLogLevel, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkDnsService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkDnsService apply(Context context); + } + /** The WorkloadNetworkDnsService update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkDnsService update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Service.. + * + * @param displayName Display name of the DNS Service. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify dnsServiceIp. */ + interface WithDnsServiceIp { + /** + * Specifies the dnsServiceIp property: DNS service IP of the DNS Service.. + * + * @param dnsServiceIp DNS service IP of the DNS Service. + * @return the next definition stage. + */ + Update withDnsServiceIp(String dnsServiceIp); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify defaultDnsZone. */ + interface WithDefaultDnsZone { + /** + * Specifies the defaultDnsZone property: Default DNS zone of the DNS Service.. + * + * @param defaultDnsZone Default DNS zone of the DNS Service. + * @return the next definition stage. + */ + Update withDefaultDnsZone(String defaultDnsZone); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify fqdnZones. */ + interface WithFqdnZones { + /** + * Specifies the fqdnZones property: FQDN zones of the DNS Service.. + * + * @param fqdnZones FQDN zones of the DNS Service. + * @return the next definition stage. + */ + Update withFqdnZones(List fqdnZones); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify logLevel. */ + interface WithLogLevel { + /** + * Specifies the logLevel property: DNS Service log level.. + * + * @param logLevel DNS Service log level. + * @return the next definition stage. + */ + Update withLogLevel(DnsServiceLogLevelEnum logLevel); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkDnsService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkDnsService refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java new file mode 100644 index 000000000000..20291ed0b3b3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkDnsServiceProvisioningState. */ +public final class WorkloadNetworkDnsServiceProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkDnsServiceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkDnsServiceProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkDnsServiceProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkDnsServiceProvisioningState.class); + } + + /** @return known WorkloadNetworkDnsServiceProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkDnsServiceProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java new file mode 100644 index 000000000000..f4c5c46e39e3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX DNS Services. */ +@Immutable +public final class WorkloadNetworkDnsServicesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsServicesList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java new file mode 100644 index 000000000000..a454a6d9cb49 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkDnsZone. */ +public interface WorkloadNetworkDnsZone { + /** + * 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 displayName property: Display name of the DNS Zone. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the domain property: Domain names of the DNS Zone. + * + * @return the domain value. + */ + List domain(); + + /** + * Gets the dnsServerIps property: DNS Server IP array of the DNS Zone. + * + * @return the dnsServerIps value. + */ + List dnsServerIps(); + + /** + * Gets the sourceIp property: Source IP of the DNS Zone. + * + * @return the sourceIp value. + */ + String sourceIp(); + + /** + * Gets the dnsServices property: Number of DNS Services using the DNS zone. + * + * @return the dnsServices value. + */ + Long dnsServices(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkDnsZoneProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner object. + * + * @return the inner object. + */ + WorkloadNetworkDnsZoneInner innerModel(); + + /** The entirety of the WorkloadNetworkDnsZone definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkDnsZone definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkDnsZone definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkDnsZone 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.WithDisplayName, + DefinitionStages.WithDomain, + DefinitionStages.WithDnsServerIps, + DefinitionStages.WithSourceIp, + DefinitionStages.WithDnsServices, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkDnsZone create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkDnsZone create(Context context); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Zone.. + * + * @param displayName Display name of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify domain. */ + interface WithDomain { + /** + * Specifies the domain property: Domain names of the DNS Zone.. + * + * @param domain Domain names of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withDomain(List domain); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify dnsServerIps. */ + interface WithDnsServerIps { + /** + * Specifies the dnsServerIps property: DNS Server IP array of the DNS Zone.. + * + * @param dnsServerIps DNS Server IP array of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withDnsServerIps(List dnsServerIps); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify sourceIp. */ + interface WithSourceIp { + /** + * Specifies the sourceIp property: Source IP of the DNS Zone.. + * + * @param sourceIp Source IP of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withSourceIp(String sourceIp); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify dnsServices. */ + interface WithDnsServices { + /** + * Specifies the dnsServices property: Number of DNS Services using the DNS zone.. + * + * @param dnsServices Number of DNS Services using the DNS zone. + * @return the next definition stage. + */ + WithCreate withDnsServices(Long dnsServices); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkDnsZone resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkDnsZone.Update update(); + + /** The template for WorkloadNetworkDnsZone update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDomain, + UpdateStages.WithDnsServerIps, + UpdateStages.WithSourceIp, + UpdateStages.WithDnsServices, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkDnsZone apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkDnsZone apply(Context context); + } + /** The WorkloadNetworkDnsZone update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkDnsZone update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Zone.. + * + * @param displayName Display name of the DNS Zone. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify domain. */ + interface WithDomain { + /** + * Specifies the domain property: Domain names of the DNS Zone.. + * + * @param domain Domain names of the DNS Zone. + * @return the next definition stage. + */ + Update withDomain(List domain); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify dnsServerIps. */ + interface WithDnsServerIps { + /** + * Specifies the dnsServerIps property: DNS Server IP array of the DNS Zone.. + * + * @param dnsServerIps DNS Server IP array of the DNS Zone. + * @return the next definition stage. + */ + Update withDnsServerIps(List dnsServerIps); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify sourceIp. */ + interface WithSourceIp { + /** + * Specifies the sourceIp property: Source IP of the DNS Zone.. + * + * @param sourceIp Source IP of the DNS Zone. + * @return the next definition stage. + */ + Update withSourceIp(String sourceIp); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify dnsServices. */ + interface WithDnsServices { + /** + * Specifies the dnsServices property: Number of DNS Services using the DNS zone.. + * + * @param dnsServices Number of DNS Services using the DNS zone. + * @return the next definition stage. + */ + Update withDnsServices(Long dnsServices); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkDnsZone refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkDnsZone refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java new file mode 100644 index 000000000000..899f54f56add --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkDnsZoneProvisioningState. */ +public final class WorkloadNetworkDnsZoneProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkDnsZoneProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkDnsZoneProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkDnsZoneProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkDnsZoneProvisioningState.class); + } + + /** @return known WorkloadNetworkDnsZoneProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkDnsZoneProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java new file mode 100644 index 000000000000..34011c3aaa23 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX DNS Zones. */ +@Immutable +public final class WorkloadNetworkDnsZonesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsZonesList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java new file mode 100644 index 000000000000..c65b3101945e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; + +/** An immutable client-side representation of WorkloadNetworkGateway. */ +public interface WorkloadNetworkGateway { + /** + * 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 displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the path property: NSX Gateway Path. + * + * @return the path value. + */ + String path(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner object. + * + * @return the inner object. + */ + WorkloadNetworkGatewayInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java new file mode 100644 index 000000000000..530b25c7cdf9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Gateways. */ +@Immutable +public final class WorkloadNetworkGatewayList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkGatewayList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java new file mode 100644 index 000000000000..b09cf54104c0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; + +/** An immutable client-side representation of WorkloadNetworkPortMirroring. */ +public interface WorkloadNetworkPortMirroring { + /** + * 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 displayName property: Display name of the port mirroring profile. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the direction property: Direction of port mirroring profile. + * + * @return the direction value. + */ + PortMirroringDirectionEnum direction(); + + /** + * Gets the source property: Source VM Group. + * + * @return the source value. + */ + String source(); + + /** + * Gets the destination property: Destination VM Group. + * + * @return the destination value. + */ + String destination(); + + /** + * Gets the status property: Port Mirroring Status. + * + * @return the status value. + */ + PortMirroringStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkPortMirroringProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner object. + * + * @return the inner object. + */ + WorkloadNetworkPortMirroringInner innerModel(); + + /** The entirety of the WorkloadNetworkPortMirroring definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkPortMirroring definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkPortMirroring definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkPortMirroring 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.WithDisplayName, + DefinitionStages.WithDirection, + DefinitionStages.WithSource, + DefinitionStages.WithDestination, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkPortMirroring create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkPortMirroring create(Context context); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the port mirroring profile.. + * + * @param displayName Display name of the port mirroring profile. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: Direction of port mirroring profile.. + * + * @param direction Direction of port mirroring profile. + * @return the next definition stage. + */ + WithCreate withDirection(PortMirroringDirectionEnum direction); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source VM Group.. + * + * @param source Source VM Group. + * @return the next definition stage. + */ + WithCreate withSource(String source); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: Destination VM Group.. + * + * @param destination Destination VM Group. + * @return the next definition stage. + */ + WithCreate withDestination(String destination); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkPortMirroring resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkPortMirroring.Update update(); + + /** The template for WorkloadNetworkPortMirroring update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDirection, + UpdateStages.WithSource, + UpdateStages.WithDestination, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkPortMirroring apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkPortMirroring apply(Context context); + } + /** The WorkloadNetworkPortMirroring update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the port mirroring profile.. + * + * @param displayName Display name of the port mirroring profile. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: Direction of port mirroring profile.. + * + * @param direction Direction of port mirroring profile. + * @return the next definition stage. + */ + Update withDirection(PortMirroringDirectionEnum direction); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source VM Group.. + * + * @param source Source VM Group. + * @return the next definition stage. + */ + Update withSource(String source); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: Destination VM Group.. + * + * @param destination Destination VM Group. + * @return the next definition stage. + */ + Update withDestination(String destination); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkPortMirroring refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkPortMirroring refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java new file mode 100644 index 000000000000..e82f73dc4031 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Port Mirroring. */ +@Immutable +public final class WorkloadNetworkPortMirroringList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkPortMirroringList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java new file mode 100644 index 000000000000..74622a41bd16 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkPortMirroringProvisioningState. */ +public final class WorkloadNetworkPortMirroringProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkPortMirroringProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkPortMirroringProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkPortMirroringProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkPortMirroringProvisioningState.class); + } + + /** @return known WorkloadNetworkPortMirroringProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkPortMirroringProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIPsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIPsList.java new file mode 100644 index 000000000000..e88e3b73273a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIPsList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Public IP Blocks. */ +@Immutable +public final class WorkloadNetworkPublicIPsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkPublicIPsList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIp.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIp.java new file mode 100644 index 000000000000..ff58e381769b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIp.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner; + +/** An immutable client-side representation of WorkloadNetworkPublicIp. */ +public interface WorkloadNetworkPublicIp { + /** + * 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 displayName property: Display name of the Public IP Block. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the numberOfPublicIPs property: Number of Public IPs requested. + * + * @return the numberOfPublicIPs value. + */ + Long numberOfPublicIPs(); + + /** + * Gets the publicIpBlock property: CIDR Block of the Public IP Block. + * + * @return the publicIpBlock value. + */ + String publicIpBlock(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkPublicIpProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner object. + * + * @return the inner object. + */ + WorkloadNetworkPublicIpInner innerModel(); + + /** The entirety of the WorkloadNetworkPublicIp definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkPublicIp definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkPublicIp definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkPublicIp definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkPublicIp 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.WithDisplayName, DefinitionStages.WithNumberOfPublicIPs { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkPublicIp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkPublicIp create(Context context); + } + /** The stage of the WorkloadNetworkPublicIp definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the Public IP Block.. + * + * @param displayName Display name of the Public IP Block. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkPublicIp definition allowing to specify numberOfPublicIPs. */ + interface WithNumberOfPublicIPs { + /** + * Specifies the numberOfPublicIPs property: Number of Public IPs requested.. + * + * @param numberOfPublicIPs Number of Public IPs requested. + * @return the next definition stage. + */ + WithCreate withNumberOfPublicIPs(Long numberOfPublicIPs); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkPublicIp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkPublicIp refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProvisioningState.java new file mode 100644 index 000000000000..3063d0d53699 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPublicIpProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkPublicIpProvisioningState. */ +public final class WorkloadNetworkPublicIpProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkPublicIpProvisioningState. */ + public static final WorkloadNetworkPublicIpProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkPublicIpProvisioningState. */ + public static final WorkloadNetworkPublicIpProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkPublicIpProvisioningState. */ + public static final WorkloadNetworkPublicIpProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkPublicIpProvisioningState. */ + public static final WorkloadNetworkPublicIpProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkPublicIpProvisioningState. */ + public static final WorkloadNetworkPublicIpProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkPublicIpProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkPublicIpProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkPublicIpProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkPublicIpProvisioningState.class); + } + + /** @return known WorkloadNetworkPublicIpProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkPublicIpProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java new file mode 100644 index 000000000000..a2ff84fb48a3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkSegment. */ +public interface WorkloadNetworkSegment { + /** + * 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 displayName property: Display name of the segment. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the connectedGateway property: Gateway which to connect segment to. + * + * @return the connectedGateway value. + */ + String connectedGateway(); + + /** + * Gets the subnet property: Subnet which to connect segment to. + * + * @return the subnet value. + */ + WorkloadNetworkSegmentSubnet subnet(); + + /** + * Gets the portVif property: Port Vif which segment is associated with. + * + * @return the portVif value. + */ + List portVif(); + + /** + * Gets the status property: Segment status. + * + * @return the status value. + */ + SegmentStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkSegmentProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner object. + * + * @return the inner object. + */ + WorkloadNetworkSegmentInner innerModel(); + + /** The entirety of the WorkloadNetworkSegment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkSegment definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkSegment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkSegment 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.WithDisplayName, + DefinitionStages.WithConnectedGateway, + DefinitionStages.WithSubnet, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkSegment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkSegment create(Context context); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the segment.. + * + * @param displayName Display name of the segment. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify connectedGateway. */ + interface WithConnectedGateway { + /** + * Specifies the connectedGateway property: Gateway which to connect segment to.. + * + * @param connectedGateway Gateway which to connect segment to. + * @return the next definition stage. + */ + WithCreate withConnectedGateway(String connectedGateway); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: Subnet which to connect segment to.. + * + * @param subnet Subnet which to connect segment to. + * @return the next definition stage. + */ + WithCreate withSubnet(WorkloadNetworkSegmentSubnet subnet); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkSegment resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkSegment.Update update(); + + /** The template for WorkloadNetworkSegment update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithConnectedGateway, + UpdateStages.WithSubnet, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkSegment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkSegment apply(Context context); + } + /** The WorkloadNetworkSegment update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkSegment update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the segment.. + * + * @param displayName Display name of the segment. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkSegment update allowing to specify connectedGateway. */ + interface WithConnectedGateway { + /** + * Specifies the connectedGateway property: Gateway which to connect segment to.. + * + * @param connectedGateway Gateway which to connect segment to. + * @return the next definition stage. + */ + Update withConnectedGateway(String connectedGateway); + } + /** The stage of the WorkloadNetworkSegment update allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: Subnet which to connect segment to.. + * + * @param subnet Subnet which to connect segment to. + * @return the next definition stage. + */ + Update withSubnet(WorkloadNetworkSegmentSubnet subnet); + } + /** The stage of the WorkloadNetworkSegment update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkSegment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkSegment refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java similarity index 50% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdateProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java index 3f1cda2160eb..c310126fd773 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdateProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java @@ -9,34 +9,34 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The properties of a cluster that may be updated. */ +/** Ports and any VIF attached to segment. */ @Fluent -public class ClusterUpdateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdateProperties.class); +public final class WorkloadNetworkSegmentPortVif { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentPortVif.class); /* - * The cluster size + * Name of port or VIF attached to segment. */ - @JsonProperty(value = "clusterSize") - private Integer clusterSize; + @JsonProperty(value = "portName") + private String portName; /** - * Get the clusterSize property: The cluster size. + * Get the portName property: Name of port or VIF attached to segment. * - * @return the clusterSize value. + * @return the portName value. */ - public Integer clusterSize() { - return this.clusterSize; + public String portName() { + return this.portName; } /** - * Set the clusterSize property: The cluster size. + * Set the portName property: Name of port or VIF attached to segment. * - * @param clusterSize the clusterSize value to set. - * @return the ClusterUpdateProperties object itself. + * @param portName the portName value to set. + * @return the WorkloadNetworkSegmentPortVif object itself. */ - public ClusterUpdateProperties withClusterSize(Integer clusterSize) { - this.clusterSize = clusterSize; + public WorkloadNetworkSegmentPortVif withPortName(String portName) { + this.portName = portName; return this; } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentProvisioningState.java new file mode 100644 index 000000000000..454ae0b71e6e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkSegmentProvisioningState. */ +public final class WorkloadNetworkSegmentProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkSegmentProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkSegmentProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkSegmentProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkSegmentProvisioningState.class); + } + + /** @return known WorkloadNetworkSegmentProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkSegmentProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java new file mode 100644 index 000000000000..0d434e1c740d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet configuration for segment. */ +@Fluent +public final class WorkloadNetworkSegmentSubnet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentSubnet.class); + + /* + * DHCP Range assigned for subnet. + */ + @JsonProperty(value = "dhcpRanges") + private List dhcpRanges; + + /* + * Gateway address. + */ + @JsonProperty(value = "gatewayAddress") + private String gatewayAddress; + + /** + * Get the dhcpRanges property: DHCP Range assigned for subnet. + * + * @return the dhcpRanges value. + */ + public List dhcpRanges() { + return this.dhcpRanges; + } + + /** + * Set the dhcpRanges property: DHCP Range assigned for subnet. + * + * @param dhcpRanges the dhcpRanges value to set. + * @return the WorkloadNetworkSegmentSubnet object itself. + */ + public WorkloadNetworkSegmentSubnet withDhcpRanges(List dhcpRanges) { + this.dhcpRanges = dhcpRanges; + return this; + } + + /** + * Get the gatewayAddress property: Gateway address. + * + * @return the gatewayAddress value. + */ + public String gatewayAddress() { + return this.gatewayAddress; + } + + /** + * Set the gatewayAddress property: Gateway address. + * + * @param gatewayAddress the gatewayAddress value to set. + * @return the WorkloadNetworkSegmentSubnet object itself. + */ + public WorkloadNetworkSegmentSubnet withGatewayAddress(String gatewayAddress) { + this.gatewayAddress = gatewayAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java new file mode 100644 index 000000000000..aef9594abc79 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Segments. */ +@Immutable +public final class WorkloadNetworkSegmentsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentsList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java new file mode 100644 index 000000000000..18438fad3f05 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkVMGroup. */ +public interface WorkloadNetworkVMGroup { + /** + * 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 displayName property: Display name of the VM group. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the members property: Virtual machine members of this group. + * + * @return the members value. + */ + List members(); + + /** + * Gets the status property: VM Group status. + * + * @return the status value. + */ + VMGroupStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkVMGroupProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner object. + * + * @return the inner object. + */ + WorkloadNetworkVMGroupInner innerModel(); + + /** The entirety of the WorkloadNetworkVMGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkVMGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkVMGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkVMGroup 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.WithDisplayName, DefinitionStages.WithMembers, DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkVMGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkVMGroup create(Context context); + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the VM group.. + * + * @param displayName Display name of the VM group. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify members. */ + interface WithMembers { + /** + * Specifies the members property: Virtual machine members of this group.. + * + * @param members Virtual machine members of this group. + * @return the next definition stage. + */ + WithCreate withMembers(List members); + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkVMGroup resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkVMGroup.Update update(); + + /** The template for WorkloadNetworkVMGroup update. */ + interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithMembers, UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkVMGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkVMGroup apply(Context context); + } + /** The WorkloadNetworkVMGroup update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkVMGroup update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the VM group.. + * + * @param displayName Display name of the VM group. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkVMGroup update allowing to specify members. */ + interface WithMembers { + /** + * Specifies the members property: Virtual machine members of this group.. + * + * @param members Virtual machine members of this group. + * @return the next definition stage. + */ + Update withMembers(List members); + } + /** The stage of the WorkloadNetworkVMGroup update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkVMGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkVMGroup refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java new file mode 100644 index 000000000000..b848504b44cb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkVMGroupProvisioningState. */ +public final class WorkloadNetworkVMGroupProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkVMGroupProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkVMGroupProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkVMGroupProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkVMGroupProvisioningState.class); + } + + /** @return known WorkloadNetworkVMGroupProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkVMGroupProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java new file mode 100644 index 000000000000..ac5458a9d235 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX VM Groups. */ +@Immutable +public final class WorkloadNetworkVMGroupsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVMGroupsList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java new file mode 100644 index 000000000000..f55adc8d68fc --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; + +/** An immutable client-side representation of WorkloadNetworkVirtualMachine. */ +public interface WorkloadNetworkVirtualMachine { + /** + * 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 displayName property: Display name of the VM. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the vmType property: Virtual machine type. + * + * @return the vmType value. + */ + VMTypeEnum vmType(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner object. + * + * @return the inner object. + */ + WorkloadNetworkVirtualMachineInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java new file mode 100644 index 000000000000..8201046cd9c4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Virtual Machines. */ +@Immutable +public final class WorkloadNetworkVirtualMachinesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVirtualMachinesList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java new file mode 100644 index 000000000000..a61dbb7b8e2d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java @@ -0,0 +1,1039 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 WorkloadNetworks. */ +public interface WorkloadNetworks { + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + PagedIterable listSegments(String resourceGroupName, String privateCloudName); + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + PagedIterable listDhcp(String resourceGroupName, String privateCloudName); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + PagedIterable listDhcp(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 dhcp by id in a private cloud workload network. + */ + WorkloadNetworkDhcp getDhcp(String resourceGroupName, String dhcpId, String privateCloudName); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @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 dhcp by id in a private cloud workload network. + */ + Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + PagedIterable listGateways(String resourceGroupName, String privateCloudName); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, String gatewayId); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + PagedIterable listPortMirroring(String resourceGroupName, String privateCloudName); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + WorkloadNetworkPortMirroring getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @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 deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + PagedIterable listVMGroups(String resourceGroupName, String privateCloudName); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + PagedIterable listVirtualMachines(String resourceGroupName, String privateCloudName); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 virtual machine by id in a private cloud workload network. + */ + WorkloadNetworkVirtualMachine getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId Virtual Machine identifier. + * @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 virtual machine by id in a private cloud workload network. + */ + Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + PagedIterable listDnsServices(String resourceGroupName, String privateCloudName); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + WorkloadNetworkDnsService getDnsService(String resourceGroupName, String privateCloudName, String dnsServiceId); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName, Context context); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + PagedIterable listDnsZones(String resourceGroupName, String privateCloudName); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context); + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName); + + /** + * List of Public IP Blocks in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Public IP Blocks. + */ + PagedIterable listPublicIPs( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + WorkloadNetworkPublicIp getPublicIp(String resourceGroupName, String privateCloudName, String publicIpId); + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Public IP Block by id in a private cloud workload network. + */ + Response getPublicIpWithResponse( + String resourceGroupName, String privateCloudName, String publicIpId, Context context); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicIpId NSX Public IP Block identifier. Generally the same as the Public IP Block's display name. + * @param privateCloudName Name of the private cloud. + * @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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context); + + /** + * Get a segment by id in a private cloud workload network. + * + * @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 segment by id in a private cloud workload network. + */ + WorkloadNetworkSegment getSegmentById(String id); + + /** + * Get a segment by id in a private cloud workload network. + * + * @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 segment by id in a private cloud workload network. + */ + Response getSegmentByIdWithResponse(String id, Context context); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @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 dhcp by id in a private cloud workload network. + */ + WorkloadNetworkDhcp getDhcpById(String id); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @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 dhcp by id in a private cloud workload network. + */ + Response getDhcpByIdWithResponse(String id, Context context); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @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 port mirroring profile by id in a private cloud workload network. + */ + WorkloadNetworkPortMirroring getPortMirroringById(String id); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @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 port mirroring profile by id in a private cloud workload network. + */ + Response getPortMirroringByIdWithResponse(String id, Context context); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @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 vm group by id in a private cloud workload network. + */ + WorkloadNetworkVMGroup getVMGroupById(String id); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @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 vm group by id in a private cloud workload network. + */ + Response getVMGroupByIdWithResponse(String id, Context context); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @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 DNS service by id in a private cloud workload network. + */ + WorkloadNetworkDnsService getDnsServiceById(String id); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @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 DNS service by id in a private cloud workload network. + */ + Response getDnsServiceByIdWithResponse(String id, Context context); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @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 DNS zone by id in a private cloud workload network. + */ + WorkloadNetworkDnsZone getDnsZoneById(String id); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @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 DNS zone by id in a private cloud workload network. + */ + Response getDnsZoneByIdWithResponse(String id, Context context); + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @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 Public IP Block by id in a private cloud workload network. + */ + WorkloadNetworkPublicIp getPublicIpById(String id); + + /** + * Get a Public IP Block by id in a private cloud workload network. + * + * @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 Public IP Block by id in a private cloud workload network. + */ + Response getPublicIpByIdWithResponse(String id, Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @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 deleteSegmentById(String id); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @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 deleteSegmentByIdWithResponse(String id, Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @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 deleteDhcpById(String id); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @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 deleteDhcpByIdWithResponse(String id, Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @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 deletePortMirroringById(String id); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @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 deletePortMirroringByIdWithResponse(String id, Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @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 deleteVMGroupById(String id); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @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 deleteVMGroupByIdWithResponse(String id, Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @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 deleteDnsServiceById(String id); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @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 deleteDnsServiceByIdWithResponse(String id, Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @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 deleteDnsZoneById(String id); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @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 deleteDnsZoneByIdWithResponse(String id, Context context); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @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 deletePublicIpById(String id); + + /** + * Delete a Public IP Block by id in a private cloud workload network. + * + * @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 deletePublicIpByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkloadNetworkSegment resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkSegment definition. + */ + WorkloadNetworkSegment.DefinitionStages.Blank defineSegments(String name); + + /** + * Begins definition for a new WorkloadNetworkDhcp resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkDhcp definition. + */ + WorkloadNetworkDhcp.DefinitionStages.Blank defineDhcp(String name); + + /** + * Begins definition for a new WorkloadNetworkPortMirroring resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkPortMirroring definition. + */ + WorkloadNetworkPortMirroring.DefinitionStages.Blank definePortMirroring(String name); + + /** + * Begins definition for a new WorkloadNetworkVMGroup resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkVMGroup definition. + */ + WorkloadNetworkVMGroup.DefinitionStages.Blank defineVMGroup(String name); + + /** + * Begins definition for a new WorkloadNetworkDnsService resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkDnsService definition. + */ + WorkloadNetworkDnsService.DefinitionStages.Blank defineDnsService(String name); + + /** + * Begins definition for a new WorkloadNetworkDnsZone resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkDnsZone definition. + */ + WorkloadNetworkDnsZone.DefinitionStages.Blank defineDnsZone(String name); + + /** + * Begins definition for a new WorkloadNetworkPublicIp resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkPublicIp definition. + */ + WorkloadNetworkPublicIp.DefinitionStages.Blank definePublicIp(String name); +}