diff --git a/sdk/avs/mgmt-v2020_07_17_preview/pom.xml b/sdk/avs/mgmt-v2020_07_17_preview/pom.xml new file mode 100644 index 000000000000..d18210d089cc --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.avs.v2020_07_17_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-avs + 1.0.0-beta + jar + Microsoft Azure SDK for AVS Management + This package contains Microsoft AVS Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/AdminCredentials.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/AdminCredentials.java new file mode 100644 index 000000000000..b51caac9bcc8 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/AdminCredentials.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AdminCredentialsInner; + +/** + * Type representing AdminCredentials. + */ +public interface AdminCredentials extends HasInner, HasManager { + /** + * @return the nsxtPassword value. + */ + String nsxtPassword(); + + /** + * @return the nsxtUsername value. + */ + String nsxtUsername(); + + /** + * @return the vcenterPassword value. + */ + String vcenterPassword(); + + /** + * @return the vcenterUsername value. + */ + String vcenterUsername(); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Authorizations.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Authorizations.java new file mode 100644 index 000000000000..65504ca340ce --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Authorizations.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AuthorizationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Authorizations. + */ +public interface Authorizations extends SupportsCreating, HasInner { + /** + * Get an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String privateCloudName, String authorizationName); + + /** + * List ExpressRoute Circuit Authorizations 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String privateCloudName); + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String privateCloudName, String authorizationName); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Circuit.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Circuit.java new file mode 100644 index 000000000000..cc11f1264767 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Circuit.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An ExpressRoute Circuit. + */ +public class Circuit { + /** + * CIDR of primary subnet. + */ + @JsonProperty(value = "primarySubnet", access = JsonProperty.Access.WRITE_ONLY) + private String primarySubnet; + + /** + * CIDR of secondary subnet. + */ + @JsonProperty(value = "secondarySubnet", access = JsonProperty.Access.WRITE_ONLY) + private String secondarySubnet; + + /** + * Identifier of the ExpressRoute Circuit (Microsoft Colo only). + */ + @JsonProperty(value = "expressRouteID", access = JsonProperty.Access.WRITE_ONLY) + private String expressRouteID; + + /** + * ExpressRoute Circuit private peering identifier. + */ + @JsonProperty(value = "expressRoutePrivatePeeringID", access = JsonProperty.Access.WRITE_ONLY) + private String expressRoutePrivatePeeringID; + + /** + * Get cIDR of primary subnet. + * + * @return the primarySubnet value + */ + public String primarySubnet() { + return this.primarySubnet; + } + + /** + * Get cIDR of secondary subnet. + * + * @return the secondarySubnet value + */ + public String secondarySubnet() { + return this.secondarySubnet; + } + + /** + * Get identifier of the ExpressRoute Circuit (Microsoft Colo only). + * + * @return the expressRouteID value + */ + public String expressRouteID() { + return this.expressRouteID; + } + + /** + * Get expressRoute Circuit private peering identifier. + * + * @return the expressRoutePrivatePeeringID value + */ + public String expressRoutePrivatePeeringID() { + return this.expressRoutePrivatePeeringID; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Cluster.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Cluster.java new file mode 100644 index 000000000000..4f891c87d775 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Cluster.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.ClusterInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import java.util.List; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the clusterId value. + */ + Integer clusterId(); + + /** + * @return the clusterSize value. + */ + Integer clusterSize(); + + /** + * @return the hosts value. + */ + List hosts(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ClusterProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPrivateCloud, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends WithPrivateCloud { + } + + /** + * The stage of the cluster definition allowing to specify PrivateCloud. + */ + interface WithPrivateCloud { + /** + * 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 + */ + WithSku withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + + /** + * The stage of the cluster definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The cluster SKU + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the cluster definition allowing to specify ClusterSize. + */ + interface WithClusterSize { + /** + * Specifies clusterSize. + * @param clusterSize The cluster size + * @return the next definition stage + */ + WithCreate withClusterSize(Integer clusterSize); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithClusterSize { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithClusterSize { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify ClusterSize. + */ + interface WithClusterSize { + /** + * Specifies clusterSize. + * @param clusterSize The cluster size + * @return the next update stage + */ + Update withClusterSize(Integer clusterSize); + } + + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ClusterProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ClusterProvisioningState.java new file mode 100644 index 000000000000..0fcf6b074c3a --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ClusterProvisioningState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ClusterProvisioningState. + */ +public final class ClusterProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ClusterProvisioningState. */ + public static final ClusterProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ClusterProvisioningState. */ + public static final ClusterProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for ClusterProvisioningState. */ + public static final ClusterProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Deleting for ClusterProvisioningState. */ + public static final ClusterProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for ClusterProvisioningState. */ + public static final ClusterProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ClusterProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ClusterProvisioningState + */ + @JsonCreator + public static ClusterProvisioningState fromString(String name) { + return fromString(name, ClusterProvisioningState.class); + } + + /** + * @return known ClusterProvisioningState values + */ + public static Collection values() { + return values(ClusterProvisioningState.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ClusterUpdate.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ClusterUpdate.java new file mode 100644 index 000000000000..e1179e0db075 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ClusterUpdate.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * An update of a cluster resource. + */ +@JsonFlatten +public class ClusterUpdate { + /** + * The cluster size. + */ + @JsonProperty(value = "properties.clusterSize") + private Integer clusterSize; + + /** + * Get the cluster size. + * + * @return the clusterSize value + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the cluster size. + * + * @param clusterSize the clusterSize value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Clusters.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Clusters.java new file mode 100644 index 000000000000..b98694f062d6 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Clusters.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, HasInner { + /** + * Get a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * List clusters 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String privateCloudName); + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String privateCloudName, String clusterName); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/CommonClusterProperties.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/CommonClusterProperties.java new file mode 100644 index 000000000000..9eb6f5dc770c --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/CommonClusterProperties.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The common properties of a cluster. + */ +public class CommonClusterProperties { + /** + * The state of the cluster provisioning. Possible values include: + * 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterProvisioningState provisioningState; + + /** + * The cluster size. + */ + @JsonProperty(value = "clusterSize") + private Integer clusterSize; + + /** + * 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 state of the cluster provisioning. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public ClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the cluster size. + * + * @return the clusterSize value + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set 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 identity. + * + * @return the clusterId value + */ + public Integer clusterId() { + return this.clusterId; + } + + /** + * Get the hosts. + * + * @return the hosts value + */ + public List hosts() { + return this.hosts; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Endpoints.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Endpoints.java new file mode 100644 index 000000000000..c8b2a7633944 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Endpoints.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Endpoint addresses. + */ +public class Endpoints { + /** + * Endpoint for the NSX-T Data Center manager. + */ + @JsonProperty(value = "nsxtManager", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtManager; + + /** + * Endpoint for Virtual Center Server Appliance. + */ + @JsonProperty(value = "vcsa", access = JsonProperty.Access.WRITE_ONLY) + private String vcsa; + + /** + * Endpoint for the HCX Cloud Manager. + */ + @JsonProperty(value = "hcxCloudManager", access = JsonProperty.Access.WRITE_ONLY) + private String hcxCloudManager; + + /** + * Get endpoint for the NSX-T Data Center manager. + * + * @return the nsxtManager value + */ + public String nsxtManager() { + return this.nsxtManager; + } + + /** + * Get endpoint for Virtual Center Server Appliance. + * + * @return the vcsa value + */ + public String vcsa() { + return this.vcsa; + } + + /** + * Get endpoint for the HCX Cloud Manager. + * + * @return the hcxCloudManager value + */ + public String hcxCloudManager() { + return this.hcxCloudManager; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ErrorAdditionalInfo.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..ac43668bb999 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ErrorAdditionalInfo.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ErrorResponse.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ErrorResponse.java new file mode 100644 index 000000000000..d27f27290e07 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ErrorResponse.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error Response. + * Common error response for all Azure Resource Manager APIs to return error + * details for failed operations. (This also follows the OData error response + * format.). + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ExpressRouteAuthorization.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ExpressRouteAuthorization.java new file mode 100644 index 000000000000..8e72cc0509fc --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ExpressRouteAuthorization.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.ExpressRouteAuthorizationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; + +/** + * Type representing ExpressRouteAuthorization. + */ +public interface ExpressRouteAuthorization extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the expressRouteAuthorizationId value. + */ + String expressRouteAuthorizationId(); + + /** + * @return the expressRouteAuthorizationKey value. + */ + String expressRouteAuthorizationKey(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ExpressRouteAuthorizationProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ExpressRouteAuthorization definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPrivateCloud, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExpressRouteAuthorization definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExpressRouteAuthorization definition. + */ + interface Blank extends WithPrivateCloud { + } + + /** + * The stage of the expressrouteauthorization definition allowing to specify PrivateCloud. + */ + interface WithPrivateCloud { + /** + * 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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a ExpressRouteAuthorization update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of ExpressRouteAuthorization update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ExpressRouteAuthorizationProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ExpressRouteAuthorizationProvisioningState.java new file mode 100644 index 000000000000..fd70f16d9395 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ExpressRouteAuthorizationProvisioningState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ExpressRouteAuthorizationProvisioningState. + */ +public final class ExpressRouteAuthorizationProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ExpressRouteAuthorizationProvisioningState. */ + public static final ExpressRouteAuthorizationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ExpressRouteAuthorizationProvisioningState. */ + public static final ExpressRouteAuthorizationProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for ExpressRouteAuthorizationProvisioningState. */ + public static final ExpressRouteAuthorizationProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ExpressRouteAuthorizationProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ExpressRouteAuthorizationProvisioningState + */ + @JsonCreator + public static ExpressRouteAuthorizationProvisioningState fromString(String name) { + return fromString(name, ExpressRouteAuthorizationProvisioningState.class); + } + + /** + * @return known ExpressRouteAuthorizationProvisioningState values + */ + public static Collection values() { + return values(ExpressRouteAuthorizationProvisioningState.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnection.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnection.java new file mode 100644 index 000000000000..2b9bcd7a09f0 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnection.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.GlobalReachConnectionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; + +/** + * Type representing GlobalReachConnection. + */ +public interface GlobalReachConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * @return the circuitConnectionStatus value. + */ + GlobalReachConnectionStatus circuitConnectionStatus(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the peerExpressRouteCircuit value. + */ + String peerExpressRouteCircuit(); + + /** + * @return the provisioningState value. + */ + GlobalReachConnectionProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the GlobalReachConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPrivateCloud, DefinitionStages.WithCreate { + } + + /** + * Grouping of GlobalReachConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a GlobalReachConnection definition. + */ + interface Blank extends WithPrivateCloud { + } + + /** + * The stage of the globalreachconnection definition allowing to specify PrivateCloud. + */ + interface WithPrivateCloud { + /** + * 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 allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @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 peerExpressRouteCircuit. + * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach connection + * @return the next definition stage + */ + WithCreate withPeerExpressRouteCircuit(String peerExpressRouteCircuit); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAuthorizationKey, DefinitionStages.WithPeerExpressRouteCircuit { + } + } + /** + * The template for a GlobalReachConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuthorizationKey, UpdateStages.WithPeerExpressRouteCircuit { + } + + /** + * Grouping of GlobalReachConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the globalreachconnection update allowing to specify AuthorizationKey. + */ + interface WithAuthorizationKey { + /** + * Specifies authorizationKey. + * @param authorizationKey Authorization key from the peer express route used for the global reach connection + * @return the next update stage + */ + Update withAuthorizationKey(String authorizationKey); + } + + /** + * The stage of the globalreachconnection update allowing to specify PeerExpressRouteCircuit. + */ + interface WithPeerExpressRouteCircuit { + /** + * Specifies peerExpressRouteCircuit. + * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach connection + * @return the next update stage + */ + Update withPeerExpressRouteCircuit(String peerExpressRouteCircuit); + } + + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnectionProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnectionProvisioningState.java new file mode 100644 index 000000000000..70068ddfe0c1 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnectionProvisioningState.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnectionStatus.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnectionStatus.java new file mode 100644 index 000000000000..1fee2e920c87 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnectionStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnections.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnections.java new file mode 100644 index 000000000000..235bdf01eb33 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/GlobalReachConnections.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.GlobalReachConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing GlobalReachConnections. + */ +public interface GlobalReachConnections extends SupportsCreating, HasInner { + /** + * 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 + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String privateCloudName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSite.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSite.java new file mode 100644 index 000000000000..fb86c70e7495 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSite.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.HcxEnterpriseSiteInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; + +/** + * Type representing HcxEnterpriseSite. + */ +public interface HcxEnterpriseSite extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the activationKey value. + */ + String activationKey(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the status value. + */ + HcxEnterpriseSiteStatus status(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the HcxEnterpriseSite definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPrivateCloud, DefinitionStages.WithCreate { + } + + /** + * Grouping of HcxEnterpriseSite definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a HcxEnterpriseSite definition. + */ + interface Blank extends WithPrivateCloud { + } + + /** + * The stage of the hcxenterprisesite definition allowing to specify PrivateCloud. + */ + interface WithPrivateCloud { + /** + * 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 definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a HcxEnterpriseSite update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of HcxEnterpriseSite update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSiteStatus.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSiteStatus.java new file mode 100644 index 000000000000..d4b1d12a08ee --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSiteStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HcxEnterpriseSiteStatus. + */ +public final class HcxEnterpriseSiteStatus extends ExpandableStringEnum { + /** Static value Available for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus AVAILABLE = fromString("Available"); + + /** Static value Consumed for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus CONSUMED = fromString("Consumed"); + + /** Static value Deactivated for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus DEACTIVATED = fromString("Deactivated"); + + /** Static value Deleted for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus DELETED = fromString("Deleted"); + + /** + * Creates or finds a HcxEnterpriseSiteStatus from its string representation. + * @param name a name to look for + * @return the corresponding HcxEnterpriseSiteStatus + */ + @JsonCreator + public static HcxEnterpriseSiteStatus fromString(String name) { + return fromString(name, HcxEnterpriseSiteStatus.class); + } + + /** + * @return known HcxEnterpriseSiteStatus values + */ + public static Collection values() { + return values(HcxEnterpriseSiteStatus.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSites.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSites.java new file mode 100644 index 000000000000..d46eb11136de --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/HcxEnterpriseSites.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.HcxEnterpriseSitesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing HcxEnterpriseSites. + */ +public interface HcxEnterpriseSites extends SupportsCreating, HasInner { + /** + * Get an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName); + + /** + * List HCX Enterprise Sites 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String privateCloudName); + + /** + * Delete an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/IdentitySource.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/IdentitySource.java new file mode 100644 index 000000000000..4c6799e30a2b --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/IdentitySource.java @@ -0,0 +1,280 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * vCenter Single Sign On Identity Source. + */ +public class IdentitySource { + /** + * The name of the identity source. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The domain's NetBIOS name. + */ + @JsonProperty(value = "alias") + private String alias; + + /** + * The domain's dns name. + */ + @JsonProperty(value = "domain") + private String domain; + + /** + * The base distinguished name for users. + */ + @JsonProperty(value = "baseUserDN") + private String baseUserDN; + + /** + * The base distinguished name for groups. + */ + @JsonProperty(value = "baseGroupDN") + private String baseGroupDN; + + /** + * Primary server URL. + */ + @JsonProperty(value = "primaryServer") + private String primaryServer; + + /** + * Secondary server URL. + */ + @JsonProperty(value = "secondaryServer") + private String secondaryServer; + + /** + * Protect LDAP communication using SSL certificate (LDAPS). Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "ssl") + private SslEnum ssl; + + /** + * The ID of an Active Directory user with a minimum of read-only access to + * Base DN for users and group. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The password of the Active Directory user with a minimum of read-only + * access to Base DN for users and groups. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the name of the identity source. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the identity source. + * + * @param name the name value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the domain's NetBIOS name. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set the domain's NetBIOS name. + * + * @param alias the alias value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the domain's dns name. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain's dns name. + * + * @param domain the domain value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the base distinguished name for users. + * + * @return the baseUserDN value + */ + public String baseUserDN() { + return this.baseUserDN; + } + + /** + * Set the base distinguished name for users. + * + * @param baseUserDN the baseUserDN value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withBaseUserDN(String baseUserDN) { + this.baseUserDN = baseUserDN; + return this; + } + + /** + * Get the base distinguished name for groups. + * + * @return the baseGroupDN value + */ + public String baseGroupDN() { + return this.baseGroupDN; + } + + /** + * Set the base distinguished name for groups. + * + * @param baseGroupDN the baseGroupDN value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withBaseGroupDN(String baseGroupDN) { + this.baseGroupDN = baseGroupDN; + return this; + } + + /** + * Get primary server URL. + * + * @return the primaryServer value + */ + public String primaryServer() { + return this.primaryServer; + } + + /** + * Set primary server URL. + * + * @param primaryServer the primaryServer value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withPrimaryServer(String primaryServer) { + this.primaryServer = primaryServer; + return this; + } + + /** + * Get secondary server URL. + * + * @return the secondaryServer value + */ + public String secondaryServer() { + return this.secondaryServer; + } + + /** + * Set secondary server URL. + * + * @param secondaryServer the secondaryServer value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withSecondaryServer(String secondaryServer) { + this.secondaryServer = secondaryServer; + return this; + } + + /** + * Get protect LDAP communication using SSL certificate (LDAPS). Possible values include: 'Enabled', 'Disabled'. + * + * @return the ssl value + */ + public SslEnum ssl() { + return this.ssl; + } + + /** + * Set protect LDAP communication using SSL certificate (LDAPS). Possible values include: 'Enabled', 'Disabled'. + * + * @param ssl the ssl value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withSsl(SslEnum ssl) { + this.ssl = ssl; + return this; + } + + /** + * Get the ID of an Active Directory user with a minimum of read-only access to Base DN for users and group. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the ID of an Active Directory user with a minimum of read-only access to Base DN for users and group. + * + * @param username the username value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + * + * @param password the password value to set + * @return the IdentitySource object itself. + */ + public IdentitySource withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/InternetEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/InternetEnum.java new file mode 100644 index 000000000000..b22d9dad157f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/InternetEnum.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InternetEnum. + */ +public final class InternetEnum extends ExpandableStringEnum { + /** Static value Enabled for InternetEnum. */ + public static final InternetEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for InternetEnum. */ + public static final InternetEnum DISABLED = fromString("Disabled"); + + /** + * Creates or finds a InternetEnum from its string representation. + * @param name a name to look for + * @return the corresponding InternetEnum + */ + @JsonCreator + public static InternetEnum fromString(String name) { + return fromString(name, InternetEnum.class); + } + + /** + * @return known InternetEnum values + */ + public static Collection values() { + return values(InternetEnum.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Locations.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Locations.java new file mode 100644 index 000000000000..41079a055bf1 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Locations.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.LocationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Locations. + */ +public interface Locations extends HasInner { + /** + * Return trial status for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkTrialAvailabilityAsync(String location); + + /** + * Return quota for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkQuotaAvailabilityAsync(String location); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/LogSpecification.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/LogSpecification.java new file mode 100644 index 000000000000..09745f547dab --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Log for Azure Monitoring. + */ +public class LogSpecification { + /** + * Name of the log. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the log. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Blob duration of the log. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get name of the log. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the log. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the log. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the log. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get blob duration of the log. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set blob duration of the log. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ManagementCluster.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ManagementCluster.java new file mode 100644 index 000000000000..d3dd5f0700dd --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ManagementCluster.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + + +/** + * The properties of a management cluster. + */ +public class ManagementCluster extends CommonClusterProperties { +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/MetricDimension.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/MetricDimension.java new file mode 100644 index 000000000000..56e0c8f9e33a --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/MetricDimension.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Dimension of metrics. + */ +public class MetricDimension { + /** + * Name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get name of the dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the dimension. + * + * @param name the name value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the dimension. + * + * @param displayName the displayName value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/MetricSpecification.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/MetricSpecification.java new file mode 100644 index 000000000000..cc0efef6efc1 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/MetricSpecification.java @@ -0,0 +1,359 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifications of the Metrics for Azure Monitoring. + */ +public class MetricSpecification { + /** + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Localized friendly display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Localized friendly description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Unit that makes sense for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /** + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * Supported aggregation types. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /** + * Supported time grain types. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /** + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Dimensions of the metric. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Whether or not the service is using regional MDM accounts. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private String enableRegionalMdmAccount; + + /** + * The name of the MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /** + * The name of the MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * Get name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metric. + * + * @param name the name value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get localized friendly display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized friendly display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get localized friendly description of the metric. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get unit that makes sense for the metric. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set unit that makes sense for the metric. + * + * @param unit the unit value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set name of the metric category that the metric belongs to. A metric can only belong to a single category. + * + * @param category the category value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get supported aggregation types. + * + * @return the supportedAggregationTypes value + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get supported time grain types. + * + * @return the supportedTimeGrainTypes value + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get dimensions of the metric. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set dimensions of the metric. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get whether or not the service is using regional MDM accounts. + * + * @return the enableRegionalMdmAccount value + */ + public String enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set whether or not the service is using regional MDM accounts. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(String enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get the name of the MDM account. + * + * @return the sourceMdmAccount value + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the name of the MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the name of the MDM namespace. + * + * @return the sourceMdmNamespace value + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the name of the MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/NsxtAdminRotateEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/NsxtAdminRotateEnum.java new file mode 100644 index 000000000000..3a5a45a42fd4 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/NsxtAdminRotateEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NsxtAdminRotateEnum. + */ +public final class NsxtAdminRotateEnum extends ExpandableStringEnum { + /** Static value OnetimeRotate for NsxtAdminRotateEnum. */ + public static final NsxtAdminRotateEnum ONETIME_ROTATE = fromString("OnetimeRotate"); + + /** + * Creates or finds a NsxtAdminRotateEnum from its string representation. + * @param name a name to look for + * @return the corresponding NsxtAdminRotateEnum + */ + @JsonCreator + public static NsxtAdminRotateEnum fromString(String name) { + return fromString(name, NsxtAdminRotateEnum.class); + } + + /** + * @return known NsxtAdminRotateEnum values + */ + public static Collection values() { + return values(NsxtAdminRotateEnum.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Operation.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Operation.java new file mode 100644 index 000000000000..2f200800bc70 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Operation.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + OperationProperties properties(); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/OperationDisplay.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/OperationDisplay.java new file mode 100644 index 000000000000..0645e69a58e3 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains the localized display information for this operation. + */ +public class OperationDisplay { + /** + * Localized friendly form of the resource provider name. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Localized friendly form of the resource type related to this operation. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Localized friendly name for the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Localized friendly description for the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get localized friendly form of the resource provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get localized friendly form of the resource type related to this operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get localized friendly name for the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get localized friendly description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/OperationProperties.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/OperationProperties.java new file mode 100644 index 000000000000..a5cdbd8b4633 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/OperationProperties.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Extra Operation properties. + */ +public class OperationProperties { + /** + * Service specifications of the operation. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get service specifications of the operation. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Operations.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Operations.java new file mode 100644 index 000000000000..0779a2e23797 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PortMirroringDirectionEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PortMirroringDirectionEnum.java new file mode 100644 index 000000000000..8e60b5b5904e --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PortMirroringDirectionEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PortMirroringStatusEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PortMirroringStatusEnum.java new file mode 100644 index 000000000000..e93bc0ddda4d --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PortMirroringStatusEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloud.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloud.java new file mode 100644 index 000000000000..917ac52cfc12 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloud.java @@ -0,0 +1,300 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.PrivateCloudInner; + +/** + * Type representing PrivateCloud. + */ +public interface PrivateCloud extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the circuit value. + */ + Circuit circuit(); + + /** + * @return the endpoints value. + */ + Endpoints endpoints(); + + /** + * @return the identitySources value. + */ + List identitySources(); + + /** + * @return the internet value. + */ + InternetEnum internet(); + + /** + * @return the managementCluster value. + */ + ManagementCluster managementCluster(); + + /** + * @return the managementNetwork value. + */ + String managementNetwork(); + + /** + * @return the networkBlock value. + */ + String networkBlock(); + + /** + * @return the nsxtCertificateThumbprint value. + */ + String nsxtCertificateThumbprint(); + + /** + * @return the nsxtPassword value. + */ + NsxtAdminRotateEnum nsxtPassword(); + + /** + * @return the provisioningNetwork value. + */ + String provisioningNetwork(); + + /** + * @return the provisioningState value. + */ + PrivateCloudProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the vcenterCertificateThumbprint value. + */ + String vcenterCertificateThumbprint(); + + /** + * @return the vcenterPassword value. + */ + VcsaAdminRotateEnum vcenterPassword(); + + /** + * @return the vmotionNetwork value. + */ + String vmotionNetwork(); + + /** + * The entirety of the PrivateCloud definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithNetworkBlock, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateCloud definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateCloud definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the PrivateCloud definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the privatecloud definition allowing to specify NetworkBlock. + */ + interface WithNetworkBlock { + /** + * Specifies networkBlock. + * @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 +*/ + WithSku withNetworkBlock(String networkBlock); + } + + /** + * The stage of the privatecloud definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The private cloud SKU + * @return the next definition stage +*/ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the privatecloud definition allowing to specify Circuit. + */ + interface WithCircuit { + /** + * Specifies circuit. + * @param circuit An ExpressRoute Circuit + * @return the next definition stage + */ + WithCreate withCircuit(Circuit circuit); + } + + /** + * The stage of the privatecloud definition allowing to specify IdentitySources. + */ + interface WithIdentitySources { + /** + * Specifies identitySources. + * @param identitySources vCenter Single Sign On Identity Sources + * @return the next definition stage + */ + WithCreate withIdentitySources(List identitySources); + } + + /** + * The stage of the privatecloud definition allowing to specify Internet. + */ + interface WithInternet { + /** + * Specifies internet. + * @param internet Connectivity to internet is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withInternet(InternetEnum internet); + } + + /** + * The stage of the privatecloud definition allowing to specify ManagementCluster. + */ + interface WithManagementCluster { + /** + * Specifies managementCluster. + * @param managementCluster The default cluster used for management + * @return the next definition stage + */ + WithCreate withManagementCluster(ManagementCluster managementCluster); + } + + /** + * The stage of the privatecloud definition allowing to specify NsxtPassword. + */ + interface WithNsxtPassword { + /** + * Specifies nsxtPassword. + * @param nsxtPassword Indicate to rotate the NSX-T Manager password for the private cloud. Possible values include: 'OnetimeRotate' + * @return the next definition stage + */ + WithCreate withNsxtPassword(NsxtAdminRotateEnum nsxtPassword); + } + + /** + * The stage of the privatecloud definition allowing to specify VcenterPassword. + */ + interface WithVcenterPassword { + /** + * Specifies vcenterPassword. + * @param vcenterPassword Indicate to rotate the vCenter admin password for the private cloud. Possible values include: 'OnetimeRotate' + * @return the next definition stage + */ + WithCreate withVcenterPassword(VcsaAdminRotateEnum vcenterPassword); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithCircuit, DefinitionStages.WithIdentitySources, DefinitionStages.WithInternet, DefinitionStages.WithManagementCluster, DefinitionStages.WithNsxtPassword, DefinitionStages.WithVcenterPassword { + } + } + /** + * The template for a PrivateCloud update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIdentitySources, UpdateStages.WithInternet, UpdateStages.WithManagementCluster, UpdateStages.WithNsxtPassword, UpdateStages.WithVcenterPassword { + } + + /** + * Grouping of PrivateCloud update stages. + */ + interface UpdateStages { + /** + * The stage of the privatecloud update allowing to specify IdentitySources. + */ + interface WithIdentitySources { + /** + * Specifies identitySources. + * @param identitySources vCenter Single Sign On Identity Sources + * @return the next update stage + */ + Update withIdentitySources(List identitySources); + } + + /** + * The stage of the privatecloud update allowing to specify Internet. + */ + interface WithInternet { + /** + * Specifies internet. + * @param internet Connectivity to internet is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withInternet(InternetEnum internet); + } + + /** + * The stage of the privatecloud update allowing to specify ManagementCluster. + */ + interface WithManagementCluster { + /** + * Specifies managementCluster. + * @param managementCluster The default cluster used for management + * @return the next update stage + */ + Update withManagementCluster(ManagementCluster managementCluster); + } + + /** + * The stage of the privatecloud update allowing to specify NsxtPassword. + */ + interface WithNsxtPassword { + /** + * Specifies nsxtPassword. + * @param nsxtPassword Indicate to rotate the NSX-T Manager password for the private cloud. Possible values include: 'OnetimeRotate' + * @return the next update stage + */ + Update withNsxtPassword(NsxtAdminRotateEnum nsxtPassword); + } + + /** + * The stage of the privatecloud update allowing to specify VcenterPassword. + */ + interface WithVcenterPassword { + /** + * Specifies vcenterPassword. + * @param vcenterPassword Indicate to rotate the vCenter admin password for the private cloud. Possible values include: 'OnetimeRotate' + * @return the next update stage + */ + Update withVcenterPassword(VcsaAdminRotateEnum vcenterPassword); + } + + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloudProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloudProvisioningState.java new file mode 100644 index 000000000000..7fad84256296 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloudProvisioningState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateCloudProvisioningState. + */ +public final class PrivateCloudProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Pending for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState PENDING = fromString("Pending"); + + /** Static value Building for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a PrivateCloudProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding PrivateCloudProvisioningState + */ + @JsonCreator + public static PrivateCloudProvisioningState fromString(String name) { + return fromString(name, PrivateCloudProvisioningState.class); + } + + /** + * @return known PrivateCloudProvisioningState values + */ + public static Collection values() { + return values(PrivateCloudProvisioningState.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloudUpdate.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloudUpdate.java new file mode 100644 index 000000000000..5fdc92422cee --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateCloudUpdate.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * An update to a private cloud resource. + */ +@JsonFlatten +public class PrivateCloudUpdate { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The default cluster used for management. + */ + @JsonProperty(value = "properties.managementCluster") + private ManagementCluster managementCluster; + + /** + * Connectivity to internet is enabled or disabled. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.internet") + private InternetEnum internet; + + /** + * vCenter Single Sign On Identity Sources. + */ + @JsonProperty(value = "properties.identitySources") + private List identitySources; + + /** + * Indicate to rotate the vCenter admin password for the private cloud. + * Possible values include: 'OnetimeRotate'. + */ + @JsonProperty(value = "properties.vcenterPassword") + private VcsaAdminRotateEnum vcenterPassword; + + /** + * Indicate to rotate the NSX-T Manager password for the private cloud. + * Possible values include: 'OnetimeRotate'. + */ + @JsonProperty(value = "properties.nsxtPassword") + private NsxtAdminRotateEnum nsxtPassword; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the default cluster used for management. + * + * @return the managementCluster value + */ + public ManagementCluster managementCluster() { + return this.managementCluster; + } + + /** + * Set the default cluster used for management. + * + * @param managementCluster the managementCluster value to set + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withManagementCluster(ManagementCluster managementCluster) { + this.managementCluster = managementCluster; + return this; + } + + /** + * Get connectivity to internet is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the internet value + */ + public InternetEnum internet() { + return this.internet; + } + + /** + * Set connectivity to internet is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param internet the internet value to set + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withInternet(InternetEnum internet) { + this.internet = internet; + return this; + } + + /** + * Get vCenter Single Sign On Identity Sources. + * + * @return the identitySources value + */ + public List identitySources() { + return this.identitySources; + } + + /** + * Set vCenter Single Sign On Identity Sources. + * + * @param identitySources the identitySources value to set + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withIdentitySources(List identitySources) { + this.identitySources = identitySources; + return this; + } + + /** + * Get indicate to rotate the vCenter admin password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @return the vcenterPassword value + */ + public VcsaAdminRotateEnum vcenterPassword() { + return this.vcenterPassword; + } + + /** + * Set indicate to rotate the vCenter admin password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @param vcenterPassword the vcenterPassword value to set + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withVcenterPassword(VcsaAdminRotateEnum vcenterPassword) { + this.vcenterPassword = vcenterPassword; + return this; + } + + /** + * Get indicate to rotate the NSX-T Manager password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @return the nsxtPassword value + */ + public NsxtAdminRotateEnum nsxtPassword() { + return this.nsxtPassword; + } + + /** + * Set indicate to rotate the NSX-T Manager password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @param nsxtPassword the nsxtPassword value to set + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withNsxtPassword(NsxtAdminRotateEnum nsxtPassword) { + this.nsxtPassword = nsxtPassword; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateClouds.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateClouds.java new file mode 100644 index 000000000000..e0f6683aa725 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/PrivateClouds.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.PrivateCloudsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateClouds. + */ +public interface PrivateClouds extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * List the admin credentials for the 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 + * @return the observable for the request + */ + Observable listAdminCredentialsAsync(String resourceGroupName, String privateCloudName); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Quota.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Quota.java new file mode 100644 index 000000000000..10c672804f0d --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Quota.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.QuotaInner; +import java.util.Map; + +/** + * Type representing Quota. + */ +public interface Quota extends HasInner, HasManager { + /** + * @return the hostsRemaining value. + */ + Map hostsRemaining(); + + /** + * @return the quotaEnabled value. + */ + QuotaEnabled quotaEnabled(); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/QuotaEnabled.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/QuotaEnabled.java new file mode 100644 index 000000000000..e3f0313f187f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/QuotaEnabled.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for QuotaEnabled. + */ +public final class QuotaEnabled extends ExpandableStringEnum { + /** Static value Enabled for QuotaEnabled. */ + public static final QuotaEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for QuotaEnabled. */ + public static final QuotaEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a QuotaEnabled from its string representation. + * @param name a name to look for + * @return the corresponding QuotaEnabled + */ + @JsonCreator + public static QuotaEnabled fromString(String name) { + return fromString(name, QuotaEnabled.class); + } + + /** + * @return known QuotaEnabled values + */ + public static Collection values() { + return values(QuotaEnabled.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/SegmentStatusEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/SegmentStatusEnum.java new file mode 100644 index 000000000000..cce73724232d --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/SegmentStatusEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ServiceSpecification.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ServiceSpecification.java new file mode 100644 index 000000000000..250b9545c1f9 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/ServiceSpecification.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service specification payload. + */ +public class ServiceSpecification { + /** + * Specifications of the Log for Azure Monitoring. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Specifications of the Metrics for Azure Monitoring. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Sku.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Sku.java new file mode 100644 index 000000000000..4f60ec1cb2fc --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Sku.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource model definition representing SKU. + */ +public class Sku { + /** + * The name of the SKU. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/SslEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/SslEnum.java new file mode 100644 index 000000000000..1fddb5ac2f89 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/SslEnum.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SslEnum. + */ +public final class SslEnum extends ExpandableStringEnum { + /** Static value Enabled for SslEnum. */ + public static final SslEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for SslEnum. */ + public static final SslEnum DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SslEnum from its string representation. + * @param name a name to look for + * @return the corresponding SslEnum + */ + @JsonCreator + public static SslEnum fromString(String name) { + return fromString(name, SslEnum.class); + } + + /** + * @return known SslEnum values + */ + public static Collection values() { + return values(SslEnum.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Trial.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Trial.java new file mode 100644 index 000000000000..0c0fec6aefef --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/Trial.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.TrialInner; + +/** + * Type representing Trial. + */ +public interface Trial extends HasInner, HasManager { + /** + * @return the availableHosts value. + */ + Integer availableHosts(); + + /** + * @return the status value. + */ + TrialStatus status(); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/TrialStatus.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/TrialStatus.java new file mode 100644 index 000000000000..e0ed0daec13c --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/TrialStatus.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TrialStatus. + */ +public final class TrialStatus extends ExpandableStringEnum { + /** Static value TrialAvailable for TrialStatus. */ + public static final TrialStatus TRIAL_AVAILABLE = fromString("TrialAvailable"); + + /** Static value TrialUsed for TrialStatus. */ + public static final TrialStatus TRIAL_USED = fromString("TrialUsed"); + + /** Static value TrialDisabled for TrialStatus. */ + public static final TrialStatus TRIAL_DISABLED = fromString("TrialDisabled"); + + /** + * Creates or finds a TrialStatus from its string representation. + * @param name a name to look for + * @return the corresponding TrialStatus + */ + @JsonCreator + public static TrialStatus fromString(String name) { + return fromString(name, TrialStatus.class); + } + + /** + * @return known TrialStatus values + */ + public static Collection values() { + return values(TrialStatus.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VMGroupStatusEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VMGroupStatusEnum.java new file mode 100644 index 000000000000..7228ad7f9d37 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VMGroupStatusEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VMTypeEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VMTypeEnum.java new file mode 100644 index 000000000000..5e60ae292826 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VMTypeEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VcsaAdminRotateEnum.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VcsaAdminRotateEnum.java new file mode 100644 index 000000000000..e7a292ed80bf --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/VcsaAdminRotateEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for VcsaAdminRotateEnum. + */ +public final class VcsaAdminRotateEnum extends ExpandableStringEnum { + /** Static value OnetimeRotate for VcsaAdminRotateEnum. */ + public static final VcsaAdminRotateEnum ONETIME_ROTATE = fromString("OnetimeRotate"); + + /** + * Creates or finds a VcsaAdminRotateEnum from its string representation. + * @param name a name to look for + * @return the corresponding VcsaAdminRotateEnum + */ + @JsonCreator + public static VcsaAdminRotateEnum fromString(String name) { + return fromString(name, VcsaAdminRotateEnum.class); + } + + /** + * @return known VcsaAdminRotateEnum values + */ + public static Collection values() { + return values(VcsaAdminRotateEnum.class); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcp.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcp.java new file mode 100644 index 000000000000..ce6c9fbc3ad9 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcp.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.WorkloadNetworkDhcpInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import java.util.List; + +/** + * Type representing WorkloadNetworkDhcp. + */ +public interface WorkloadNetworkDhcp extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + WorkloadNetworkDhcpProvisioningState provisioningState(); + + /** + * @return the revision value. + */ + Long revision(); + + /** + * @return the segments value. + */ + List segments(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the WorkloadNetworkDhcp definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkloadNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of WorkloadNetworkDhcp definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WorkloadNetworkDhcp definition. + */ + interface Blank extends WithWorkloadNetwork { + } + + /** + * The stage of the workloadnetworkdhcp definition allowing to specify WorkloadNetwork. + */ + interface WithWorkloadNetwork { + /** + * 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 withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName); + } + + /** + * The stage of the workloadnetworkdhcp definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Display name of the DHCP entity + * @return the next definition stage + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the workloadnetworkdhcp definition allowing to specify Revision. + */ + interface WithRevision { + /** + * Specifies revision. + * @param revision NSX revision number + * @return the next definition stage + */ + WithCreate withRevision(Long revision); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDisplayName, DefinitionStages.WithRevision { + } + } + /** + * The template for a WorkloadNetworkDhcp update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDisplayName, UpdateStages.WithRevision { + } + + /** + * Grouping of WorkloadNetworkDhcp update stages. + */ + interface UpdateStages { + /** + * The stage of the workloadnetworkdhcp update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Display name of the DHCP entity + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the workloadnetworkdhcp update allowing to specify Revision. + */ + interface WithRevision { + /** + * Specifies revision. + * @param revision NSX revision number + * @return the next update stage + */ + Update withRevision(Long revision); + } + + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpEntity.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpEntity.java new file mode 100644 index 000000000000..6e3fd4d29a7e --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * 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) +}) +public class WorkloadNetworkDhcpEntity { + /** + * 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. Possible values include: 'Succeeded', 'Failed', + * 'Building', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDhcpProvisioningState provisioningState; + + /** + * NSX revision number. + */ + @JsonProperty(value = "revision") + private Long revision; + + /** + * Get display name of the DHCP entity. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 nSX Segments consuming DHCP. + * + * @return the segments value + */ + public List segments() { + return this.segments; + } + + /** + * Get the provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public WorkloadNetworkDhcpProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get nSX revision number. + * + * @return the revision value + */ + public Long revision() { + return this.revision; + } + + /** + * Set 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; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpProvisioningState.java new file mode 100644 index 000000000000..cf5dd23a7396 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpProvisioningState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpRelay.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpRelay.java new file mode 100644 index 000000000000..302a5c953249 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpRelay.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NSX DHCP Relay. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dhcpType", defaultImpl = WorkloadNetworkDhcpRelay.class) +@JsonTypeName("RELAY") +public class WorkloadNetworkDhcpRelay extends WorkloadNetworkDhcpEntity { + /** + * DHCP Relay Addresses. Max 3. + */ + @JsonProperty(value = "serverAddresses") + private List serverAddresses; + + /** + * Get dHCP Relay Addresses. Max 3. + * + * @return the serverAddresses value + */ + public List serverAddresses() { + return this.serverAddresses; + } + + /** + * Set 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; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpServer.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpServer.java new file mode 100644 index 000000000000..b7bf411cc9b2 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkDhcpServer.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +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", defaultImpl = WorkloadNetworkDhcpServer.class) +@JsonTypeName("SERVER") +public class WorkloadNetworkDhcpServer extends WorkloadNetworkDhcpEntity { + /** + * DHCP Server Address. + */ + @JsonProperty(value = "serverAddress") + private String serverAddress; + + /** + * DHCP Server Lease Time. + */ + @JsonProperty(value = "leaseTime") + private Long leaseTime; + + /** + * Get dHCP Server Address. + * + * @return the serverAddress value + */ + public String serverAddress() { + return this.serverAddress; + } + + /** + * Set 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 dHCP Server Lease Time. + * + * @return the leaseTime value + */ + public Long leaseTime() { + return this.leaseTime; + } + + /** + * Set 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; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkGateway.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkGateway.java new file mode 100644 index 000000000000..d340543cbd07 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkGateway.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.WorkloadNetworkGatewayInner; + +/** + * Type representing WorkloadNetworkGateway. + */ +public interface WorkloadNetworkGateway extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the path value. + */ + String path(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkPortMirroring.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkPortMirroring.java new file mode 100644 index 000000000000..6e2f2f492e8e --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkPortMirroring.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.WorkloadNetworkPortMirroringInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; + +/** + * Type representing WorkloadNetworkPortMirroring. + */ +public interface WorkloadNetworkPortMirroring extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the destination value. + */ + String destination(); + + /** + * @return the direction value. + */ + PortMirroringDirectionEnum direction(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + WorkloadNetworkPortMirroringProvisioningState provisioningState(); + + /** + * @return the revision value. + */ + Long revision(); + + /** + * @return the source value. + */ + String source(); + + /** + * @return the status value. + */ + PortMirroringStatusEnum status(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the WorkloadNetworkPortMirroring definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkloadNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of WorkloadNetworkPortMirroring definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WorkloadNetworkPortMirroring definition. + */ + interface Blank extends WithWorkloadNetwork { + } + + /** + * The stage of the workloadnetworkportmirroring definition allowing to specify WorkloadNetwork. + */ + interface WithWorkloadNetwork { + /** + * 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 withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName); + } + + /** + * The stage of the workloadnetworkportmirroring definition allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination Destination VM Group + * @return the next definition stage + */ + WithCreate withDestination(String destination); + } + + /** + * The stage of the workloadnetworkportmirroring definition allowing to specify Direction. + */ + interface WithDirection { + /** + * Specifies direction. + * @param direction Direction of port mirroring profile. Possible values include: 'INGRESS, EGRESS, BIDIRECTIONAL' + * @return the next definition stage + */ + WithCreate withDirection(PortMirroringDirectionEnum direction); + } + + /** + * The stage of the workloadnetworkportmirroring definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @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 Revision. + */ + interface WithRevision { + /** + * Specifies revision. + * @param revision NSX revision number + * @return the next definition stage + */ + WithCreate withRevision(Long revision); + } + + /** + * The stage of the workloadnetworkportmirroring definition allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source Source VM Group + * @return the next definition stage + */ + WithCreate withSource(String source); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDestination, DefinitionStages.WithDirection, DefinitionStages.WithDisplayName, DefinitionStages.WithRevision, DefinitionStages.WithSource { + } + } + /** + * The template for a WorkloadNetworkPortMirroring update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDestination, UpdateStages.WithDirection, UpdateStages.WithDisplayName, UpdateStages.WithRevision, UpdateStages.WithSource { + } + + /** + * Grouping of WorkloadNetworkPortMirroring update stages. + */ + interface UpdateStages { + /** + * The stage of the workloadnetworkportmirroring update allowing to specify Destination. + */ + interface WithDestination { + /** + * Specifies destination. + * @param destination Destination VM Group + * @return the next update stage + */ + Update withDestination(String destination); + } + + /** + * The stage of the workloadnetworkportmirroring update allowing to specify Direction. + */ + interface WithDirection { + /** + * Specifies direction. + * @param direction Direction of port mirroring profile. Possible values include: 'INGRESS, EGRESS, BIDIRECTIONAL' + * @return the next update stage + */ + Update withDirection(PortMirroringDirectionEnum direction); + } + + /** + * The stage of the workloadnetworkportmirroring update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Display name of the port mirroring profile + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the workloadnetworkportmirroring update allowing to specify Revision. + */ + interface WithRevision { + /** + * Specifies revision. + * @param revision NSX revision number + * @return the next update stage + */ + Update withRevision(Long revision); + } + + /** + * The stage of the workloadnetworkportmirroring update allowing to specify Source. + */ + interface WithSource { + /** + * Specifies source. + * @param source Source VM Group + * @return the next update stage + */ + Update withSource(String source); + } + + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkPortMirroringProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkPortMirroringProvisioningState.java new file mode 100644 index 000000000000..e534e6a19419 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkPortMirroringProvisioningState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegment.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegment.java new file mode 100644 index 000000000000..11ce86500630 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegment.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.WorkloadNetworkSegmentInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import java.util.List; + +/** + * Type representing WorkloadNetworkSegment. + */ +public interface WorkloadNetworkSegment extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the connectedGateway value. + */ + String connectedGateway(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the portVif value. + */ + List portVif(); + + /** + * @return the provisioningState value. + */ + WorkloadNetworkSegmentProvisioningState provisioningState(); + + /** + * @return the revision value. + */ + Long revision(); + + /** + * @return the status value. + */ + SegmentStatusEnum status(); + + /** + * @return the subnet value. + */ + WorkloadNetworkSegmentSubnet subnet(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the WorkloadNetworkSegment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkloadNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of WorkloadNetworkSegment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WorkloadNetworkSegment definition. + */ + interface Blank extends WithWorkloadNetwork { + } + + /** + * The stage of the workloadnetworksegment definition allowing to specify WorkloadNetwork. + */ + interface WithWorkloadNetwork { + /** + * 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 withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName); + } + + /** + * The stage of the workloadnetworksegment definition allowing to specify ConnectedGateway. + */ + interface WithConnectedGateway { + /** + * Specifies connectedGateway. + * @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 DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @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 Revision. + */ + interface WithRevision { + /** + * Specifies revision. + * @param revision NSX revision number + * @return the next definition stage + */ + WithCreate withRevision(Long revision); + } + + /** + * The stage of the workloadnetworksegment definition allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @param subnet Subnet which to connect segment to + * @return the next definition stage + */ + WithCreate withSubnet(WorkloadNetworkSegmentSubnet subnet); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithConnectedGateway, DefinitionStages.WithDisplayName, DefinitionStages.WithRevision, DefinitionStages.WithSubnet { + } + } + /** + * The template for a WorkloadNetworkSegment update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithConnectedGateway, UpdateStages.WithDisplayName, UpdateStages.WithRevision, UpdateStages.WithSubnet { + } + + /** + * Grouping of WorkloadNetworkSegment update stages. + */ + interface UpdateStages { + /** + * The stage of the workloadnetworksegment update allowing to specify ConnectedGateway. + */ + interface WithConnectedGateway { + /** + * Specifies connectedGateway. + * @param connectedGateway Gateway which to connect segment to + * @return the next update stage + */ + Update withConnectedGateway(String connectedGateway); + } + + /** + * The stage of the workloadnetworksegment update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Display name of the segment + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the workloadnetworksegment update allowing to specify Revision. + */ + interface WithRevision { + /** + * Specifies revision. + * @param revision NSX revision number + * @return the next update stage + */ + Update withRevision(Long revision); + } + + /** + * The stage of the workloadnetworksegment update allowing to specify Subnet. + */ + interface WithSubnet { + /** + * Specifies subnet. + * @param subnet Subnet which to connect segment to + * @return the next update stage + */ + Update withSubnet(WorkloadNetworkSegmentSubnet subnet); + } + + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentPortVif.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentPortVif.java new file mode 100644 index 000000000000..f2b16dff4808 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentPortVif.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Ports and any VIF attached to segment. + */ +public class WorkloadNetworkSegmentPortVif { + /** + * Name of port or VIF attached to segment. + */ + @JsonProperty(value = "portName") + private String portName; + + /** + * Get name of port or VIF attached to segment. + * + * @return the portName value + */ + public String portName() { + return this.portName; + } + + /** + * Set name of port or VIF attached to segment. + * + * @param portName the portName value to set + * @return the WorkloadNetworkSegmentPortVif object itself. + */ + public WorkloadNetworkSegmentPortVif withPortName(String portName) { + this.portName = portName; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentProvisioningState.java new file mode 100644 index 000000000000..5953711fc190 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentProvisioningState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentSubnet.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentSubnet.java new file mode 100644 index 000000000000..af8e4b2ea397 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkSegmentSubnet.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Subnet configuration for segment. + */ +public class WorkloadNetworkSegmentSubnet { + /** + * DHCP Range assigned for subnet. + */ + @JsonProperty(value = "dhcpRanges") + private List dhcpRanges; + + /** + * Gateway address. + */ + @JsonProperty(value = "gatewayAddress") + private String gatewayAddress; + + /** + * Get dHCP Range assigned for subnet. + * + * @return the dhcpRanges value + */ + public List dhcpRanges() { + return this.dhcpRanges; + } + + /** + * Set 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 gateway address. + * + * @return the gatewayAddress value + */ + public String gatewayAddress() { + return this.gatewayAddress; + } + + /** + * Set gateway address. + * + * @param gatewayAddress the gatewayAddress value to set + * @return the WorkloadNetworkSegmentSubnet object itself. + */ + public WorkloadNetworkSegmentSubnet withGatewayAddress(String gatewayAddress) { + this.gatewayAddress = gatewayAddress; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVMGroup.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVMGroup.java new file mode 100644 index 000000000000..7c4014b44db9 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVMGroup.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.WorkloadNetworkVMGroupInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import java.util.List; + +/** + * Type representing WorkloadNetworkVMGroup. + */ +public interface WorkloadNetworkVMGroup extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the members value. + */ + List members(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + WorkloadNetworkVMGroupProvisioningState provisioningState(); + + /** + * @return the revision value. + */ + Long revision(); + + /** + * @return the status value. + */ + VMGroupStatusEnum status(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the WorkloadNetworkVMGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkloadNetwork, DefinitionStages.WithCreate { + } + + /** + * Grouping of WorkloadNetworkVMGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WorkloadNetworkVMGroup definition. + */ + interface Blank extends WithWorkloadNetwork { + } + + /** + * The stage of the workloadnetworkvmgroup definition allowing to specify WorkloadNetwork. + */ + interface WithWorkloadNetwork { + /** + * 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 withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName); + } + + /** + * The stage of the workloadnetworkvmgroup definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @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 members. + * @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 revision. + * @param revision NSX revision number + * @return the next definition stage + */ + WithCreate withRevision(Long revision); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithDisplayName, DefinitionStages.WithMembers, DefinitionStages.WithRevision { + } + } + /** + * The template for a WorkloadNetworkVMGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithDisplayName, UpdateStages.WithMembers, UpdateStages.WithRevision { + } + + /** + * Grouping of WorkloadNetworkVMGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the workloadnetworkvmgroup update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Display name of the VM group + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the workloadnetworkvmgroup update allowing to specify Members. + */ + interface WithMembers { + /** + * Specifies members. + * @param members Virtual machine members of this group + * @return the next update stage + */ + Update withMembers(List members); + } + + /** + * The stage of the workloadnetworkvmgroup update allowing to specify Revision. + */ + interface WithRevision { + /** + * Specifies revision. + * @param revision NSX revision number + * @return the next update stage + */ + Update withRevision(Long revision); + } + + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVMGroupProvisioningState.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVMGroupProvisioningState.java new file mode 100644 index 000000000000..8cc1e9784044 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVMGroupProvisioningState.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVirtualMachine.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVirtualMachine.java new file mode 100644 index 000000000000..5cc37a9504e4 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworkVirtualMachine.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.AVSManager; +import com.microsoft.azure.management.avs.v2020_07_17_preview.implementation.WorkloadNetworkVirtualMachineInner; + +/** + * Type representing WorkloadNetworkVirtualMachine. + */ +public interface WorkloadNetworkVirtualMachine extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vmType value. + */ + VMTypeEnum vmType(); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworks.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworks.java new file mode 100644 index 000000000000..0b2e54c61270 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/WorkloadNetworks.java @@ -0,0 +1,216 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview; + +import rx.Completable; +import rx.Observable; + +/** + * Type representing WorkloadNetworks. + */ +public interface WorkloadNetworks { + /** + * Begins definition for a new Segment resource. + * @param name resource name. + * @return the first stage of the new Segment definition. + */ + WorkloadNetworkSegment.DefinitionStages.Blank defineSegment(String name); + + /** + * Begins definition for a new DhcpConfiguration resource. + * @param name resource name. + * @return the first stage of the new DhcpConfiguration definition. + */ + WorkloadNetworkDhcp.DefinitionStages.Blank defineDhcpConfiguration(String name); + + /** + * Begins definition for a new PortMirroringProfile resource. + * @param name resource name. + * @return the first stage of the new PortMirroringProfile definition. + */ + WorkloadNetworkPortMirroring.DefinitionStages.Blank definePortMirroringProfile(String name); + + /** + * Begins definition for a new VmGroup resource. + * @param name resource name. + * @return the first stage of the new VmGroup definition. + */ + WorkloadNetworkVMGroup.DefinitionStages.Blank defineVmGroup(String name); + + /** + * 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 + * @return the observable for the request + */ + Observable listSegmentsAsync(final String resourceGroupName, final String privateCloudName); + + /** + * 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 + * @return the observable for the request + */ + Observable getSegmentAsync(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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * 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 + * @return the observable for the request + */ + Observable listDhcpAsync(final String resourceGroupName, final 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDhcpAsync(String resourceGroupName, String dhcpId, String privateCloudName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId); + + /** + * 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 + * @return the observable for the request + */ + Observable listGatewaysAsync(final String resourceGroupName, final String privateCloudName); + + /** + * 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 + * @return the observable for the request + */ + Observable getGatewayAsync(String resourceGroupName, String privateCloudName, String gatewayId); + + /** + * 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 + * @return the observable for the request + */ + Observable listPortMirroringAsync(final String resourceGroupName, final String privateCloudName); + + /** + * 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 + * @return the observable for the request + */ + Observable getPortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId); + + /** + * 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 + * @return the observable for the request + */ + Completable deletePortMirroringAsync(String resourceGroupName, String portMirroringId, 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVMGroupsAsync(final String resourceGroupName, final String privateCloudName); + + /** + * 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 + * @return the observable for the request + */ + Observable getVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteVMGroupAsync(String resourceGroupName, String vmGroupId, 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 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listVirtualMachinesAsync(final String resourceGroupName, final String privateCloudName); + + /** + * 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 NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getVirtualMachineAsync(String resourceGroupName, String privateCloudName, String virtualMachineId); + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AVSManager.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AVSManager.java new file mode 100644 index 000000000000..7638777649d0 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AVSManager.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Operations; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Locations; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters; +import com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSites; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations; +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure AVS resource management. + */ +public final class AVSManager extends ManagerCore { + private Operations operations; + private Locations locations; + private PrivateClouds privateClouds; + private Clusters clusters; + private HcxEnterpriseSites hcxEnterpriseSites; + private Authorizations authorizations; + private GlobalReachConnections globalReachConnections; + private WorkloadNetworks workloadNetworks; + /** + * Get a Configurable instance that can be used to create AVSManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AVSManager.ConfigurableImpl(); + } + /** + * Creates an instance of AVSManager that exposes AVS resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the AVSManager + */ + public static AVSManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new AVSManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of AVSManager that exposes AVS resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the AVSManager + */ + public static AVSManager authenticate(RestClient restClient, String subscriptionId) { + return new AVSManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of AVSManager that exposes AVS management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing AVS management API entry points that work across subscriptions + */ + AVSManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage PrivateClouds. + */ + public PrivateClouds privateClouds() { + if (this.privateClouds == null) { + this.privateClouds = new PrivateCloudsImpl(this); + } + return this.privateClouds; + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage HcxEnterpriseSites. + */ + public HcxEnterpriseSites hcxEnterpriseSites() { + if (this.hcxEnterpriseSites == null) { + this.hcxEnterpriseSites = new HcxEnterpriseSitesImpl(this); + } + return this.hcxEnterpriseSites; + } + + /** + * @return Entry point to manage Authorizations. + */ + public Authorizations authorizations() { + if (this.authorizations == null) { + this.authorizations = new AuthorizationsImpl(this); + } + return this.authorizations; + } + + /** + * @return Entry point to manage GlobalReachConnections. + */ + public GlobalReachConnections globalReachConnections() { + if (this.globalReachConnections == null) { + this.globalReachConnections = new GlobalReachConnectionsImpl(this); + } + return this.globalReachConnections; + } + + /** + * @return Entry point to manage WorkloadNetworks. + */ + public WorkloadNetworks workloadNetworks() { + if (this.workloadNetworks == null) { + this.workloadNetworks = new WorkloadNetworksImpl(this); + } + return this.workloadNetworks; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public AVSManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return AVSManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private AVSManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new AvsClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AdminCredentialsImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AdminCredentialsImpl.java new file mode 100644 index 000000000000..80fb483696e9 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AdminCredentialsImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.AdminCredentials; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AdminCredentialsImpl extends WrapperImpl implements AdminCredentials { + private final AVSManager manager; + AdminCredentialsImpl(AdminCredentialsInner inner, AVSManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public String nsxtPassword() { + return this.inner().nsxtPassword(); + } + + @Override + public String nsxtUsername() { + return this.inner().nsxtUsername(); + } + + @Override + public String vcenterPassword() { + return this.inner().vcenterPassword(); + } + + @Override + public String vcenterUsername() { + return this.inner().vcenterUsername(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AdminCredentialsInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AdminCredentialsInner.java new file mode 100644 index 000000000000..d91974de0207 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AdminCredentialsInner.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Administrative credentials for accessing vCenter and NSX-T. + */ +public class AdminCredentialsInner { + /** + * NSX-T Manager username. + */ + @JsonProperty(value = "nsxtUsername", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtUsername; + + /** + * NSX-T Manager password. + */ + @JsonProperty(value = "nsxtPassword", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtPassword; + + /** + * vCenter admin username. + */ + @JsonProperty(value = "vcenterUsername", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterUsername; + + /** + * vCenter admin password. + */ + @JsonProperty(value = "vcenterPassword", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterPassword; + + /** + * Get nSX-T Manager username. + * + * @return the nsxtUsername value + */ + public String nsxtUsername() { + return this.nsxtUsername; + } + + /** + * Get nSX-T Manager password. + * + * @return the nsxtPassword value + */ + public String nsxtPassword() { + return this.nsxtPassword; + } + + /** + * Get vCenter admin username. + * + * @return the vcenterUsername value + */ + public String vcenterUsername() { + return this.vcenterUsername; + } + + /** + * Get vCenter admin password. + * + * @return the vcenterPassword value + */ + public String vcenterPassword() { + return this.vcenterPassword; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AuthorizationsImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AuthorizationsImpl.java new file mode 100644 index 000000000000..afc4790a9bf8 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AuthorizationsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ExpressRouteAuthorization; + +class AuthorizationsImpl extends WrapperImpl implements Authorizations { + private final AVSManager manager; + + AuthorizationsImpl(AVSManager manager) { + super(manager.inner().authorizations()); + this.manager = manager; + } + + public AVSManager manager() { + return this.manager; + } + + @Override + public ExpressRouteAuthorizationImpl define(String name) { + return wrapModel(name); + } + + private ExpressRouteAuthorizationImpl wrapModel(ExpressRouteAuthorizationInner inner) { + return new ExpressRouteAuthorizationImpl(inner, manager()); + } + + private ExpressRouteAuthorizationImpl wrapModel(String name) { + return new ExpressRouteAuthorizationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String privateCloudName) { + AuthorizationsInner client = this.inner(); + return client.listAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExpressRouteAuthorization call(ExpressRouteAuthorizationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + AuthorizationsInner client = this.inner(); + return client.getAsync(resourceGroupName, privateCloudName, authorizationName) + .flatMap(new Func1>() { + @Override + public Observable call(ExpressRouteAuthorizationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ExpressRouteAuthorization)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + AuthorizationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, privateCloudName, authorizationName).toCompletable(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AuthorizationsInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AuthorizationsInner.java new file mode 100644 index 000000000000..e8c9288b2ec9 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AuthorizationsInner.java @@ -0,0 +1,759 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Authorizations. + */ +public class AuthorizationsInner { + /** The Retrofit service to perform REST calls. */ + private AuthorizationsService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of AuthorizationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AuthorizationsInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(AuthorizationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Authorizations to be + * used by Retrofit to perform actually REST calls. + */ + interface AuthorizationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("authorizationName") String authorizationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("authorizationName") String authorizationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ExpressRouteAuthorizationInner authorization, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("authorizationName") String authorizationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ExpressRouteAuthorizationInner authorization, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("authorizationName") String authorizationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("authorizationName") String authorizationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Authorizations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List ExpressRoute Circuit Authorizations 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteAuthorizationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List ExpressRoute Circuit Authorizations 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List ExpressRoute Circuit Authorizations 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 + * @return the observable to the PagedList<ExpressRouteAuthorizationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateCloudName) { + return listWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List ExpressRoute Circuit Authorizations 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 + * @return the observable to the PagedList<ExpressRouteAuthorizationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteAuthorizationInner object if successful. + */ + public ExpressRouteAuthorizationInner get(String resourceGroupName, String privateCloudName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).toBlocking().single().body(); + } + + /** + * Get an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String privateCloudName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName), serviceCallback); + } + + /** + * Get an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteAuthorizationInner object + */ + public Observable getAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).map(new Func1, ExpressRouteAuthorizationInner>() { + @Override + public ExpressRouteAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteAuthorizationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, privateCloudName, authorizationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteAuthorizationInner object if successful. + */ + public ExpressRouteAuthorizationInner createOrUpdate(String resourceGroupName, String privateCloudName, String authorizationName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).toBlocking().last().body(); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateCloudName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName), serviceCallback); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).map(new Func1, ExpressRouteAuthorizationInner>() { + @Override + public ExpressRouteAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, authorizationName, this.client.apiVersion(), this.client.acceptLanguage(), authorization, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExpressRouteAuthorizationInner object if successful. + */ + public ExpressRouteAuthorizationInner beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String authorizationName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).toBlocking().single().body(); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName), serviceCallback); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteAuthorizationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).map(new Func1, ExpressRouteAuthorizationInner>() { + @Override + public ExpressRouteAuthorizationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExpressRouteAuthorizationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, authorizationName, this.client.apiVersion(), this.client.acceptLanguage(), authorization, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateCloudName, String authorizationName) { + deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).toBlocking().last().body(); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateCloudName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName), serviceCallback); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, privateCloudName, authorizationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateCloudName, String authorizationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).toBlocking().single().body(); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateCloudName, String authorizationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName), serviceCallback); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an ExpressRoute Circuit Authorization 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 authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (authorizationName == null) { + throw new IllegalArgumentException("Parameter authorizationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, privateCloudName, authorizationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExpressRouteAuthorizationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteAuthorizationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExpressRouteAuthorizationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExpressRouteAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AvsClientImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AvsClientImpl.java new file mode 100644 index 000000000000..da37fef51a68 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/AvsClientImpl.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AvsClientImpl class. + */ +public class AvsClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AvsClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AvsClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AvsClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AvsClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The PrivateCloudsInner object to access its operations. + */ + private PrivateCloudsInner privateClouds; + + /** + * Gets the PrivateCloudsInner object to access its operations. + * @return the PrivateCloudsInner object. + */ + public PrivateCloudsInner privateClouds() { + return this.privateClouds; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The HcxEnterpriseSitesInner object to access its operations. + */ + private HcxEnterpriseSitesInner hcxEnterpriseSites; + + /** + * Gets the HcxEnterpriseSitesInner object to access its operations. + * @return the HcxEnterpriseSitesInner object. + */ + public HcxEnterpriseSitesInner hcxEnterpriseSites() { + return this.hcxEnterpriseSites; + } + + /** + * The AuthorizationsInner object to access its operations. + */ + private AuthorizationsInner authorizations; + + /** + * Gets the AuthorizationsInner object to access its operations. + * @return the AuthorizationsInner object. + */ + public AuthorizationsInner authorizations() { + return this.authorizations; + } + + /** + * The GlobalReachConnectionsInner object to access its operations. + */ + private GlobalReachConnectionsInner globalReachConnections; + + /** + * Gets the GlobalReachConnectionsInner object to access its operations. + * @return the GlobalReachConnectionsInner object. + */ + public GlobalReachConnectionsInner globalReachConnections() { + return this.globalReachConnections; + } + + /** + * The WorkloadNetworksInner object to access its operations. + */ + private WorkloadNetworksInner workloadNetworks; + + /** + * Gets the WorkloadNetworksInner object to access its operations. + * @return the WorkloadNetworksInner object. + */ + public WorkloadNetworksInner workloadNetworks() { + return this.workloadNetworks; + } + + /** + * Initializes an instance of AvsClient client. + * + * @param credentials the management credentials for Azure + */ + public AvsClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of AvsClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AvsClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AvsClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AvsClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-07-17-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.privateClouds = new PrivateCloudsInner(restClient().retrofit(), this); + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.hcxEnterpriseSites = new HcxEnterpriseSitesInner(restClient().retrofit(), this); + this.authorizations = new AuthorizationsInner(restClient().retrofit(), this); + this.globalReachConnections = new GlobalReachConnectionsInner(restClient().retrofit(), this); + this.workloadNetworks = new WorkloadNetworksInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "AvsClient", "2020-07-17-preview"); + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClusterImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClusterImpl.java new file mode 100644 index 000000000000..517af5201c8f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClusterImpl.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.Cluster; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ClusterUpdate; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Sku; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ClusterProvisioningState; +import java.util.List; +import rx.functions.Func1; + +class ClusterImpl extends CreatableUpdatableImpl implements Cluster, Cluster.Definition, Cluster.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String clusterName; + private ClusterUpdate updateParameter; + + ClusterImpl(String name, AVSManager manager) { + super(name, new ClusterInner()); + this.manager = manager; + // Set resource name + this.clusterName = name; + // + this.updateParameter = new ClusterUpdate(); + } + + ClusterImpl(ClusterInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.clusterName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + // + this.updateParameter = new ClusterUpdate(); + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.clusterName, this.inner()) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.updateAsync(this.resourceGroupName, this.privateCloudName, this.clusterName, this.updateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getAsync(this.resourceGroupName, this.privateCloudName, this.clusterName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ClusterUpdate(); + } + + @Override + public Integer clusterId() { + return this.inner().clusterId(); + } + + @Override + public Integer clusterSize() { + return this.inner().clusterSize(); + } + + @Override + public List hosts() { + return this.inner().hosts(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ClusterProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ClusterImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + @Override + public ClusterImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ClusterImpl withClusterSize(Integer clusterSize) { + if (isInCreateMode()) { + this.inner().withClusterSize(clusterSize); + } else { + this.updateParameter.withClusterSize(clusterSize); + } + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClusterInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClusterInner.java new file mode 100644 index 000000000000..1d355c12eff7 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClusterInner.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.Sku; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ClusterProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A cluster resource. + */ +@JsonFlatten +public class ClusterInner extends ProxyResource { + /** + * The cluster SKU. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The state of the cluster provisioning. Possible values include: + * 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterProvisioningState provisioningState; + + /** + * The cluster size. + */ + @JsonProperty(value = "properties.clusterSize") + private Integer clusterSize; + + /** + * The identity. + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private Integer clusterId; + + /** + * The hosts. + */ + @JsonProperty(value = "properties.hosts", access = JsonProperty.Access.WRITE_ONLY) + private List hosts; + + /** + * Get the cluster SKU. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the cluster SKU. + * + * @param sku the sku value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the state of the cluster provisioning. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public ClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the cluster size. + * + * @return the clusterSize value + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the cluster size. + * + * @param clusterSize the clusterSize value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + + /** + * Get the identity. + * + * @return the clusterId value + */ + public Integer clusterId() { + return this.clusterId; + } + + /** + * Get the hosts. + * + * @return the hosts value + */ + public List hosts() { + return this.hosts; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClustersImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClustersImpl.java new file mode 100644 index 000000000000..ca59951f797a --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClustersImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Cluster; + +class ClustersImpl extends WrapperImpl implements Clusters { + private final AVSManager manager; + + ClustersImpl(AVSManager manager) { + super(manager.inner().clusters()); + this.manager = manager; + } + + public AVSManager manager() { + return this.manager; + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + private ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner, manager()); + } + + private ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String privateCloudName) { + ClustersInner client = this.inner(); + return client.listAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String privateCloudName, String clusterName) { + ClustersInner client = this.inner(); + return client.getAsync(resourceGroupName, privateCloudName, clusterName) + .flatMap(new Func1>() { + @Override + public Observable call(ClusterInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Cluster)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String privateCloudName, String clusterName) { + ClustersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, privateCloudName, clusterName).toCompletable(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClustersInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClustersInner.java new file mode 100644 index 000000000000..4afb8221c07f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ClustersInner.java @@ -0,0 +1,972 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ClusterUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Clusters. + */ +public class ClustersInner { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterInner cluster, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterInner cluster, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterUpdate clusterUpdate, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Body ClusterUpdate clusterUpdate, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List clusters 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List clusters 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List clusters 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 + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateCloudName) { + return listWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List clusters 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 + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List clusters in a private cloud. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner get(String resourceGroupName, String privateCloudName, String clusterName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).toBlocking().single().body(); + } + + /** + * Get a cluster 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 clusterName Name of the cluster in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String privateCloudName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName), serviceCallback); + } + + /** + * Get a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner createOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).toBlocking().last().body(); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster), serviceCallback); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (cluster == null) { + throw new IllegalArgumentException("Parameter cluster is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(cluster); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).toBlocking().single().body(); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster), serviceCallback); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a cluster 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 clusterName Name of the cluster in the private cloud + * @param cluster A cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (cluster == null) { + throw new IllegalArgumentException("Parameter cluster is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(cluster); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, cluster, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).toBlocking().last().body(); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate), serviceCallback); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (clusterUpdate == null) { + throw new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(clusterUpdate); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, clusterUpdate, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginUpdate(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).toBlocking().single().body(); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate), serviceCallback); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a cluster 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 clusterName Name of the cluster in the private cloud + * @param clusterUpdate The cluster properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (clusterUpdate == null) { + throw new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(clusterUpdate); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, clusterUpdate, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateCloudName, String clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).toBlocking().last().body(); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateCloudName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName), serviceCallback); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateCloudName, String clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).toBlocking().single().body(); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateCloudName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName), serviceCallback); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a cluster 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 clusterName Name of the cluster in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, privateCloudName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List clusters in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List clusters in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List clusters in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List clusters in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List clusters in a private cloud. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ExpressRouteAuthorizationImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ExpressRouteAuthorizationImpl.java new file mode 100644 index 000000000000..12de0cb80c6d --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ExpressRouteAuthorizationImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.ExpressRouteAuthorization; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ExpressRouteAuthorizationProvisioningState; + +class ExpressRouteAuthorizationImpl extends CreatableUpdatableImpl implements ExpressRouteAuthorization, ExpressRouteAuthorization.Definition, ExpressRouteAuthorization.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String authorizationName; + + ExpressRouteAuthorizationImpl(String name, AVSManager manager) { + super(name, new ExpressRouteAuthorizationInner()); + this.manager = manager; + // Set resource name + this.authorizationName = name; + // + } + + ExpressRouteAuthorizationImpl(ExpressRouteAuthorizationInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.authorizationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.authorizationName = IdParsingUtils.getValueFromIdByName(inner.id(), "authorizations"); + // + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AuthorizationsInner client = this.manager().inner().authorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.authorizationName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AuthorizationsInner client = this.manager().inner().authorizations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.authorizationName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AuthorizationsInner client = this.manager().inner().authorizations(); + return client.getAsync(this.resourceGroupName, this.privateCloudName, this.authorizationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String expressRouteAuthorizationId() { + return this.inner().expressRouteAuthorizationId(); + } + + @Override + public String expressRouteAuthorizationKey() { + return this.inner().expressRouteAuthorizationKey(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ExpressRouteAuthorizationProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ExpressRouteAuthorizationImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ExpressRouteAuthorizationInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ExpressRouteAuthorizationInner.java new file mode 100644 index 000000000000..8f3333a2279c --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/ExpressRouteAuthorizationInner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.ExpressRouteAuthorizationProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * ExpressRoute Circuit Authorization. + */ +@JsonFlatten +public class ExpressRouteAuthorizationInner extends ProxyResource { + /** + * The state of the ExpressRoute Circuit Authorization provisioning. + * Possible values include: 'Succeeded', 'Failed', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteAuthorizationProvisioningState provisioningState; + + /** + * The ID of the ExpressRoute Circuit Authorization. + */ + @JsonProperty(value = "properties.expressRouteAuthorizationId", access = JsonProperty.Access.WRITE_ONLY) + private String expressRouteAuthorizationId; + + /** + * The key of the ExpressRoute Circuit Authorization. + */ + @JsonProperty(value = "properties.expressRouteAuthorizationKey", access = JsonProperty.Access.WRITE_ONLY) + private String expressRouteAuthorizationKey; + + /** + * Get the state of the ExpressRoute Circuit Authorization provisioning. Possible values include: 'Succeeded', 'Failed', 'Updating'. + * + * @return the provisioningState value + */ + public ExpressRouteAuthorizationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ID of the ExpressRoute Circuit Authorization. + * + * @return the expressRouteAuthorizationId value + */ + public String expressRouteAuthorizationId() { + return this.expressRouteAuthorizationId; + } + + /** + * Get the key of the ExpressRoute Circuit Authorization. + * + * @return the expressRouteAuthorizationKey value + */ + public String expressRouteAuthorizationKey() { + return this.expressRouteAuthorizationKey; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionImpl.java new file mode 100644 index 000000000000..7aead823846c --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionImpl.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnectionProvisioningState; +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnectionStatus; + +class GlobalReachConnectionImpl extends CreatableUpdatableImpl implements GlobalReachConnection, GlobalReachConnection.Definition, GlobalReachConnection.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String globalReachConnectionName; + + GlobalReachConnectionImpl(String name, AVSManager manager) { + super(name, new GlobalReachConnectionInner()); + this.manager = manager; + // Set resource name + this.globalReachConnectionName = name; + // + } + + GlobalReachConnectionImpl(GlobalReachConnectionInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.globalReachConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.globalReachConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "globalReachConnections"); + // + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + GlobalReachConnectionsInner client = this.manager().inner().globalReachConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.globalReachConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + GlobalReachConnectionsInner client = this.manager().inner().globalReachConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.globalReachConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + GlobalReachConnectionsInner client = this.manager().inner().globalReachConnections(); + return client.getAsync(this.resourceGroupName, this.privateCloudName, this.globalReachConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String addressPrefix() { + return this.inner().addressPrefix(); + } + + @Override + public String authorizationKey() { + return this.inner().authorizationKey(); + } + + @Override + public GlobalReachConnectionStatus circuitConnectionStatus() { + return this.inner().circuitConnectionStatus(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String peerExpressRouteCircuit() { + return this.inner().peerExpressRouteCircuit(); + } + + @Override + public GlobalReachConnectionProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public GlobalReachConnectionImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + @Override + public GlobalReachConnectionImpl withAuthorizationKey(String authorizationKey) { + this.inner().withAuthorizationKey(authorizationKey); + return this; + } + + @Override + public GlobalReachConnectionImpl withPeerExpressRouteCircuit(String peerExpressRouteCircuit) { + this.inner().withPeerExpressRouteCircuit(peerExpressRouteCircuit); + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionInner.java new file mode 100644 index 000000000000..1491c77ca482 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionInner.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnectionProvisioningState; +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnectionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A global reach connection resource. + */ +@JsonFlatten +public class GlobalReachConnectionInner extends ProxyResource { + /** + * The state of the ExpressRoute Circuit Authorization provisioning. + * Possible values include: 'Succeeded', 'Failed', 'Updating'. + */ + @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. Possible values + * include: 'Connected', 'Connecting', 'Disconnected'. + */ + @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 state of the ExpressRoute Circuit Authorization provisioning. Possible values include: 'Succeeded', 'Failed', 'Updating'. + * + * @return the provisioningState value + */ + public GlobalReachConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get 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 authorization key from the peer express route used for the global reach connection. + * + * @return the authorizationKey value + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set 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 connection status of the global reach connection. Possible values include: 'Connected', 'Connecting', 'Disconnected'. + * + * @return the circuitConnectionStatus value + */ + public GlobalReachConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get identifier of the ExpressRoute Circuit to peer with in the global reach connection. + * + * @return the peerExpressRouteCircuit value + */ + public String peerExpressRouteCircuit() { + return this.peerExpressRouteCircuit; + } + + /** + * Set 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; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionsImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionsImpl.java new file mode 100644 index 000000000000..f4c1a46af2d7 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnection; + +class GlobalReachConnectionsImpl extends WrapperImpl implements GlobalReachConnections { + private final AVSManager manager; + + GlobalReachConnectionsImpl(AVSManager manager) { + super(manager.inner().globalReachConnections()); + this.manager = manager; + } + + public AVSManager manager() { + return this.manager; + } + + @Override + public GlobalReachConnectionImpl define(String name) { + return wrapModel(name); + } + + private GlobalReachConnectionImpl wrapModel(GlobalReachConnectionInner inner) { + return new GlobalReachConnectionImpl(inner, manager()); + } + + private GlobalReachConnectionImpl wrapModel(String name) { + return new GlobalReachConnectionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String privateCloudName) { + GlobalReachConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public GlobalReachConnection call(GlobalReachConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + GlobalReachConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, privateCloudName, globalReachConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(GlobalReachConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((GlobalReachConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + GlobalReachConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).toCompletable(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionsInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionsInner.java new file mode 100644 index 000000000000..91a286358247 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/GlobalReachConnectionsInner.java @@ -0,0 +1,776 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in GlobalReachConnections. + */ +public class GlobalReachConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private GlobalReachConnectionsService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of GlobalReachConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GlobalReachConnectionsInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(GlobalReachConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for GlobalReachConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface GlobalReachConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("globalReachConnectionName") String globalReachConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("globalReachConnectionName") String globalReachConnectionName, @Body GlobalReachConnectionInner globalReachConnection, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("globalReachConnectionName") String globalReachConnectionName, @Body GlobalReachConnectionInner globalReachConnection, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("globalReachConnectionName") String globalReachConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("globalReachConnectionName") String globalReachConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.GlobalReachConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<GlobalReachConnectionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<GlobalReachConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateCloudName) { + return listWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<GlobalReachConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List global reach connections in a private cloud. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GlobalReachConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GlobalReachConnectionInner object if successful. + */ + public GlobalReachConnectionInner get(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable to the GlobalReachConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName).map(new Func1, GlobalReachConnectionInner>() { + @Override + public GlobalReachConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GlobalReachConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (globalReachConnectionName == null) { + throw new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GlobalReachConnectionInner object if successful. + */ + public GlobalReachConnectionInner createOrUpdate(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection).map(new Func1, GlobalReachConnectionInner>() { + @Override + public GlobalReachConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (globalReachConnectionName == null) { + throw new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null."); + } + if (globalReachConnection == null) { + throw new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(globalReachConnection); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GlobalReachConnectionInner object if successful. + */ + public GlobalReachConnectionInner beginCreateOrUpdate(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection), serviceCallback); + } + + /** + * 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 + * @return the observable to the GlobalReachConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection).map(new Func1, GlobalReachConnectionInner>() { + @Override + public GlobalReachConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the GlobalReachConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (globalReachConnectionName == null) { + throw new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null."); + } + if (globalReachConnection == null) { + throw new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(globalReachConnection); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (globalReachConnectionName == null) { + throw new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (globalReachConnectionName == null) { + throw new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List global reach connections in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<GlobalReachConnectionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List global reach connections in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List global reach connections in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GlobalReachConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List global reach connections in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GlobalReachConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List global reach connections in a private cloud. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GlobalReachConnectionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSiteImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSiteImpl.java new file mode 100644 index 000000000000..7a738cf2b586 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSiteImpl.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSite; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSiteStatus; + +class HcxEnterpriseSiteImpl extends CreatableUpdatableImpl implements HcxEnterpriseSite, HcxEnterpriseSite.Definition, HcxEnterpriseSite.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String hcxEnterpriseSiteName; + + HcxEnterpriseSiteImpl(String name, AVSManager manager) { + super(name, new HcxEnterpriseSiteInner()); + this.manager = manager; + // Set resource name + this.hcxEnterpriseSiteName = name; + // + } + + HcxEnterpriseSiteImpl(HcxEnterpriseSiteInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.hcxEnterpriseSiteName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.hcxEnterpriseSiteName = IdParsingUtils.getValueFromIdByName(inner.id(), "hcxEnterpriseSites"); + // + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + HcxEnterpriseSitesInner client = this.manager().inner().hcxEnterpriseSites(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.hcxEnterpriseSiteName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + HcxEnterpriseSitesInner client = this.manager().inner().hcxEnterpriseSites(); + return client.createOrUpdateAsync(this.resourceGroupName, this.privateCloudName, this.hcxEnterpriseSiteName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + HcxEnterpriseSitesInner client = this.manager().inner().hcxEnterpriseSites(); + return client.getAsync(this.resourceGroupName, this.privateCloudName, this.hcxEnterpriseSiteName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String activationKey() { + return this.inner().activationKey(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public HcxEnterpriseSiteStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public HcxEnterpriseSiteImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSiteInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSiteInner.java new file mode 100644 index 000000000000..048effd76f20 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSiteInner.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSiteStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An HCX Enterprise Site resource. + */ +@JsonFlatten +public class HcxEnterpriseSiteInner extends ProxyResource { + /** + * The activation key. + */ + @JsonProperty(value = "properties.activationKey", access = JsonProperty.Access.WRITE_ONLY) + private String activationKey; + + /** + * The status of the HCX Enterprise Site. Possible values include: + * 'Available', 'Consumed', 'Deactivated', 'Deleted'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private HcxEnterpriseSiteStatus status; + + /** + * Get the activation key. + * + * @return the activationKey value + */ + public String activationKey() { + return this.activationKey; + } + + /** + * Get the status of the HCX Enterprise Site. Possible values include: 'Available', 'Consumed', 'Deactivated', 'Deleted'. + * + * @return the status value + */ + public HcxEnterpriseSiteStatus status() { + return this.status; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSitesImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSitesImpl.java new file mode 100644 index 000000000000..8fa4b7269d87 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSitesImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSites; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSite; + +class HcxEnterpriseSitesImpl extends WrapperImpl implements HcxEnterpriseSites { + private final AVSManager manager; + + HcxEnterpriseSitesImpl(AVSManager manager) { + super(manager.inner().hcxEnterpriseSites()); + this.manager = manager; + } + + public AVSManager manager() { + return this.manager; + } + + @Override + public HcxEnterpriseSiteImpl define(String name) { + return wrapModel(name); + } + + private HcxEnterpriseSiteImpl wrapModel(HcxEnterpriseSiteInner inner) { + return new HcxEnterpriseSiteImpl(inner, manager()); + } + + private HcxEnterpriseSiteImpl wrapModel(String name) { + return new HcxEnterpriseSiteImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String privateCloudName) { + HcxEnterpriseSitesInner client = this.inner(); + return client.listAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public HcxEnterpriseSite call(HcxEnterpriseSiteInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + HcxEnterpriseSitesInner client = this.inner(); + return client.getAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName) + .flatMap(new Func1>() { + @Override + public Observable call(HcxEnterpriseSiteInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((HcxEnterpriseSite)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + HcxEnterpriseSitesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).toCompletable(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSitesInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSitesInner.java new file mode 100644 index 000000000000..614d5719eb42 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/HcxEnterpriseSitesInner.java @@ -0,0 +1,599 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HcxEnterpriseSites. + */ +public class HcxEnterpriseSitesInner { + /** The Retrofit service to perform REST calls. */ + private HcxEnterpriseSitesService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of HcxEnterpriseSitesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HcxEnterpriseSitesInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(HcxEnterpriseSitesService.class); + this.client = client; + } + + /** + * The interface defining all the services for HcxEnterpriseSites to be + * used by Retrofit to perform actually REST calls. + */ + interface HcxEnterpriseSitesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSites list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSites get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSites createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body HcxEnterpriseSiteInner hcxEnterpriseSite, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSites delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.HcxEnterpriseSites listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List HCX Enterprise Sites 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HcxEnterpriseSiteInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List HCX Enterprise Sites 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List HCX Enterprise Sites 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 + * @return the observable to the PagedList<HcxEnterpriseSiteInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateCloudName) { + return listWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List HCX Enterprise Sites 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 + * @return the observable to the PagedList<HcxEnterpriseSiteInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HcxEnterpriseSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HcxEnterpriseSiteInner object if successful. + */ + public HcxEnterpriseSiteInner get(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).toBlocking().single().body(); + } + + /** + * Get an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName), serviceCallback); + } + + /** + * Get an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HcxEnterpriseSiteInner object + */ + public Observable getAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return getWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).map(new Func1, HcxEnterpriseSiteInner>() { + @Override + public HcxEnterpriseSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HcxEnterpriseSiteInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (hcxEnterpriseSiteName == null) { + throw new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HcxEnterpriseSiteInner object if successful. + */ + public HcxEnterpriseSiteInner createOrUpdate(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).toBlocking().single().body(); + } + + /** + * Create or update an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName), serviceCallback); + } + + /** + * Create or update an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HcxEnterpriseSiteInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).map(new Func1, HcxEnterpriseSiteInner>() { + @Override + public HcxEnterpriseSiteInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HcxEnterpriseSiteInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (hcxEnterpriseSiteName == null) { + throw new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, this.client.apiVersion(), this.client.acceptLanguage(), hcxEnterpriseSite, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).toBlocking().single().body(); + } + + /** + * Delete an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName), serviceCallback); + } + + /** + * Delete an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an HCX Enterprise Site 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 hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (hcxEnterpriseSiteName == null) { + throw new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<HcxEnterpriseSiteInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HcxEnterpriseSiteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HcxEnterpriseSiteInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HcxEnterpriseSiteInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/IdParsingUtils.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..021410539915 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/LocationsImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/LocationsImpl.java new file mode 100644 index 000000000000..984dc89c26ea --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/LocationsImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Trial; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Quota; + +class LocationsImpl extends WrapperImpl implements Locations { + private final AVSManager manager; + + LocationsImpl(AVSManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable checkTrialAvailabilityAsync(String location) { + LocationsInner client = this.inner(); + return client.checkTrialAvailabilityAsync(location) + .map(new Func1() { + @Override + public Trial call(TrialInner inner) { + return new TrialImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkQuotaAvailabilityAsync(String location) { + LocationsInner client = this.inner(); + return client.checkQuotaAvailabilityAsync(location) + .map(new Func1() { + @Override + public Quota call(QuotaInner inner) { + return new QuotaImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/LocationsInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/LocationsInner.java new file mode 100644 index 000000000000..065640a99548 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/LocationsInner.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Locations checkTrialAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability") + Observable> checkTrialAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Locations checkQuotaAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability") + Observable> checkQuotaAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TrialInner object if successful. + */ + public TrialInner checkTrialAvailability(String location) { + return checkTrialAvailabilityWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkTrialAvailabilityAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkTrialAvailabilityWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrialInner object + */ + public Observable checkTrialAvailabilityAsync(String location) { + return checkTrialAvailabilityWithServiceResponseAsync(location).map(new Func1, TrialInner>() { + @Override + public TrialInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TrialInner object + */ + public Observable> checkTrialAvailabilityWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.checkTrialAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkTrialAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkTrialAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QuotaInner object if successful. + */ + public QuotaInner checkQuotaAvailability(String location) { + return checkQuotaAvailabilityWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkQuotaAvailabilityAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkQuotaAvailabilityWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QuotaInner object + */ + public Observable checkQuotaAvailabilityAsync(String location) { + return checkQuotaAvailabilityWithServiceResponseAsync(location).map(new Func1, QuotaInner>() { + @Override + public QuotaInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QuotaInner object + */ + public Observable> checkQuotaAvailabilityWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.checkQuotaAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkQuotaAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkQuotaAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..092bf6f03f4f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.OperationDisplay; +import com.microsoft.azure.management.avs.v2020_07_17_preview.OperationProperties; + +class OperationImpl extends WrapperImpl implements Operation { + private final AVSManager manager; + OperationImpl(OperationInner inner, AVSManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationProperties properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationInner.java new file mode 100644 index 000000000000..6f95d40e47d6 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.OperationDisplay; +import com.microsoft.azure.management.avs.v2020_07_17_preview.OperationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A REST API operation. + */ +public class OperationInner { + /** + * Name of the operation being performed on this object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Contains the localized display information for this operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Gets or sets a value indicating whether the operation is a data action + * or not. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get name of the operation being performed on this object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get contains the localized display information for this operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set gets or sets a value indicating whether the operation is a data action or not. + * + * @param isDataAction the isDataAction value to set + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get properties of the operation. + * + * @return the properties value + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set properties of the operation. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationsImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..259651d09c54 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final AVSManager manager; + + OperationsImpl(AVSManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationsInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..a038ac661a9f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Operations list" }) + @GET("providers/Microsoft.AVS/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PageImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..0238e0e4ea66 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudImpl.java new file mode 100644 index 000000000000..e61b2b268a41 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudImpl.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateCloud; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateCloudUpdate; +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Sku; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ManagementCluster; +import com.microsoft.azure.management.avs.v2020_07_17_preview.InternetEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.IdentitySource; +import com.microsoft.azure.management.avs.v2020_07_17_preview.VcsaAdminRotateEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.NsxtAdminRotateEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateCloudProvisioningState; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Circuit; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Endpoints; +import rx.functions.Func1; + +class PrivateCloudImpl extends GroupableResourceCoreImpl implements PrivateCloud, PrivateCloud.Definition, PrivateCloud.Update { + private PrivateCloudUpdate updateParameter; + PrivateCloudImpl(String name, PrivateCloudInner inner, AVSManager manager) { + super(name, inner, manager); + this.updateParameter = new PrivateCloudUpdate(); + } + + @Override + public Observable createResourceAsync() { + PrivateCloudsInner client = this.manager().inner().privateClouds(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public PrivateCloudInner call(PrivateCloudInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateCloudsInner client = this.manager().inner().privateClouds(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public PrivateCloudInner call(PrivateCloudInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateCloudsInner client = this.manager().inner().privateClouds(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new PrivateCloudUpdate(); + } + + @Override + public Circuit circuit() { + return this.inner().circuit(); + } + + @Override + public Endpoints endpoints() { + return this.inner().endpoints(); + } + + @Override + public List identitySources() { + return this.inner().identitySources(); + } + + @Override + public InternetEnum internet() { + return this.inner().internet(); + } + + @Override + public ManagementCluster managementCluster() { + return this.inner().managementCluster(); + } + + @Override + public String managementNetwork() { + return this.inner().managementNetwork(); + } + + @Override + public String networkBlock() { + return this.inner().networkBlock(); + } + + @Override + public String nsxtCertificateThumbprint() { + return this.inner().nsxtCertificateThumbprint(); + } + + @Override + public NsxtAdminRotateEnum nsxtPassword() { + return this.inner().nsxtPassword(); + } + + @Override + public String provisioningNetwork() { + return this.inner().provisioningNetwork(); + } + + @Override + public PrivateCloudProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String vcenterCertificateThumbprint() { + return this.inner().vcenterCertificateThumbprint(); + } + + @Override + public VcsaAdminRotateEnum vcenterPassword() { + return this.inner().vcenterPassword(); + } + + @Override + public String vmotionNetwork() { + return this.inner().vmotionNetwork(); + } + + @Override + public PrivateCloudImpl withNetworkBlock(String networkBlock) { + this.inner().withNetworkBlock(networkBlock); + return this; + } + + @Override + public PrivateCloudImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public PrivateCloudImpl withCircuit(Circuit circuit) { + this.inner().withCircuit(circuit); + return this; + } + + @Override + public PrivateCloudImpl withIdentitySources(List identitySources) { + if (isInCreateMode()) { + this.inner().withIdentitySources(identitySources); + } else { + this.updateParameter.withIdentitySources(identitySources); + } + return this; + } + + @Override + public PrivateCloudImpl withInternet(InternetEnum internet) { + if (isInCreateMode()) { + this.inner().withInternet(internet); + } else { + this.updateParameter.withInternet(internet); + } + return this; + } + + @Override + public PrivateCloudImpl withManagementCluster(ManagementCluster managementCluster) { + if (isInCreateMode()) { + this.inner().withManagementCluster(managementCluster); + } else { + this.updateParameter.withManagementCluster(managementCluster); + } + return this; + } + + @Override + public PrivateCloudImpl withNsxtPassword(NsxtAdminRotateEnum nsxtPassword) { + if (isInCreateMode()) { + this.inner().withNsxtPassword(nsxtPassword); + } else { + this.updateParameter.withNsxtPassword(nsxtPassword); + } + return this; + } + + @Override + public PrivateCloudImpl withVcenterPassword(VcsaAdminRotateEnum vcenterPassword) { + if (isInCreateMode()) { + this.inner().withVcenterPassword(vcenterPassword); + } else { + this.updateParameter.withVcenterPassword(vcenterPassword); + } + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudInner.java new file mode 100644 index 000000000000..130ee28ca824 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudInner.java @@ -0,0 +1,353 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.Sku; +import com.microsoft.azure.management.avs.v2020_07_17_preview.ManagementCluster; +import com.microsoft.azure.management.avs.v2020_07_17_preview.InternetEnum; +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.IdentitySource; +import com.microsoft.azure.management.avs.v2020_07_17_preview.VcsaAdminRotateEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.NsxtAdminRotateEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateCloudProvisioningState; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Circuit; +import com.microsoft.azure.management.avs.v2020_07_17_preview.Endpoints; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A private cloud resource. + */ +@JsonFlatten +@SkipParentValidation +public class PrivateCloudInner extends Resource { + /** + * The private cloud SKU. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The default cluster used for management. + */ + @JsonProperty(value = "properties.managementCluster") + private ManagementCluster managementCluster; + + /** + * Connectivity to internet is enabled or disabled. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.internet") + private InternetEnum internet; + + /** + * vCenter Single Sign On Identity Sources. + */ + @JsonProperty(value = "properties.identitySources") + private List identitySources; + + /** + * Indicate to rotate the vCenter admin password for the private cloud. + * Possible values include: 'OnetimeRotate'. + */ + @JsonProperty(value = "properties.vcenterPassword") + private VcsaAdminRotateEnum vcenterPassword; + + /** + * Indicate to rotate the NSX-T Manager password for the private cloud. + * Possible values include: 'OnetimeRotate'. + */ + @JsonProperty(value = "properties.nsxtPassword") + private NsxtAdminRotateEnum nsxtPassword; + + /** + * The provisioning state. Possible values include: 'Succeeded', 'Failed', + * 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateCloudProvisioningState provisioningState; + + /** + * An ExpressRoute Circuit. + */ + @JsonProperty(value = "properties.circuit") + private Circuit circuit; + + /** + * The endpoints. + */ + @JsonProperty(value = "properties.endpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints endpoints; + + /** + * 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. + */ + @JsonProperty(value = "properties.networkBlock", required = true) + private String networkBlock; + + /** + * Network used to access vCenter Server and NSX-T Manager. + */ + @JsonProperty(value = "properties.managementNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String managementNetwork; + + /** + * Used for virtual machine cold migration, cloning, and snapshot + * migration. + */ + @JsonProperty(value = "properties.provisioningNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningNetwork; + + /** + * Used for live migration of virtual machines. + */ + @JsonProperty(value = "properties.vmotionNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String vmotionNetwork; + + /** + * Thumbprint of the vCenter Server SSL certificate. + */ + @JsonProperty(value = "properties.vcenterCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterCertificateThumbprint; + + /** + * Thumbprint of the NSX-T Manager SSL certificate. + */ + @JsonProperty(value = "properties.nsxtCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtCertificateThumbprint; + + /** + * Get the private cloud SKU. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the private cloud SKU. + * + * @param sku the sku value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the default cluster used for management. + * + * @return the managementCluster value + */ + public ManagementCluster managementCluster() { + return this.managementCluster; + } + + /** + * Set the default cluster used for management. + * + * @param managementCluster the managementCluster value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withManagementCluster(ManagementCluster managementCluster) { + this.managementCluster = managementCluster; + return this; + } + + /** + * Get connectivity to internet is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @return the internet value + */ + public InternetEnum internet() { + return this.internet; + } + + /** + * Set connectivity to internet is enabled or disabled. Possible values include: 'Enabled', 'Disabled'. + * + * @param internet the internet value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withInternet(InternetEnum internet) { + this.internet = internet; + return this; + } + + /** + * Get vCenter Single Sign On Identity Sources. + * + * @return the identitySources value + */ + public List identitySources() { + return this.identitySources; + } + + /** + * Set vCenter Single Sign On Identity Sources. + * + * @param identitySources the identitySources value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withIdentitySources(List identitySources) { + this.identitySources = identitySources; + return this; + } + + /** + * Get indicate to rotate the vCenter admin password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @return the vcenterPassword value + */ + public VcsaAdminRotateEnum vcenterPassword() { + return this.vcenterPassword; + } + + /** + * Set indicate to rotate the vCenter admin password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @param vcenterPassword the vcenterPassword value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVcenterPassword(VcsaAdminRotateEnum vcenterPassword) { + this.vcenterPassword = vcenterPassword; + return this; + } + + /** + * Get indicate to rotate the NSX-T Manager password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @return the nsxtPassword value + */ + public NsxtAdminRotateEnum nsxtPassword() { + return this.nsxtPassword; + } + + /** + * Set indicate to rotate the NSX-T Manager password for the private cloud. Possible values include: 'OnetimeRotate'. + * + * @param nsxtPassword the nsxtPassword value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withNsxtPassword(NsxtAdminRotateEnum nsxtPassword) { + this.nsxtPassword = nsxtPassword; + return this; + } + + /** + * Get the provisioning state. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public PrivateCloudProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get an ExpressRoute Circuit. + * + * @return the circuit value + */ + public Circuit circuit() { + return this.circuit; + } + + /** + * Set an ExpressRoute Circuit. + * + * @param circuit the circuit value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withCircuit(Circuit circuit) { + this.circuit = circuit; + return this; + } + + /** + * Get the endpoints. + * + * @return the endpoints value + */ + public Endpoints endpoints() { + return this.endpoints; + } + + /** + * Get 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 networkBlock value + */ + public String networkBlock() { + return this.networkBlock; + } + + /** + * Set 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 networkBlock value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withNetworkBlock(String networkBlock) { + this.networkBlock = networkBlock; + return this; + } + + /** + * Get network used to access vCenter Server and NSX-T Manager. + * + * @return the managementNetwork value + */ + public String managementNetwork() { + return this.managementNetwork; + } + + /** + * Get used for virtual machine cold migration, cloning, and snapshot migration. + * + * @return the provisioningNetwork value + */ + public String provisioningNetwork() { + return this.provisioningNetwork; + } + + /** + * Get used for live migration of virtual machines. + * + * @return the vmotionNetwork value + */ + public String vmotionNetwork() { + return this.vmotionNetwork; + } + + /** + * Get thumbprint of the vCenter Server SSL certificate. + * + * @return the vcenterCertificateThumbprint value + */ + public String vcenterCertificateThumbprint() { + return this.vcenterCertificateThumbprint; + } + + /** + * Get thumbprint of the NSX-T Manager SSL certificate. + * + * @return the nsxtCertificateThumbprint value + */ + public String nsxtCertificateThumbprint() { + return this.nsxtCertificateThumbprint; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudsImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudsImpl.java new file mode 100644 index 000000000000..324aeed0ebcc --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudsImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateCloud; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.avs.v2020_07_17_preview.AdminCredentials; + +class PrivateCloudsImpl extends GroupableResourcesCoreImpl implements PrivateClouds { + protected PrivateCloudsImpl(AVSManager manager) { + super(manager.inner().privateClouds(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + PrivateCloudsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + PrivateCloudsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + PrivateCloudsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + PrivateCloudsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateCloud call(PrivateCloudInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + PrivateCloudsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + PrivateCloudsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateCloud call(PrivateCloudInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PrivateCloudImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listAdminCredentialsAsync(String resourceGroupName, String privateCloudName) { + PrivateCloudsInner client = this.inner(); + return client.listAdminCredentialsAsync(resourceGroupName, privateCloudName) + .map(new Func1() { + @Override + public AdminCredentials call(AdminCredentialsInner inner) { + return new AdminCredentialsImpl(inner, manager()); + } + }); + } + + @Override + protected PrivateCloudImpl wrapModel(PrivateCloudInner inner) { + return new PrivateCloudImpl(inner.name(), inner, manager()); + } + + @Override + protected PrivateCloudImpl wrapModel(String name) { + return new PrivateCloudImpl(name, new PrivateCloudInner(), this.manager()); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudsInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudsInner.java new file mode 100644 index 000000000000..e9fd524650b9 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/PrivateCloudsInner.java @@ -0,0 +1,1235 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateCloudUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateClouds. + */ +public class PrivateCloudsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private PrivateCloudsService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of PrivateCloudsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateCloudsInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(PrivateCloudsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateClouds to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateCloudsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Body PrivateCloudInner privateCloud, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Body PrivateCloudInner privateCloud, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Body PrivateCloudUpdate privateCloudUpdate, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Body PrivateCloudUpdate privateCloudUpdate, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds listAdminCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials") + Observable> listAdminCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.PrivateClouds listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateCloudInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List private clouds in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateCloudInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List private clouds in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateCloudInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List private clouds in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List private clouds in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private clouds in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List private clouds in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateCloudInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateCloudInner object if successful. + */ + public PrivateCloudInner getByResourceGroup(String resourceGroupName, String privateCloudName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateCloudName).toBlocking().single().body(); + } + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateCloudName), serviceCallback); + } + + /** + * Get 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 + * @return the observable to the PrivateCloudInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String privateCloudName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateCloudName).map(new Func1, PrivateCloudInner>() { + @Override + public PrivateCloudInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 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 + * @return the observable to the PrivateCloudInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateCloudInner object if successful. + */ + public PrivateCloudInner createOrUpdate(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloud).toBlocking().last().body(); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloud), serviceCallback); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloud).map(new Func1, PrivateCloudInner>() { + @Override + public PrivateCloudInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (privateCloud == null) { + throw new IllegalArgumentException("Parameter privateCloud is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(privateCloud); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, privateCloud, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateCloudInner object if successful. + */ + public PrivateCloudInner beginCreateOrUpdate(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloud).toBlocking().single().body(); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloud), serviceCallback); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateCloudInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloud).map(new Func1, PrivateCloudInner>() { + @Override + public PrivateCloudInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloud The private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateCloudInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (privateCloud == null) { + throw new IllegalArgumentException("Parameter privateCloud is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(privateCloud); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, privateCloud, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateCloudInner object if successful. + */ + public PrivateCloudInner update(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate).toBlocking().last().body(); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate), serviceCallback); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + return updateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate).map(new Func1, PrivateCloudInner>() { + @Override + public PrivateCloudInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (privateCloudUpdate == null) { + throw new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(privateCloudUpdate); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, privateCloudName, privateCloudUpdate, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateCloudInner object if successful. + */ + public PrivateCloudInner beginUpdate(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate).toBlocking().single().body(); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate), serviceCallback); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateCloudInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate).map(new Func1, PrivateCloudInner>() { + @Override + public PrivateCloudInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param privateCloudUpdate The private cloud properties to be updated + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateCloudInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (privateCloudUpdate == null) { + throw new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(privateCloudUpdate); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, privateCloudName, privateCloudUpdate, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String privateCloudName) { + deleteWithServiceResponseAsync(resourceGroupName, privateCloudName).toBlocking().last().body(); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, privateCloudName), serviceCallback); + } + + /** + * Delete 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String privateCloudName) { + return deleteWithServiceResponseAsync(resourceGroupName, privateCloudName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateCloudName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName).toBlocking().single().body(); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName), serviceCallback); + } + + /** + * Delete 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateCloudName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateCloudName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List the admin credentials for the 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AdminCredentialsInner object if successful. + */ + public AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName) { + return listAdminCredentialsWithServiceResponseAsync(resourceGroupName, privateCloudName).toBlocking().single().body(); + } + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAdminCredentialsAsync(String resourceGroupName, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listAdminCredentialsWithServiceResponseAsync(resourceGroupName, privateCloudName), serviceCallback); + } + + /** + * List the admin credentials for the 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 + * @return the observable to the AdminCredentialsInner object + */ + public Observable listAdminCredentialsAsync(String resourceGroupName, String privateCloudName) { + return listAdminCredentialsWithServiceResponseAsync(resourceGroupName, privateCloudName).map(new Func1, AdminCredentialsInner>() { + @Override + public AdminCredentialsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List the admin credentials for the 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 + * @return the observable to the AdminCredentialsInner object + */ + public Observable> listAdminCredentialsWithServiceResponseAsync(String resourceGroupName, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listAdminCredentials(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listAdminCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listAdminCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List private clouds in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateCloudInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List private clouds in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List private clouds in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private clouds in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List private clouds in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateCloudInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List private clouds in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateCloudInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List private clouds in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List private clouds in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List private clouds in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateCloudInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List private clouds in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateCloudInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/QuotaImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/QuotaImpl.java new file mode 100644 index 000000000000..b2ea7c3af17f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/QuotaImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.Quota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; +import com.microsoft.azure.management.avs.v2020_07_17_preview.QuotaEnabled; + +class QuotaImpl extends WrapperImpl implements Quota { + private final AVSManager manager; + QuotaImpl(QuotaInner inner, AVSManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Map hostsRemaining() { + return this.inner().hostsRemaining(); + } + + @Override + public QuotaEnabled quotaEnabled() { + return this.inner().quotaEnabled(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/QuotaInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/QuotaInner.java new file mode 100644 index 000000000000..0935a89bfc88 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/QuotaInner.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.avs.v2020_07_17_preview.QuotaEnabled; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Subscription quotas. + */ +public class QuotaInner { + /** + * Remaining hosts quota by sku type. + */ + @JsonProperty(value = "hostsRemaining", access = JsonProperty.Access.WRITE_ONLY) + private Map hostsRemaining; + + /** + * Host quota is active for current subscription. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "quotaEnabled", access = JsonProperty.Access.WRITE_ONLY) + private QuotaEnabled quotaEnabled; + + /** + * Get remaining hosts quota by sku type. + * + * @return the hostsRemaining value + */ + public Map hostsRemaining() { + return this.hostsRemaining; + } + + /** + * Get host quota is active for current subscription. Possible values include: 'Enabled', 'Disabled'. + * + * @return the quotaEnabled value + */ + public QuotaEnabled quotaEnabled() { + return this.quotaEnabled; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/TrialImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/TrialImpl.java new file mode 100644 index 000000000000..c7b7f92d6b40 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/TrialImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.Trial; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.TrialStatus; + +class TrialImpl extends WrapperImpl implements Trial { + private final AVSManager manager; + TrialImpl(TrialInner inner, AVSManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Integer availableHosts() { + return this.inner().availableHosts(); + } + + @Override + public TrialStatus status() { + return this.inner().status(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/TrialInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/TrialInner.java new file mode 100644 index 000000000000..72384e512169 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/TrialInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.TrialStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Subscription trial availability. + */ +public class TrialInner { + /** + * Trial status. Possible values include: 'TrialAvailable', 'TrialUsed', + * 'TrialDisabled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private TrialStatus status; + + /** + * Number of trial hosts available. + */ + @JsonProperty(value = "availableHosts", access = JsonProperty.Access.WRITE_ONLY) + private Integer availableHosts; + + /** + * Get trial status. Possible values include: 'TrialAvailable', 'TrialUsed', 'TrialDisabled'. + * + * @return the status value + */ + public TrialStatus status() { + return this.status; + } + + /** + * Get number of trial hosts available. + * + * @return the availableHosts value + */ + public Integer availableHosts() { + return this.availableHosts; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkDhcpImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkDhcpImpl.java new file mode 100644 index 000000000000..e7861887647e --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkDhcpImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkDhcp; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkDhcpProvisioningState; + +class WorkloadNetworkDhcpImpl extends CreatableUpdatableImpl implements WorkloadNetworkDhcp, WorkloadNetworkDhcp.Definition, WorkloadNetworkDhcp.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String dhcpId; + + WorkloadNetworkDhcpImpl(String name, AVSManager manager) { + super(name, new WorkloadNetworkDhcpInner()); + this.manager = manager; + // Set resource name + this.dhcpId = name; + // + } + + WorkloadNetworkDhcpImpl(WorkloadNetworkDhcpInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dhcpId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.dhcpId = IdParsingUtils.getValueFromIdByName(inner.id(), "dhcpConfigurations"); + // + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.createDhcpAsync(this.resourceGroupName, this.privateCloudName, this.dhcpId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.updateDhcpAsync(this.resourceGroupName, this.privateCloudName, this.dhcpId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public WorkloadNetworkDhcpProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Long revision() { + return this.inner().revision(); + } + + @Override + public List segments() { + return this.inner().segments(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WorkloadNetworkDhcpImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + @Override + public WorkloadNetworkDhcpImpl withDisplayName(String displayName) { + this.inner().withDisplayName(displayName); + return this; + } + + @Override + public WorkloadNetworkDhcpImpl withRevision(Long revision) { + this.inner().withRevision(revision); + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkDhcpInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkDhcpInner.java new file mode 100644 index 000000000000..3ea6c7167ca6 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkDhcpInner.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkDhcpProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * NSX DHCP. + */ +@JsonFlatten +public class WorkloadNetworkDhcpInner extends ProxyResource { + /** + * Display name of the DHCP entity. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * NSX Segments consuming DHCP. + */ + @JsonProperty(value = "properties.segments", access = JsonProperty.Access.WRITE_ONLY) + private List segments; + + /** + * The provisioning state. Possible values include: 'Succeeded', 'Failed', + * 'Building', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDhcpProvisioningState provisioningState; + + /** + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get display name of the DHCP entity. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of the DHCP entity. + * + * @param displayName the displayName value to set + * @return the WorkloadNetworkDhcpInner object itself. + */ + public WorkloadNetworkDhcpInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get nSX Segments consuming DHCP. + * + * @return the segments value + */ + public List segments() { + return this.segments; + } + + /** + * Get the provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public WorkloadNetworkDhcpProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get nSX revision number. + * + * @return the revision value + */ + public Long revision() { + return this.revision; + } + + /** + * Set nSX revision number. + * + * @param revision the revision value to set + * @return the WorkloadNetworkDhcpInner object itself. + */ + public WorkloadNetworkDhcpInner withRevision(Long revision) { + this.revision = revision; + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkGatewayImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkGatewayImpl.java new file mode 100644 index 000000000000..4b5faf163c42 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkGatewayImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkGateway; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class WorkloadNetworkGatewayImpl extends WrapperImpl implements WorkloadNetworkGateway { + private final AVSManager manager; + WorkloadNetworkGatewayImpl(WorkloadNetworkGatewayInner inner, AVSManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String path() { + return this.inner().path(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkGatewayInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkGatewayInner.java new file mode 100644 index 000000000000..388b74449670 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkGatewayInner.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * NSX Gateway. + */ +@JsonFlatten +public class WorkloadNetworkGatewayInner extends ProxyResource { + /** + * 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 display name of the DHCP entity. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 nSX Gateway Path. + * + * @return the path value + */ + public String path() { + return this.path; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkPortMirroringImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkPortMirroringImpl.java new file mode 100644 index 000000000000..79e17192efe6 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkPortMirroringImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkPortMirroring; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PortMirroringDirectionEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PortMirroringStatusEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkPortMirroringProvisioningState; + +class WorkloadNetworkPortMirroringImpl extends CreatableUpdatableImpl implements WorkloadNetworkPortMirroring, WorkloadNetworkPortMirroring.Definition, WorkloadNetworkPortMirroring.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String portMirroringId; + + WorkloadNetworkPortMirroringImpl(String name, AVSManager manager) { + super(name, new WorkloadNetworkPortMirroringInner()); + this.manager = manager; + // Set resource name + this.portMirroringId = name; + // + } + + WorkloadNetworkPortMirroringImpl(WorkloadNetworkPortMirroringInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.portMirroringId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.portMirroringId = IdParsingUtils.getValueFromIdByName(inner.id(), "portMirroringProfiles"); + // + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.createPortMirroringAsync(this.resourceGroupName, this.privateCloudName, this.portMirroringId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.updatePortMirroringAsync(this.resourceGroupName, this.privateCloudName, this.portMirroringId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String destination() { + return this.inner().destination(); + } + + @Override + public PortMirroringDirectionEnum direction() { + return this.inner().direction(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public WorkloadNetworkPortMirroringProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Long revision() { + return this.inner().revision(); + } + + @Override + public String source() { + return this.inner().source(); + } + + @Override + public PortMirroringStatusEnum status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WorkloadNetworkPortMirroringImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + @Override + public WorkloadNetworkPortMirroringImpl withDestination(String destination) { + this.inner().withDestination(destination); + return this; + } + + @Override + public WorkloadNetworkPortMirroringImpl withDirection(PortMirroringDirectionEnum direction) { + this.inner().withDirection(direction); + return this; + } + + @Override + public WorkloadNetworkPortMirroringImpl withDisplayName(String displayName) { + this.inner().withDisplayName(displayName); + return this; + } + + @Override + public WorkloadNetworkPortMirroringImpl withRevision(Long revision) { + this.inner().withRevision(revision); + return this; + } + + @Override + public WorkloadNetworkPortMirroringImpl withSource(String source) { + this.inner().withSource(source); + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkPortMirroringInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkPortMirroringInner.java new file mode 100644 index 000000000000..9cfb7e03a38f --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkPortMirroringInner.java @@ -0,0 +1,185 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.PortMirroringDirectionEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.PortMirroringStatusEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkPortMirroringProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * NSX Port Mirroring. + */ +@JsonFlatten +public class WorkloadNetworkPortMirroringInner extends ProxyResource { + /** + * Display name of the port mirroring profile. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Direction of port mirroring profile. Possible values include: 'INGRESS, + * EGRESS, BIDIRECTIONAL'. + */ + @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. Possible values include: 'SUCCESS, FAILURE'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private PortMirroringStatusEnum status; + + /** + * The provisioning state. Possible values include: 'Succeeded', 'Failed', + * 'Building', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkPortMirroringProvisioningState provisioningState; + + /** + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get display name of the port mirroring profile. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 direction of port mirroring profile. Possible values include: 'INGRESS, EGRESS, BIDIRECTIONAL'. + * + * @return the direction value + */ + public PortMirroringDirectionEnum direction() { + return this.direction; + } + + /** + * Set direction of port mirroring profile. Possible values include: 'INGRESS, EGRESS, BIDIRECTIONAL'. + * + * @param direction the direction value to set + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withDirection(PortMirroringDirectionEnum direction) { + this.direction = direction; + return this; + } + + /** + * Get source VM Group. + * + * @return the source value + */ + public String source() { + return this.source; + } + + /** + * Set 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 destination VM Group. + * + * @return the destination value + */ + public String destination() { + return this.destination; + } + + /** + * Set 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 port Mirroring Status. Possible values include: 'SUCCESS, FAILURE'. + * + * @return the status value + */ + public PortMirroringStatusEnum status() { + return this.status; + } + + /** + * Get the provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public WorkloadNetworkPortMirroringProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get nSX revision number. + * + * @return the revision value + */ + public Long revision() { + return this.revision; + } + + /** + * Set 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; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkSegmentImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkSegmentImpl.java new file mode 100644 index 000000000000..d211a5e94d2c --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkSegmentImpl.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegment; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegmentSubnet; +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegmentPortVif; +import com.microsoft.azure.management.avs.v2020_07_17_preview.SegmentStatusEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegmentProvisioningState; + +class WorkloadNetworkSegmentImpl extends CreatableUpdatableImpl implements WorkloadNetworkSegment, WorkloadNetworkSegment.Definition, WorkloadNetworkSegment.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String segmentId; + + WorkloadNetworkSegmentImpl(String name, AVSManager manager) { + super(name, new WorkloadNetworkSegmentInner()); + this.manager = manager; + // Set resource name + this.segmentId = name; + // + } + + WorkloadNetworkSegmentImpl(WorkloadNetworkSegmentInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.segmentId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.segmentId = IdParsingUtils.getValueFromIdByName(inner.id(), "segments"); + // + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.createSegmentsAsync(this.resourceGroupName, this.privateCloudName, this.segmentId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.updateSegmentsAsync(this.resourceGroupName, this.privateCloudName, this.segmentId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String connectedGateway() { + return this.inner().connectedGateway(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List portVif() { + return this.inner().portVif(); + } + + @Override + public WorkloadNetworkSegmentProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Long revision() { + return this.inner().revision(); + } + + @Override + public SegmentStatusEnum status() { + return this.inner().status(); + } + + @Override + public WorkloadNetworkSegmentSubnet subnet() { + return this.inner().subnet(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WorkloadNetworkSegmentImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + @Override + public WorkloadNetworkSegmentImpl withConnectedGateway(String connectedGateway) { + this.inner().withConnectedGateway(connectedGateway); + return this; + } + + @Override + public WorkloadNetworkSegmentImpl withDisplayName(String displayName) { + this.inner().withDisplayName(displayName); + return this; + } + + @Override + public WorkloadNetworkSegmentImpl withRevision(Long revision) { + this.inner().withRevision(revision); + return this; + } + + @Override + public WorkloadNetworkSegmentImpl withSubnet(WorkloadNetworkSegmentSubnet subnet) { + this.inner().withSubnet(subnet); + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkSegmentInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkSegmentInner.java new file mode 100644 index 000000000000..fc958fbc482e --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkSegmentInner.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegmentSubnet; +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegmentPortVif; +import com.microsoft.azure.management.avs.v2020_07_17_preview.SegmentStatusEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegmentProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * NSX Segment. + */ +@JsonFlatten +public class WorkloadNetworkSegmentInner extends ProxyResource { + /** + * 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. Possible values include: 'SUCCESS, FAILURE'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private SegmentStatusEnum status; + + /** + * The provisioning state. Possible values include: 'Succeeded', 'Failed', + * 'Building', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkSegmentProvisioningState provisioningState; + + /** + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get display name of the segment. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 gateway which to connect segment to. + * + * @return the connectedGateway value + */ + public String connectedGateway() { + return this.connectedGateway; + } + + /** + * Set 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 subnet which to connect segment to. + * + * @return the subnet value + */ + public WorkloadNetworkSegmentSubnet subnet() { + return this.subnet; + } + + /** + * Set 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 port Vif which segment is associated with. + * + * @return the portVif value + */ + public List portVif() { + return this.portVif; + } + + /** + * Get segment status. Possible values include: 'SUCCESS, FAILURE'. + * + * @return the status value + */ + public SegmentStatusEnum status() { + return this.status; + } + + /** + * Get the provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public WorkloadNetworkSegmentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get nSX revision number. + * + * @return the revision value + */ + public Long revision() { + return this.revision; + } + + /** + * Set 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; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVMGroupImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVMGroupImpl.java new file mode 100644 index 000000000000..6aae6682de73 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVMGroupImpl.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkVMGroup; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.VMGroupStatusEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkVMGroupProvisioningState; + +class WorkloadNetworkVMGroupImpl extends CreatableUpdatableImpl implements WorkloadNetworkVMGroup, WorkloadNetworkVMGroup.Definition, WorkloadNetworkVMGroup.Update { + private final AVSManager manager; + private String resourceGroupName; + private String privateCloudName; + private String vmGroupId; + + WorkloadNetworkVMGroupImpl(String name, AVSManager manager) { + super(name, new WorkloadNetworkVMGroupInner()); + this.manager = manager; + // Set resource name + this.vmGroupId = name; + // + } + + WorkloadNetworkVMGroupImpl(WorkloadNetworkVMGroupInner inner, AVSManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.vmGroupId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.privateCloudName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.vmGroupId = IdParsingUtils.getValueFromIdByName(inner.id(), "vmGroups"); + // + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.createVMGroupAsync(this.resourceGroupName, this.privateCloudName, this.vmGroupId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return client.updateVMGroupAsync(this.resourceGroupName, this.privateCloudName, this.vmGroupId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkloadNetworksInner client = this.manager().inner().workloadNetworks(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List members() { + return this.inner().members(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public WorkloadNetworkVMGroupProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Long revision() { + return this.inner().revision(); + } + + @Override + public VMGroupStatusEnum status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WorkloadNetworkVMGroupImpl withExistingWorkloadNetwork(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + @Override + public WorkloadNetworkVMGroupImpl withDisplayName(String displayName) { + this.inner().withDisplayName(displayName); + return this; + } + + @Override + public WorkloadNetworkVMGroupImpl withMembers(List members) { + this.inner().withMembers(members); + return this; + } + + @Override + public WorkloadNetworkVMGroupImpl withRevision(Long revision) { + this.inner().withRevision(revision); + return this; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVMGroupInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVMGroupInner.java new file mode 100644 index 000000000000..0c94f7cc1fa4 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVMGroupInner.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.avs.v2020_07_17_preview.VMGroupStatusEnum; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkVMGroupProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * NSX VM Group. + */ +@JsonFlatten +public class WorkloadNetworkVMGroupInner extends ProxyResource { + /** + * 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. Possible values include: 'SUCCESS, FAILURE'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private VMGroupStatusEnum status; + + /** + * The provisioning state. Possible values include: 'Succeeded', 'Failed', + * 'Building', 'Deleting', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkVMGroupProvisioningState provisioningState; + + /** + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get display name of the VM group. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 virtual machine members of this group. + * + * @return the members value + */ + public List members() { + return this.members; + } + + /** + * Set 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 vM Group status. Possible values include: 'SUCCESS, FAILURE'. + * + * @return the status value + */ + public VMGroupStatusEnum status() { + return this.status; + } + + /** + * Get the provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating'. + * + * @return the provisioningState value + */ + public WorkloadNetworkVMGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get nSX revision number. + * + * @return the revision value + */ + public Long revision() { + return this.revision; + } + + /** + * Set 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; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVirtualMachineImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVirtualMachineImpl.java new file mode 100644 index 000000000000..f50f00dd777d --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVirtualMachineImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkVirtualMachine; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.VMTypeEnum; + +class WorkloadNetworkVirtualMachineImpl extends WrapperImpl implements WorkloadNetworkVirtualMachine { + private final AVSManager manager; + WorkloadNetworkVirtualMachineImpl(WorkloadNetworkVirtualMachineInner inner, AVSManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AVSManager manager() { + return this.manager; + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VMTypeEnum vmType() { + return this.inner().vmType(); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVirtualMachineInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVirtualMachineInner.java new file mode 100644 index 000000000000..ca472ab30292 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworkVirtualMachineInner.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.management.avs.v2020_07_17_preview.VMTypeEnum; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * NSX Virtual Machine. + */ +@JsonFlatten +public class WorkloadNetworkVirtualMachineInner extends ProxyResource { + /** + * Display name of the VM. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Virtual machine type. Possible values include: 'REGULAR, EDGE, SERVICE'. + */ + @JsonProperty(value = "properties.vmType", access = JsonProperty.Access.WRITE_ONLY) + private VMTypeEnum vmType; + + /** + * Get display name of the VM. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set 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 virtual machine type. Possible values include: 'REGULAR, EDGE, SERVICE'. + * + * @return the vmType value + */ + public VMTypeEnum vmType() { + return this.vmType; + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworksImpl.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworksImpl.java new file mode 100644 index 000000000000..6608964e7e45 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworksImpl.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkSegment; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkDhcp; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkGateway; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkPortMirroring; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkVMGroup; +import com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworkVirtualMachine; + +class WorkloadNetworksImpl extends WrapperImpl implements WorkloadNetworks { + private final AVSManager manager; + + WorkloadNetworksImpl(AVSManager manager) { + super(manager.inner().workloadNetworks()); + this.manager = manager; + } + + public AVSManager manager() { + return this.manager; + } + + @Override + public WorkloadNetworkSegmentImpl defineSegment(String name) { + return wrapSegmentModel(name); + } + + @Override + public WorkloadNetworkDhcpImpl defineDhcpConfiguration(String name) { + return wrapDhcpConfigurationModel(name); + } + + @Override + public WorkloadNetworkPortMirroringImpl definePortMirroringProfile(String name) { + return wrapPortMirroringProfileModel(name); + } + + @Override + public WorkloadNetworkVMGroupImpl defineVmGroup(String name) { + return wrapVmGroupModel(name); + } + + private WorkloadNetworkSegmentImpl wrapSegmentModel(String name) { + return new WorkloadNetworkSegmentImpl(name, this.manager()); + } + + private WorkloadNetworkDhcpImpl wrapDhcpConfigurationModel(String name) { + return new WorkloadNetworkDhcpImpl(name, this.manager()); + } + + private WorkloadNetworkPortMirroringImpl wrapPortMirroringProfileModel(String name) { + return new WorkloadNetworkPortMirroringImpl(name, this.manager()); + } + + private WorkloadNetworkVMGroupImpl wrapVmGroupModel(String name) { + return new WorkloadNetworkVMGroupImpl(name, this.manager()); + } + + private WorkloadNetworkSegmentImpl wrapWorkloadNetworkSegmentModel(WorkloadNetworkSegmentInner inner) { + return new WorkloadNetworkSegmentImpl(inner, manager()); + } + + private WorkloadNetworkDhcpImpl wrapWorkloadNetworkDhcpModel(WorkloadNetworkDhcpInner inner) { + return new WorkloadNetworkDhcpImpl(inner, manager()); + } + + private WorkloadNetworkPortMirroringImpl wrapWorkloadNetworkPortMirroringModel(WorkloadNetworkPortMirroringInner inner) { + return new WorkloadNetworkPortMirroringImpl(inner, manager()); + } + + private WorkloadNetworkVMGroupImpl wrapWorkloadNetworkVMGroupModel(WorkloadNetworkVMGroupInner inner) { + return new WorkloadNetworkVMGroupImpl(inner, manager()); + } + + @Override + public Observable listSegmentsAsync(final String resourceGroupName, final String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.listSegmentsAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadNetworkSegment call(WorkloadNetworkSegmentInner inner) { + return new WorkloadNetworkSegmentImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { + WorkloadNetworksInner client = this.inner(); + return client.getSegmentAsync(resourceGroupName, privateCloudName, segmentId) + .map(new Func1() { + @Override + public WorkloadNetworkSegment call(WorkloadNetworkSegmentInner inner) { + return new WorkloadNetworkSegmentImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { + WorkloadNetworksInner client = this.inner(); + return client.deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).toCompletable(); + } + + @Override + public Observable listDhcpAsync(final String resourceGroupName, final String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.listDhcpAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadNetworkDhcp call(WorkloadNetworkDhcpInner inner) { + return new WorkloadNetworkDhcpImpl(inner, manager()); + } + }); + } + + @Override + public Observable getDhcpAsync(String resourceGroupName, String dhcpId, String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.getDhcpAsync(resourceGroupName, dhcpId, privateCloudName) + .map(new Func1() { + @Override + public WorkloadNetworkDhcp call(WorkloadNetworkDhcpInner inner) { + return new WorkloadNetworkDhcpImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + WorkloadNetworksInner client = this.inner(); + return client.deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).toCompletable(); + } + + @Override + public Observable listGatewaysAsync(final String resourceGroupName, final String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.listGatewaysAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadNetworkGateway call(WorkloadNetworkGatewayInner inner) { + return new WorkloadNetworkGatewayImpl(inner, manager()); + } + }); + } + + @Override + public Observable getGatewayAsync(String resourceGroupName, String privateCloudName, String gatewayId) { + WorkloadNetworksInner client = this.inner(); + return client.getGatewayAsync(resourceGroupName, privateCloudName, gatewayId) + .map(new Func1() { + @Override + public WorkloadNetworkGateway call(WorkloadNetworkGatewayInner inner) { + return new WorkloadNetworkGatewayImpl(inner, manager()); + } + }); + } + + @Override + public Observable listPortMirroringAsync(final String resourceGroupName, final String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.listPortMirroringAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadNetworkPortMirroring call(WorkloadNetworkPortMirroringInner inner) { + return new WorkloadNetworkPortMirroringImpl(inner, manager()); + } + }); + } + + @Override + public Observable getPortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId) { + WorkloadNetworksInner client = this.inner(); + return client.getPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId) + .map(new Func1() { + @Override + public WorkloadNetworkPortMirroring call(WorkloadNetworkPortMirroringInner inner) { + return new WorkloadNetworkPortMirroringImpl(inner, manager()); + } + }); + } + + @Override + public Completable deletePortMirroringAsync(String resourceGroupName, String portMirroringId, String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).toCompletable(); + } + + @Override + public Observable listVMGroupsAsync(final String resourceGroupName, final String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.listVMGroupsAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadNetworkVMGroup call(WorkloadNetworkVMGroupInner inner) { + return new WorkloadNetworkVMGroupImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId) { + WorkloadNetworksInner client = this.inner(); + return client.getVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId) + .map(new Func1() { + @Override + public WorkloadNetworkVMGroup call(WorkloadNetworkVMGroupInner inner) { + return new WorkloadNetworkVMGroupImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).toCompletable(); + } + + @Override + public Observable listVirtualMachinesAsync(final String resourceGroupName, final String privateCloudName) { + WorkloadNetworksInner client = this.inner(); + return client.listVirtualMachinesAsync(resourceGroupName, privateCloudName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadNetworkVirtualMachine call(WorkloadNetworkVirtualMachineInner inner) { + return new WorkloadNetworkVirtualMachineImpl(inner, manager()); + } + }); + } + + @Override + public Observable getVirtualMachineAsync(String resourceGroupName, String privateCloudName, String virtualMachineId) { + WorkloadNetworksInner client = this.inner(); + return client.getVirtualMachineAsync(resourceGroupName, privateCloudName, virtualMachineId) + .map(new Func1() { + @Override + public WorkloadNetworkVirtualMachine call(WorkloadNetworkVirtualMachineInner inner) { + return new WorkloadNetworkVirtualMachineImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworksInner.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworksInner.java new file mode 100644 index 000000000000..d7d1edc19728 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/WorkloadNetworksInner.java @@ -0,0 +1,4361 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in WorkloadNetworks. + */ +public class WorkloadNetworksInner { + /** The Retrofit service to perform REST calls. */ + private WorkloadNetworksService service; + /** The service client containing this operation class. */ + private AvsClientImpl client; + + /** + * Initializes an instance of WorkloadNetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkloadNetworksInner(Retrofit retrofit, AvsClientImpl client) { + this.service = retrofit.create(WorkloadNetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadNetworks to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkloadNetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listSegments" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments") + Observable> listSegments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks getSegment" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + Observable> getSegment(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("segmentId") String segmentId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks createSegments" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + Observable> createSegments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("segmentId") String segmentId, @Query("api-version") String apiVersion, @Body WorkloadNetworkSegmentInner workloadNetworkSegment, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginCreateSegments" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + Observable> beginCreateSegments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("segmentId") String segmentId, @Query("api-version") String apiVersion, @Body WorkloadNetworkSegmentInner workloadNetworkSegment, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks updateSegments" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + Observable> updateSegments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("segmentId") String segmentId, @Query("api-version") String apiVersion, @Body WorkloadNetworkSegmentInner workloadNetworkSegment, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginUpdateSegments" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + Observable> beginUpdateSegments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("segmentId") String segmentId, @Query("api-version") String apiVersion, @Body WorkloadNetworkSegmentInner workloadNetworkSegment, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks deleteSegment" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", method = "DELETE", hasBody = true) + Observable> deleteSegment(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("segmentId") String segmentId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginDeleteSegment" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", method = "DELETE", hasBody = true) + Observable> beginDeleteSegment(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("segmentId") String segmentId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listDhcp" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations") + Observable> listDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks getDhcp" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + Observable> getDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dhcpId") String dhcpId, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks createDhcp" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + Observable> createDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("dhcpId") String dhcpId, @Query("api-version") String apiVersion, @Body WorkloadNetworkDhcpInner workloadNetworkDhcp, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginCreateDhcp" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + Observable> beginCreateDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("dhcpId") String dhcpId, @Query("api-version") String apiVersion, @Body WorkloadNetworkDhcpInner workloadNetworkDhcp, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks updateDhcp" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + Observable> updateDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("dhcpId") String dhcpId, @Query("api-version") String apiVersion, @Body WorkloadNetworkDhcpInner workloadNetworkDhcp, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginUpdateDhcp" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + Observable> beginUpdateDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("dhcpId") String dhcpId, @Query("api-version") String apiVersion, @Body WorkloadNetworkDhcpInner workloadNetworkDhcp, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks deleteDhcp" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", method = "DELETE", hasBody = true) + Observable> deleteDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("dhcpId") String dhcpId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginDeleteDhcp" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", method = "DELETE", hasBody = true) + Observable> beginDeleteDhcp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("dhcpId") String dhcpId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listGateways" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways") + Observable> listGateways(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks getGateway" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}") + Observable> getGateway(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("gatewayId") String gatewayId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listPortMirroring" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles") + Observable> listPortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks getPortMirroring" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + Observable> getPortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("portMirroringId") String portMirroringId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks createPortMirroring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + Observable> createPortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("portMirroringId") String portMirroringId, @Query("api-version") String apiVersion, @Body WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginCreatePortMirroring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + Observable> beginCreatePortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("portMirroringId") String portMirroringId, @Query("api-version") String apiVersion, @Body WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks updatePortMirroring" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + Observable> updatePortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("portMirroringId") String portMirroringId, @Query("api-version") String apiVersion, @Body WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginUpdatePortMirroring" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + Observable> beginUpdatePortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("portMirroringId") String portMirroringId, @Query("api-version") String apiVersion, @Body WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks deletePortMirroring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", method = "DELETE", hasBody = true) + Observable> deletePortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("portMirroringId") String portMirroringId, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginDeletePortMirroring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", method = "DELETE", hasBody = true) + Observable> beginDeletePortMirroring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("portMirroringId") String portMirroringId, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listVMGroups" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups") + Observable> listVMGroups(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks getVMGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + Observable> getVMGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("vmGroupId") String vmGroupId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks createVMGroup" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + Observable> createVMGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("vmGroupId") String vmGroupId, @Query("api-version") String apiVersion, @Body WorkloadNetworkVMGroupInner workloadNetworkVMGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginCreateVMGroup" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + Observable> beginCreateVMGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("vmGroupId") String vmGroupId, @Query("api-version") String apiVersion, @Body WorkloadNetworkVMGroupInner workloadNetworkVMGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks updateVMGroup" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + Observable> updateVMGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("vmGroupId") String vmGroupId, @Query("api-version") String apiVersion, @Body WorkloadNetworkVMGroupInner workloadNetworkVMGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginUpdateVMGroup" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + Observable> beginUpdateVMGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("vmGroupId") String vmGroupId, @Query("api-version") String apiVersion, @Body WorkloadNetworkVMGroupInner workloadNetworkVMGroup, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks deleteVMGroup" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", method = "DELETE", hasBody = true) + Observable> deleteVMGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vmGroupId") String vmGroupId, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks beginDeleteVMGroup" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", method = "DELETE", hasBody = true) + Observable> beginDeleteVMGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vmGroupId") String vmGroupId, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listVirtualMachines" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines") + Observable> listVirtualMachines(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks getVirtualMachine" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}") + Observable> getVirtualMachine(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateCloudName") String privateCloudName, @Path("virtualMachineId") String virtualMachineId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listSegmentsNext" }) + @GET + Observable> listSegmentsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listDhcpNext" }) + @GET + Observable> listDhcpNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listGatewaysNext" }) + @GET + Observable> listGatewaysNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listPortMirroringNext" }) + @GET + Observable> listPortMirroringNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listVMGroupsNext" }) + @GET + Observable> listVMGroupsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.avs.v2020_07_17_preview.WorkloadNetworks listVirtualMachinesNext" }) + @GET + Observable> listVirtualMachinesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkSegmentInner> object if successful. + */ + public PagedList listSegments(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listSegmentsSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSegmentsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSegmentsAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSegmentsSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSegmentsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkSegmentInner> object + */ + public Observable> listSegmentsAsync(final String resourceGroupName, final String privateCloudName) { + return listSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkSegmentInner> object + */ + public Observable>> listSegmentsWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listSegmentsSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSegmentsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of segments in a private cloud workload network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkSegmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSegmentsSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSegments(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSegmentsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSegmentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkSegmentInner object if successful. + */ + public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId) { + return getSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkSegmentInner object + */ + public Observable getSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { + return getSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId).map(new Func1, WorkloadNetworkSegmentInner>() { + @Override + public WorkloadNetworkSegmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkSegmentInner object + */ + public Observable> getSegmentWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String segmentId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (segmentId == null) { + throw new IllegalArgumentException("Parameter segmentId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getSegment(this.client.subscriptionId(), resourceGroupName, privateCloudName, segmentId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSegmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSegmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkSegmentInner object if successful. + */ + public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return createSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return createSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).map(new Func1, WorkloadNetworkSegmentInner>() { + @Override + public WorkloadNetworkSegmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createSegmentsWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (segmentId == null) { + throw new IllegalArgumentException("Parameter segmentId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkSegment == null) { + throw new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."); + } + Validator.validate(workloadNetworkSegment); + Observable> observable = service.createSegments(this.client.subscriptionId(), resourceGroupName, privateCloudName, segmentId, this.client.apiVersion(), workloadNetworkSegment, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkSegmentInner object if successful. + */ + public WorkloadNetworkSegmentInner beginCreateSegments(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkSegmentInner object + */ + public Observable beginCreateSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).map(new Func1, WorkloadNetworkSegmentInner>() { + @Override + public WorkloadNetworkSegmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkSegmentInner object + */ + public Observable> beginCreateSegmentsWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (segmentId == null) { + throw new IllegalArgumentException("Parameter segmentId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkSegment == null) { + throw new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."); + } + Validator.validate(workloadNetworkSegment); + return service.beginCreateSegments(this.client.subscriptionId(), resourceGroupName, privateCloudName, segmentId, this.client.apiVersion(), workloadNetworkSegment, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateSegmentsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateSegmentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkSegmentInner object if successful. + */ + public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return updateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return updateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).map(new Func1, WorkloadNetworkSegmentInner>() { + @Override + public WorkloadNetworkSegmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateSegmentsWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (segmentId == null) { + throw new IllegalArgumentException("Parameter segmentId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkSegment == null) { + throw new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."); + } + Validator.validate(workloadNetworkSegment); + Observable> observable = service.updateSegments(this.client.subscriptionId(), resourceGroupName, privateCloudName, segmentId, this.client.apiVersion(), workloadNetworkSegment, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkSegmentInner object if successful. + */ + public WorkloadNetworkSegmentInner beginUpdateSegments(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkSegmentInner object + */ + public Observable beginUpdateSegmentsAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegmentsWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).map(new Func1, WorkloadNetworkSegmentInner>() { + @Override + public WorkloadNetworkSegmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkSegmentInner object + */ + public Observable> beginUpdateSegmentsWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (segmentId == null) { + throw new IllegalArgumentException("Parameter segmentId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkSegment == null) { + throw new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."); + } + Validator.validate(workloadNetworkSegment); + return service.beginUpdateSegments(this.client.subscriptionId(), resourceGroupName, privateCloudName, segmentId, this.client.apiVersion(), workloadNetworkSegment, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateSegmentsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateSegmentsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { + deleteSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { + return deleteSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteSegmentWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String segmentId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (segmentId == null) { + throw new IllegalArgumentException("Parameter segmentId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteSegment(this.client.subscriptionId(), resourceGroupName, privateCloudName, segmentId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { + beginDeleteSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { + return beginDeleteSegmentWithServiceResponseAsync(resourceGroupName, privateCloudName, segmentId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteSegmentWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String segmentId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (segmentId == null) { + throw new IllegalArgumentException("Parameter segmentId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteSegment(this.client.subscriptionId(), resourceGroupName, privateCloudName, segmentId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteSegmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteSegmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkDhcpInner> object if successful. + */ + public PagedList listDhcp(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listDhcpSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listDhcpNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listDhcpAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listDhcpSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listDhcpNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkDhcpInner> object + */ + public Observable> listDhcpAsync(final String resourceGroupName, final String privateCloudName) { + return listDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkDhcpInner> object + */ + public Observable>> listDhcpWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listDhcpSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDhcpNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List dhcp in a private cloud workload network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkDhcpInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listDhcpSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listDhcp(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDhcpDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDhcpDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkDhcpInner object if successful. + */ + public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, String privateCloudName) { + return getDhcpWithServiceResponseAsync(resourceGroupName, dhcpId, privateCloudName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDhcpAsync(String resourceGroupName, String dhcpId, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDhcpWithServiceResponseAsync(resourceGroupName, dhcpId, privateCloudName), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkDhcpInner object + */ + public Observable getDhcpAsync(String resourceGroupName, String dhcpId, String privateCloudName) { + return getDhcpWithServiceResponseAsync(resourceGroupName, dhcpId, privateCloudName).map(new Func1, WorkloadNetworkDhcpInner>() { + @Override + public WorkloadNetworkDhcpInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkDhcpInner object + */ + public Observable> getDhcpWithServiceResponseAsync(String resourceGroupName, String dhcpId, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dhcpId == null) { + throw new IllegalArgumentException("Parameter dhcpId is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDhcp(this.client.subscriptionId(), resourceGroupName, dhcpId, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDhcpDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDhcpDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkDhcpInner object if successful. + */ + public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return createDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return createDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).map(new Func1, WorkloadNetworkDhcpInner>() { + @Override + public WorkloadNetworkDhcpInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createDhcpWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (dhcpId == null) { + throw new IllegalArgumentException("Parameter dhcpId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkDhcp == null) { + throw new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."); + } + Validator.validate(workloadNetworkDhcp); + Observable> observable = service.createDhcp(this.client.subscriptionId(), resourceGroupName, privateCloudName, dhcpId, this.client.apiVersion(), workloadNetworkDhcp, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkDhcpInner object if successful. + */ + public WorkloadNetworkDhcpInner beginCreateDhcp(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkDhcpInner object + */ + public Observable beginCreateDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).map(new Func1, WorkloadNetworkDhcpInner>() { + @Override + public WorkloadNetworkDhcpInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkDhcpInner object + */ + public Observable> beginCreateDhcpWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (dhcpId == null) { + throw new IllegalArgumentException("Parameter dhcpId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkDhcp == null) { + throw new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."); + } + Validator.validate(workloadNetworkDhcp); + return service.beginCreateDhcp(this.client.subscriptionId(), resourceGroupName, privateCloudName, dhcpId, this.client.apiVersion(), workloadNetworkDhcp, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDhcpDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDhcpDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkDhcpInner object if successful. + */ + public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return updateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return updateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).map(new Func1, WorkloadNetworkDhcpInner>() { + @Override + public WorkloadNetworkDhcpInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateDhcpWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (dhcpId == null) { + throw new IllegalArgumentException("Parameter dhcpId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkDhcp == null) { + throw new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."); + } + Validator.validate(workloadNetworkDhcp); + Observable> observable = service.updateDhcp(this.client.subscriptionId(), resourceGroupName, privateCloudName, dhcpId, this.client.apiVersion(), workloadNetworkDhcp, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkDhcpInner object if successful. + */ + public WorkloadNetworkDhcpInner beginUpdateDhcp(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkDhcpInner object + */ + public Observable beginUpdateDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).map(new Func1, WorkloadNetworkDhcpInner>() { + @Override + public WorkloadNetworkDhcpInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkDhcpInner object + */ + public Observable> beginUpdateDhcpWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (dhcpId == null) { + throw new IllegalArgumentException("Parameter dhcpId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkDhcp == null) { + throw new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."); + } + Validator.validate(workloadNetworkDhcp); + return service.beginUpdateDhcp(this.client.subscriptionId(), resourceGroupName, privateCloudName, dhcpId, this.client.apiVersion(), workloadNetworkDhcp, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDhcpDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDhcpDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { + deleteDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + return deleteDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteDhcpWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (dhcpId == null) { + throw new IllegalArgumentException("Parameter dhcpId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteDhcp(this.client.subscriptionId(), resourceGroupName, privateCloudName, dhcpId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { + beginDeleteDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + return beginDeleteDhcpWithServiceResponseAsync(resourceGroupName, privateCloudName, dhcpId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteDhcpWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (dhcpId == null) { + throw new IllegalArgumentException("Parameter dhcpId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteDhcp(this.client.subscriptionId(), resourceGroupName, privateCloudName, dhcpId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDhcpDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDhcpDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkGatewayInner> object if successful. + */ + public PagedList listGateways(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listGatewaysSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGatewaysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGatewaysAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGatewaysSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGatewaysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkGatewayInner> object + */ + public Observable> listGatewaysAsync(final String resourceGroupName, final String privateCloudName) { + return listGatewaysWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkGatewayInner> object + */ + public Observable>> listGatewaysWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listGatewaysSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGatewaysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of gateways in a private cloud workload network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGatewaysSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listGateways(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGatewaysDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGatewaysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkGatewayInner object if successful. + */ + public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId) { + return getGatewayWithServiceResponseAsync(resourceGroupName, privateCloudName, gatewayId).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getGatewayAsync(String resourceGroupName, String privateCloudName, String gatewayId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGatewayWithServiceResponseAsync(resourceGroupName, privateCloudName, gatewayId), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkGatewayInner object + */ + public Observable getGatewayAsync(String resourceGroupName, String privateCloudName, String gatewayId) { + return getGatewayWithServiceResponseAsync(resourceGroupName, privateCloudName, gatewayId).map(new Func1, WorkloadNetworkGatewayInner>() { + @Override + public WorkloadNetworkGatewayInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkGatewayInner object + */ + public Observable> getGatewayWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String gatewayId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (gatewayId == null) { + throw new IllegalArgumentException("Parameter gatewayId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getGateway(this.client.subscriptionId(), resourceGroupName, privateCloudName, gatewayId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGatewayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGatewayDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkPortMirroringInner> object if successful. + */ + public PagedList listPortMirroring(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPortMirroringNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listPortMirroringAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPortMirroringNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkPortMirroringInner> object + */ + public Observable> listPortMirroringAsync(final String resourceGroupName, final String privateCloudName) { + return listPortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkPortMirroringInner> object + */ + public Observable>> listPortMirroringWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listPortMirroringNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkPortMirroringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPortMirroringSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listPortMirroring(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPortMirroringDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPortMirroringDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkPortMirroringInner object if successful. + */ + public WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId) { + return getPortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkPortMirroringInner object + */ + public Observable getPortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId) { + return getPortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId).map(new Func1, WorkloadNetworkPortMirroringInner>() { + @Override + public WorkloadNetworkPortMirroringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkPortMirroringInner object + */ + public Observable> getPortMirroringWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (portMirroringId == null) { + throw new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPortMirroring(this.client.subscriptionId(), resourceGroupName, privateCloudName, portMirroringId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPortMirroringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPortMirroringDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkPortMirroringInner object if successful. + */ + public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return createPortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createPortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createPortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createPortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return createPortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).map(new Func1, WorkloadNetworkPortMirroringInner>() { + @Override + public WorkloadNetworkPortMirroringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createPortMirroringWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (portMirroringId == null) { + throw new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkPortMirroring == null) { + throw new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."); + } + Validator.validate(workloadNetworkPortMirroring); + Observable> observable = service.createPortMirroring(this.client.subscriptionId(), resourceGroupName, privateCloudName, portMirroringId, this.client.apiVersion(), workloadNetworkPortMirroring, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkPortMirroringInner object if successful. + */ + public WorkloadNetworkPortMirroringInner beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginCreatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkPortMirroringInner object + */ + public Observable beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginCreatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).map(new Func1, WorkloadNetworkPortMirroringInner>() { + @Override + public WorkloadNetworkPortMirroringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkPortMirroringInner object + */ + public Observable> beginCreatePortMirroringWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (portMirroringId == null) { + throw new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkPortMirroring == null) { + throw new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."); + } + Validator.validate(workloadNetworkPortMirroring); + return service.beginCreatePortMirroring(this.client.subscriptionId(), resourceGroupName, privateCloudName, portMirroringId, this.client.apiVersion(), workloadNetworkPortMirroring, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreatePortMirroringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreatePortMirroringDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkPortMirroringInner object if successful. + */ + public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return updatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return updatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).map(new Func1, WorkloadNetworkPortMirroringInner>() { + @Override + public WorkloadNetworkPortMirroringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updatePortMirroringWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (portMirroringId == null) { + throw new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkPortMirroring == null) { + throw new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."); + } + Validator.validate(workloadNetworkPortMirroring); + Observable> observable = service.updatePortMirroring(this.client.subscriptionId(), resourceGroupName, privateCloudName, portMirroringId, this.client.apiVersion(), workloadNetworkPortMirroring, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkPortMirroringInner object if successful. + */ + public WorkloadNetworkPortMirroringInner beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginUpdatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkPortMirroringInner object + */ + public Observable beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginUpdatePortMirroringWithServiceResponseAsync(resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring).map(new Func1, WorkloadNetworkPortMirroringInner>() { + @Override + public WorkloadNetworkPortMirroringInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkPortMirroringInner object + */ + public Observable> beginUpdatePortMirroringWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (portMirroringId == null) { + throw new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkPortMirroring == null) { + throw new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."); + } + Validator.validate(workloadNetworkPortMirroring); + return service.beginUpdatePortMirroring(this.client.subscriptionId(), resourceGroupName, privateCloudName, portMirroringId, this.client.apiVersion(), workloadNetworkPortMirroring, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdatePortMirroringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdatePortMirroringDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { + deletePortMirroringWithServiceResponseAsync(resourceGroupName, portMirroringId, privateCloudName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deletePortMirroringAsync(String resourceGroupName, String portMirroringId, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deletePortMirroringWithServiceResponseAsync(resourceGroupName, portMirroringId, privateCloudName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deletePortMirroringAsync(String resourceGroupName, String portMirroringId, String privateCloudName) { + return deletePortMirroringWithServiceResponseAsync(resourceGroupName, portMirroringId, privateCloudName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deletePortMirroringWithServiceResponseAsync(String resourceGroupName, String portMirroringId, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (portMirroringId == null) { + throw new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deletePortMirroring(this.client.subscriptionId(), resourceGroupName, portMirroringId, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { + beginDeletePortMirroringWithServiceResponseAsync(resourceGroupName, portMirroringId, privateCloudName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeletePortMirroringAsync(String resourceGroupName, String portMirroringId, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeletePortMirroringWithServiceResponseAsync(resourceGroupName, portMirroringId, privateCloudName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeletePortMirroringAsync(String resourceGroupName, String portMirroringId, String privateCloudName) { + return beginDeletePortMirroringWithServiceResponseAsync(resourceGroupName, portMirroringId, privateCloudName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeletePortMirroringWithServiceResponseAsync(String resourceGroupName, String portMirroringId, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (portMirroringId == null) { + throw new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeletePortMirroring(this.client.subscriptionId(), resourceGroupName, portMirroringId, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeletePortMirroringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeletePortMirroringDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkVMGroupInner> object if successful. + */ + public PagedList listVMGroups(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVMGroupsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVMGroupsAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVMGroupsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkVMGroupInner> object + */ + public Observable> listVMGroupsAsync(final String resourceGroupName, final String privateCloudName) { + return listVMGroupsWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkVMGroupInner> object + */ + public Observable>> listVMGroupsWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVMGroupsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of vm groups in a private cloud workload network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkVMGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVMGroupsSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listVMGroups(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVMGroupsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVMGroupsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkVMGroupInner object if successful. + */ + public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) { + return getVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkVMGroupInner object + */ + public Observable getVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId) { + return getVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId).map(new Func1, WorkloadNetworkVMGroupInner>() { + @Override + public WorkloadNetworkVMGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkVMGroupInner object + */ + public Observable> getVMGroupWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (vmGroupId == null) { + throw new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getVMGroup(this.client.subscriptionId(), resourceGroupName, privateCloudName, vmGroupId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVMGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVMGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkVMGroupInner object if successful. + */ + public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return createVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable createVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return createVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).map(new Func1, WorkloadNetworkVMGroupInner>() { + @Override + public WorkloadNetworkVMGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> createVMGroupWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (vmGroupId == null) { + throw new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkVMGroup == null) { + throw new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."); + } + Validator.validate(workloadNetworkVMGroup); + Observable> observable = service.createVMGroup(this.client.subscriptionId(), resourceGroupName, privateCloudName, vmGroupId, this.client.apiVersion(), workloadNetworkVMGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkVMGroupInner object if successful. + */ + public WorkloadNetworkVMGroupInner beginCreateVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkVMGroupInner object + */ + public Observable beginCreateVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).map(new Func1, WorkloadNetworkVMGroupInner>() { + @Override + public WorkloadNetworkVMGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkVMGroupInner object + */ + public Observable> beginCreateVMGroupWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (vmGroupId == null) { + throw new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkVMGroup == null) { + throw new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."); + } + Validator.validate(workloadNetworkVMGroup); + return service.beginCreateVMGroup(this.client.subscriptionId(), resourceGroupName, privateCloudName, vmGroupId, this.client.apiVersion(), workloadNetworkVMGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateVMGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateVMGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkVMGroupInner object if successful. + */ + public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return updateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable updateVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return updateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).map(new Func1, WorkloadNetworkVMGroupInner>() { + @Override + public WorkloadNetworkVMGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> updateVMGroupWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (vmGroupId == null) { + throw new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkVMGroup == null) { + throw new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."); + } + Validator.validate(workloadNetworkVMGroup); + Observable> observable = service.updateVMGroup(this.client.subscriptionId(), resourceGroupName, privateCloudName, vmGroupId, this.client.apiVersion(), workloadNetworkVMGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkVMGroupInner object if successful. + */ + public WorkloadNetworkVMGroupInner beginUpdateVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup), serviceCallback); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkVMGroupInner object + */ + public Observable beginUpdateVMGroupAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroupWithServiceResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).map(new Func1, WorkloadNetworkVMGroupInner>() { + @Override + public WorkloadNetworkVMGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the WorkloadNetworkVMGroupInner object + */ + public Observable> beginUpdateVMGroupWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (vmGroupId == null) { + throw new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (workloadNetworkVMGroup == null) { + throw new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."); + } + Validator.validate(workloadNetworkVMGroup); + return service.beginUpdateVMGroup(this.client.subscriptionId(), resourceGroupName, privateCloudName, vmGroupId, this.client.apiVersion(), workloadNetworkVMGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateVMGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateVMGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { + deleteVMGroupWithServiceResponseAsync(resourceGroupName, vmGroupId, privateCloudName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteVMGroupWithServiceResponseAsync(resourceGroupName, vmGroupId, privateCloudName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + return deleteVMGroupWithServiceResponseAsync(resourceGroupName, vmGroupId, privateCloudName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteVMGroupWithServiceResponseAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmGroupId == null) { + throw new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.deleteVMGroup(this.client.subscriptionId(), resourceGroupName, vmGroupId, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { + beginDeleteVMGroupWithServiceResponseAsync(resourceGroupName, vmGroupId, privateCloudName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteVMGroupWithServiceResponseAsync(resourceGroupName, vmGroupId, privateCloudName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + return beginDeleteVMGroupWithServiceResponseAsync(resourceGroupName, vmGroupId, privateCloudName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteVMGroupWithServiceResponseAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vmGroupId == null) { + throw new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDeleteVMGroup(this.client.subscriptionId(), resourceGroupName, vmGroupId, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteVMGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteVMGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkVirtualMachineInner> object if successful. + */ + public PagedList listVirtualMachines(final String resourceGroupName, final String privateCloudName) { + ServiceResponse> response = listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachinesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachinesAsync(final String resourceGroupName, final String privateCloudName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachinesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkVirtualMachineInner> object + */ + public Observable> listVirtualMachinesAsync(final String resourceGroupName, final String privateCloudName) { + return listVirtualMachinesWithServiceResponseAsync(resourceGroupName, privateCloudName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<WorkloadNetworkVirtualMachineInner> object + */ + public Observable>> listVirtualMachinesWithServiceResponseAsync(final String resourceGroupName, final String privateCloudName) { + return listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachinesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of virtual machines in a private cloud workload network. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateCloudName Name of the private cloud + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkVirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachinesSinglePageAsync(final String resourceGroupName, final String privateCloudName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listVirtualMachines(this.client.subscriptionId(), resourceGroupName, privateCloudName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachinesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachinesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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 NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkloadNetworkVirtualMachineInner object if successful. + */ + public WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroupName, String privateCloudName, String virtualMachineId) { + return getVirtualMachineWithServiceResponseAsync(resourceGroupName, privateCloudName, virtualMachineId).toBlocking().single().body(); + } + + /** + * 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 NSX Virtual Machine identifier. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getVirtualMachineAsync(String resourceGroupName, String privateCloudName, String virtualMachineId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getVirtualMachineWithServiceResponseAsync(resourceGroupName, privateCloudName, virtualMachineId), serviceCallback); + } + + /** + * 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 NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkloadNetworkVirtualMachineInner object + */ + public Observable getVirtualMachineAsync(String resourceGroupName, String privateCloudName, String virtualMachineId) { + return getVirtualMachineWithServiceResponseAsync(resourceGroupName, privateCloudName, virtualMachineId).map(new Func1, WorkloadNetworkVirtualMachineInner>() { + @Override + public WorkloadNetworkVirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkloadNetworkVirtualMachineInner object + */ + public Observable> getVirtualMachineWithServiceResponseAsync(String resourceGroupName, String privateCloudName, String virtualMachineId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateCloudName == null) { + throw new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."); + } + if (virtualMachineId == null) { + throw new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getVirtualMachine(this.client.subscriptionId(), resourceGroupName, privateCloudName, virtualMachineId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getVirtualMachineDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getVirtualMachineDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List of segments in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkSegmentInner> object if successful. + */ + public PagedList listSegmentsNext(final String nextPageLink) { + ServiceResponse> response = listSegmentsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSegmentsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List of segments in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSegmentsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSegmentsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSegmentsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List of segments in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkSegmentInner> object + */ + public Observable> listSegmentsNextAsync(final String nextPageLink) { + return listSegmentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List of segments in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkSegmentInner> object + */ + public Observable>> listSegmentsNextWithServiceResponseAsync(final String nextPageLink) { + return listSegmentsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSegmentsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of segments in a private cloud workload network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkSegmentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSegmentsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSegmentsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSegmentsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSegmentsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkDhcpInner> object if successful. + */ + public PagedList listDhcpNext(final String nextPageLink) { + ServiceResponse> response = listDhcpNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listDhcpNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List dhcp in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listDhcpNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listDhcpNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listDhcpNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkDhcpInner> object + */ + public Observable> listDhcpNextAsync(final String nextPageLink) { + return listDhcpNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkDhcpInner> object + */ + public Observable>> listDhcpNextWithServiceResponseAsync(final String nextPageLink) { + return listDhcpNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDhcpNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List dhcp in a private cloud workload network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkDhcpInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listDhcpNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listDhcpNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDhcpNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDhcpNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkGatewayInner> object if successful. + */ + public PagedList listGatewaysNext(final String nextPageLink) { + ServiceResponse> response = listGatewaysNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listGatewaysNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List of gateways in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listGatewaysNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listGatewaysNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listGatewaysNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkGatewayInner> object + */ + public Observable> listGatewaysNextAsync(final String nextPageLink) { + return listGatewaysNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkGatewayInner> object + */ + public Observable>> listGatewaysNextWithServiceResponseAsync(final String nextPageLink) { + return listGatewaysNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listGatewaysNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of gateways in a private cloud workload network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listGatewaysNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listGatewaysNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGatewaysNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGatewaysNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkPortMirroringInner> object if successful. + */ + public PagedList listPortMirroringNext(final String nextPageLink) { + ServiceResponse> response = listPortMirroringNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPortMirroringNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listPortMirroringNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPortMirroringNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPortMirroringNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkPortMirroringInner> object + */ + public Observable> listPortMirroringNextAsync(final String nextPageLink) { + return listPortMirroringNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkPortMirroringInner> object + */ + public Observable>> listPortMirroringNextWithServiceResponseAsync(final String nextPageLink) { + return listPortMirroringNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listPortMirroringNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkPortMirroringInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPortMirroringNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listPortMirroringNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPortMirroringNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPortMirroringNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkVMGroupInner> object if successful. + */ + public PagedList listVMGroupsNext(final String nextPageLink) { + ServiceResponse> response = listVMGroupsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVMGroupsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVMGroupsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVMGroupsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVMGroupsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkVMGroupInner> object + */ + public Observable> listVMGroupsNextAsync(final String nextPageLink) { + return listVMGroupsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkVMGroupInner> object + */ + public Observable>> listVMGroupsNextWithServiceResponseAsync(final String nextPageLink) { + return listVMGroupsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVMGroupsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of vm groups in a private cloud workload network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkVMGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVMGroupsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVMGroupsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVMGroupsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVMGroupsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WorkloadNetworkVirtualMachineInner> object if successful. + */ + public PagedList listVirtualMachinesNext(final String nextPageLink) { + ServiceResponse> response = listVirtualMachinesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listVirtualMachinesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listVirtualMachinesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listVirtualMachinesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listVirtualMachinesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkVirtualMachineInner> object + */ + public Observable> listVirtualMachinesNextAsync(final String nextPageLink) { + return listVirtualMachinesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadNetworkVirtualMachineInner> object + */ + public Observable>> listVirtualMachinesNextWithServiceResponseAsync(final String nextPageLink) { + return listVirtualMachinesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachinesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List of virtual machines in a private cloud workload network. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadNetworkVirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listVirtualMachinesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listVirtualMachinesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listVirtualMachinesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listVirtualMachinesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/package-info.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/package-info.java new file mode 100644 index 000000000000..94b4741d8e70 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for AvsClient. + * Azure VMware Solution API. + */ +package com.microsoft.azure.management.avs.v2020_07_17_preview.implementation; diff --git a/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/package-info.java b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/package-info.java new file mode 100644 index 000000000000..94f54a95dfe1 --- /dev/null +++ b/sdk/avs/mgmt-v2020_07_17_preview/src/main/java/com/microsoft/azure/management/avs/v2020_07_17_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for AvsClient. + * Azure VMware Solution API. + */ +package com.microsoft.azure.management.avs.v2020_07_17_preview;