diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/pom.xml b/vmwarecloudsimple/resource-manager/v2019_04_01/pom.xml new file mode 100644 index 0000000000000..6759fe08206d7 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.vmwarecloudsimple.v2019_04_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-vmwarecloudsimple + 1.0.0-beta + jar + Microsoft Azure SDK for VMwareCloudSimple Management + This package contains Microsoft VMwareCloudSimple 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 + + + + + + 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/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AggregationType.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AggregationType.java new file mode 100644 index 0000000000000..36e7760bed823 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AggregationType.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AggregationType. + */ +public enum AggregationType { + /** Enum value Average. */ + AVERAGE("Average"), + + /** Enum value Total. */ + TOTAL("Total"); + + /** The actual serialized value for a AggregationType instance. */ + private String value; + + AggregationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AggregationType instance. + * + * @param value the serialized value to parse. + * @return the parsed AggregationType object, or null if unable to parse. + */ + @JsonCreator + public static AggregationType fromString(String value) { + AggregationType[] items = AggregationType.values(); + for (AggregationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperation.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperation.java new file mode 100644 index 0000000000000..6695c1912ab68 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperation.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.AvailableOperationInner; + +/** + * Type representing AvailableOperation. + */ +public interface AvailableOperation extends HasInner, HasManager { + /** + * @return the display value. + */ + AvailableOperationDisplay display(); + + /** + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + OperationOrigin origin(); + + /** + * @return the serviceSpecification value. + */ + AvailableOperationDisplayPropertyServiceSpecificationMetricsList serviceSpecification(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplay.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplay.java new file mode 100644 index 0000000000000..5e42f8d1444bb --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplay.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Resource provider available operation display model. + */ +public class AvailableOperationDisplay { + /** + * Description of the operation for display purposes. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Name of the operation for display purposes. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Name of the provider for display purposes. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Name of the resource type for display purposes. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Get description of the operation for display purposes. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation for display purposes. + * + * @param description the description value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get name of the operation for display purposes. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set name of the operation for display purposes. + * + * @param operation the operation value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get name of the provider for display purposes. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set name of the provider for display purposes. + * + * @param provider the provider value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get name of the resource type for display purposes. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set name of the resource type for display purposes. + * + * @param resource the resource value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplayPropertyServiceSpecificationMetricsItem.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplayPropertyServiceSpecificationMetricsItem.java new file mode 100644 index 0000000000000..3a6ef68cff800 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplayPropertyServiceSpecificationMetricsItem.java @@ -0,0 +1,148 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Available operation display property service specification metrics item. + */ +public class AvailableOperationDisplayPropertyServiceSpecificationMetricsItem { + /** + * Metric's aggregation type for e.g. (Average, Total). Possible values + * include: 'Average', 'Total'. + */ + @JsonProperty(value = "aggregationType", required = true) + private AggregationType aggregationType; + + /** + * Metric's description. + */ + @JsonProperty(value = "displayDescription", required = true) + private String displayDescription; + + /** + * Human readable metric's name. + */ + @JsonProperty(value = "displayName", required = true) + private String displayName; + + /** + * Metric's name/id. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Metric's unit. + */ + @JsonProperty(value = "unit", required = true) + private String unit; + + /** + * Get metric's aggregation type for e.g. (Average, Total). Possible values include: 'Average', 'Total'. + * + * @return the aggregationType value + */ + public AggregationType aggregationType() { + return this.aggregationType; + } + + /** + * Set metric's aggregation type for e.g. (Average, Total). Possible values include: 'Average', 'Total'. + * + * @param aggregationType the aggregationType value to set + * @return the AvailableOperationDisplayPropertyServiceSpecificationMetricsItem object itself. + */ + public AvailableOperationDisplayPropertyServiceSpecificationMetricsItem withAggregationType(AggregationType aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get metric's description. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set metric's description. + * + * @param displayDescription the displayDescription value to set + * @return the AvailableOperationDisplayPropertyServiceSpecificationMetricsItem object itself. + */ + public AvailableOperationDisplayPropertyServiceSpecificationMetricsItem withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get human readable metric's name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set human readable metric's name. + * + * @param displayName the displayName value to set + * @return the AvailableOperationDisplayPropertyServiceSpecificationMetricsItem object itself. + */ + public AvailableOperationDisplayPropertyServiceSpecificationMetricsItem withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get metric's name/id. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set metric's name/id. + * + * @param name the name value to set + * @return the AvailableOperationDisplayPropertyServiceSpecificationMetricsItem object itself. + */ + public AvailableOperationDisplayPropertyServiceSpecificationMetricsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get metric's unit. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set metric's unit. + * + * @param unit the unit value to set + * @return the AvailableOperationDisplayPropertyServiceSpecificationMetricsItem object itself. + */ + public AvailableOperationDisplayPropertyServiceSpecificationMetricsItem withUnit(String unit) { + this.unit = unit; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplayPropertyServiceSpecificationMetricsList.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplayPropertyServiceSpecificationMetricsList.java new file mode 100644 index 0000000000000..4d71614f22551 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperationDisplayPropertyServiceSpecificationMetricsList.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.vmwarecloudsimple.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of available operation display property service specification metrics. + */ +public class AvailableOperationDisplayPropertyServiceSpecificationMetricsList { + /** + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get metric specifications of operation. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the AvailableOperationDisplayPropertyServiceSpecificationMetricsList object itself. + */ + public AvailableOperationDisplayPropertyServiceSpecificationMetricsList withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperations.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperations.java new file mode 100644 index 0000000000000..b2f5e8df2bea4 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/AvailableOperations.java @@ -0,0 +1,28 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.AvailableOperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AvailableOperations. + */ +public interface AvailableOperations extends HasInner { + /** + * Implements list of available operations. + * Return list of operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPError.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPError.java new file mode 100644 index 0000000000000..f386a1e8db3ff --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPError.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * General error model. + */ +public class CSRPError { + /** + * Error's body. + */ + @JsonProperty(value = "error") + private CSRPErrorBody error; + + /** + * Get error's body. + * + * @return the error value + */ + public CSRPErrorBody error() { + return this.error; + } + + /** + * Set error's body. + * + * @param error the error value to set + * @return the CSRPError object itself. + */ + public CSRPError withError(CSRPErrorBody error) { + this.error = error; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPErrorBody.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPErrorBody.java new file mode 100644 index 0000000000000..9b5d8e5154774 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPErrorBody.java @@ -0,0 +1,89 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error properties. + */ +public class CSRPErrorBody { + /** + * Error's code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Error's details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Error's message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Error's target. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get error's code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get error's details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get error's message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get error's target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set error's target. + * + * @param target the target value to set + * @return the CSRPErrorBody object itself. + */ + public CSRPErrorBody withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPErrorException.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPErrorException.java new file mode 100644 index 0000000000000..bccbd4a8d2a64 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/CSRPErrorException.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with CSRPError information. + */ +public class CSRPErrorException extends RestException { + /** + * Initializes a new instance of the CSRPErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public CSRPErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the CSRPErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public CSRPErrorException(final String message, final Response response, final CSRPError body) { + super(message, response, body); + } + + @Override + public CSRPError body() { + return (CSRPError) super.body(); + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNode.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNode.java new file mode 100644 index 0000000000000..5a87df1f9cddc --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNode.java @@ -0,0 +1,245 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +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.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; +import java.util.UUID; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.DedicatedCloudNodeInner; + +/** + * Type representing DedicatedCloudNode. + */ +public interface DedicatedCloudNode extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the availabilityZoneId value. + */ + String availabilityZoneId(); + + /** + * @return the availabilityZoneName value. + */ + String availabilityZoneName(); + + /** + * @return the cloudRackName value. + */ + String cloudRackName(); + + /** + * @return the created value. + */ + Object created(); + + /** + * @return the id1 value. + */ + String id1(); + + /** + * @return the name1 value. + */ + String name1(); + + /** + * @return the nodesCount value. + */ + int nodesCount(); + + /** + * @return the placementGroupId value. + */ + String placementGroupId(); + + /** + * @return the placementGroupName value. + */ + String placementGroupName(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the privateCloudName value. + */ + String privateCloudName(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the purchaseId value. + */ + UUID purchaseId(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + NodeStatus status(); + + /** + * @return the vmwareClusterName value. + */ + String vmwareClusterName(); + + /** + * The entirety of the DedicatedCloudNode definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithAvailabilityZoneId, DefinitionStages.WithId1, DefinitionStages.WithName1, DefinitionStages.WithNodesCount, DefinitionStages.WithPlacementGroupId, DefinitionStages.WithPurchaseId, DefinitionStages.WithCreate { + } + + /** + * Grouping of DedicatedCloudNode definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DedicatedCloudNode definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DedicatedCloudNode definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the dedicatedcloudnode definition allowing to specify AvailabilityZoneId. + */ + interface WithAvailabilityZoneId { + /** + * Specifies availabilityZoneId. + * @param availabilityZoneId Availability Zone id, e.g. "az1" + * @return the next definition stage +*/ + WithId1 withAvailabilityZoneId(String availabilityZoneId); + } + + /** + * The stage of the dedicatedcloudnode definition allowing to specify Id1. + */ + interface WithId1 { + /** + * Specifies id1. + * @param id1 SKU's id + * @return the next definition stage +*/ + WithName1 withId1(String id1); + } + + /** + * The stage of the dedicatedcloudnode definition allowing to specify Name1. + */ + interface WithName1 { + /** + * Specifies name1. + * @param name1 SKU's name + * @return the next definition stage +*/ + WithNodesCount withName1(String name1); + } + + /** + * The stage of the dedicatedcloudnode definition allowing to specify NodesCount. + */ + interface WithNodesCount { + /** + * Specifies nodesCount. + * @param nodesCount count of nodes to create + * @return the next definition stage +*/ + WithPlacementGroupId withNodesCount(int nodesCount); + } + + /** + * The stage of the dedicatedcloudnode definition allowing to specify PlacementGroupId. + */ + interface WithPlacementGroupId { + /** + * Specifies placementGroupId. + * @param placementGroupId Placement Group id, e.g. "n1" + * @return the next definition stage +*/ + WithPurchaseId withPlacementGroupId(String placementGroupId); + } + + /** + * The stage of the dedicatedcloudnode definition allowing to specify PurchaseId. + */ + interface WithPurchaseId { + /** + * Specifies purchaseId. + * @param purchaseId purchase id + * @return the next definition stage +*/ + WithCreate withPurchaseId(UUID purchaseId); + } + + /** + * The stage of the dedicatedcloudnode definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Dedicated Cloud Nodes SKU + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * 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.WithSku { + } + } + /** + * The template for a DedicatedCloudNode update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku { + } + + /** + * Grouping of DedicatedCloudNode update stages. + */ + interface UpdateStages { + /** + * The stage of the dedicatedcloudnode update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku Dedicated Cloud Nodes SKU + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodeCreateOrUpdateHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodeCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..0bbc82ea0c101 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodeCreateOrUpdateHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for CreateOrUpdate operation. + */ +public class DedicatedCloudNodeCreateOrUpdateHeaders { + /** + * The azureAsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * The location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The retryAfter property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the DedicatedCloudNodeCreateOrUpdateHeaders object itself. + */ + public DedicatedCloudNodeCreateOrUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the DedicatedCloudNodeCreateOrUpdateHeaders object itself. + */ + public DedicatedCloudNodeCreateOrUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the DedicatedCloudNodeCreateOrUpdateHeaders object itself. + */ + public DedicatedCloudNodeCreateOrUpdateHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodeDeleteHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodeDeleteHeaders.java new file mode 100644 index 0000000000000..e494efdd66e3e --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodeDeleteHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Delete operation. + */ +public class DedicatedCloudNodeDeleteHeaders { + /** + * The contentType property. + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the DedicatedCloudNodeDeleteHeaders object itself. + */ + public DedicatedCloudNodeDeleteHeaders withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodes.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodes.java new file mode 100644 index 0000000000000..4d5e642d1945c --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudNodes.java @@ -0,0 +1,25 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +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.vmwarecloudsimple.v2019_04_01.implementation.DedicatedCloudNodesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DedicatedCloudNodes. + */ +public interface DedicatedCloudNodes extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudService.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudService.java new file mode 100644 index 0000000000000..fa455685ccaca --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudService.java @@ -0,0 +1,148 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +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.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.DedicatedCloudServiceInner; + +/** + * Type representing DedicatedCloudService. + */ +public interface DedicatedCloudService extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the gatewaySubnet value. + */ + String gatewaySubnet(); + + /** + * @return the isAccountOnboarded value. + */ + OnboardingStatus isAccountOnboarded(); + + /** + * @return the nodes value. + */ + Integer nodes(); + + /** + * @return the serviceURL value. + */ + String serviceURL(); + + /** + * The entirety of the DedicatedCloudService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithGatewaySubnet, DefinitionStages.WithCreate { + } + + /** + * Grouping of DedicatedCloudService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DedicatedCloudService definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DedicatedCloudService definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the dedicatedcloudservice definition allowing to specify GatewaySubnet. + */ + interface WithGatewaySubnet { + /** + * Specifies gatewaySubnet. + * @param gatewaySubnet gateway Subnet for the account. It will collect the subnet address and always treat it as /28 + * @return the next definition stage +*/ + WithCreate withGatewaySubnet(String gatewaySubnet); + } + + /** + * The stage of the dedicatedcloudservice definition allowing to specify Nodes. + */ + interface WithNodes { + /** + * Specifies nodes. + * @param nodes total nodes purchased + * @return the next definition stage + */ + WithCreate withNodes(Integer nodes); + } + + /** + * The stage of the dedicatedcloudservice definition allowing to specify ServiceURL. + */ + interface WithServiceURL { + /** + * Specifies serviceURL. + * @param serviceURL link to a service management web portal + * @return the next definition stage + */ + WithCreate withServiceURL(String serviceURL); + } + + /** + * 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.WithNodes, DefinitionStages.WithServiceURL { + } + } + /** + * The template for a DedicatedCloudService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithNodes, UpdateStages.WithServiceURL { + } + + /** + * Grouping of DedicatedCloudService update stages. + */ + interface UpdateStages { + /** + * The stage of the dedicatedcloudservice update allowing to specify Nodes. + */ + interface WithNodes { + /** + * Specifies nodes. + * @param nodes total nodes purchased + * @return the next update stage + */ + Update withNodes(Integer nodes); + } + + /** + * The stage of the dedicatedcloudservice update allowing to specify ServiceURL. + */ + interface WithServiceURL { + /** + * Specifies serviceURL. + * @param serviceURL link to a service management web portal + * @return the next update stage + */ + Update withServiceURL(String serviceURL); + } + + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudServiceDeleteHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudServiceDeleteHeaders.java new file mode 100644 index 0000000000000..965452cdd0268 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudServiceDeleteHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Delete operation. + */ +public class DedicatedCloudServiceDeleteHeaders { + /** + * The contentType property. + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the DedicatedCloudServiceDeleteHeaders object itself. + */ + public DedicatedCloudServiceDeleteHeaders withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudServices.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudServices.java new file mode 100644 index 0000000000000..edb7c5b3c8960 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DedicatedCloudServices.java @@ -0,0 +1,25 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +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.vmwarecloudsimple.v2019_04_01.implementation.DedicatedCloudServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DedicatedCloudServices. + */ +public interface DedicatedCloudServices extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DiskIndependenceMode.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DiskIndependenceMode.java new file mode 100644 index 0000000000000..a8cb3d854c03b --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/DiskIndependenceMode.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DiskIndependenceMode. + */ +public enum DiskIndependenceMode { + /** Enum value persistent. */ + PERSISTENT("persistent"), + + /** Enum value independent_persistent. */ + INDEPENDENT_PERSISTENT("independent_persistent"), + + /** Enum value independent_nonpersistent. */ + INDEPENDENT_NONPERSISTENT("independent_nonpersistent"); + + /** The actual serialized value for a DiskIndependenceMode instance. */ + private String value; + + DiskIndependenceMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DiskIndependenceMode instance. + * + * @param value the serialized value to parse. + * @return the parsed DiskIndependenceMode object, or null if unable to parse. + */ + @JsonCreator + public static DiskIndependenceMode fromString(String value) { + DiskIndependenceMode[] items = DiskIndependenceMode.values(); + for (DiskIndependenceMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/GetOperationResultByRegionHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/GetOperationResultByRegionHeaders.java new file mode 100644 index 0000000000000..9055738d0558f --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/GetOperationResultByRegionHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for getOperationResultByRegion operation. + */ +public class GetOperationResultByRegionHeaders { + /** + * The location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The retryAfter property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * The contentType property. + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the GetOperationResultByRegionHeaders object itself. + */ + public GetOperationResultByRegionHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the GetOperationResultByRegionHeaders object itself. + */ + public GetOperationResultByRegionHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the GetOperationResultByRegionHeaders object itself. + */ + public GetOperationResultByRegionHeaders withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/GuestOSType.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/GuestOSType.java new file mode 100644 index 0000000000000..135794aa55114 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/GuestOSType.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for GuestOSType. + */ +public enum GuestOSType { + /** Enum value linux. */ + LINUX("linux"), + + /** Enum value windows. */ + WINDOWS("windows"), + + /** Enum value other. */ + OTHER("other"); + + /** The actual serialized value for a GuestOSType instance. */ + private String value; + + GuestOSType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GuestOSType instance. + * + * @param value the serialized value to parse. + * @return the parsed GuestOSType object, or null if unable to parse. + */ + @JsonCreator + public static GuestOSType fromString(String value) { + GuestOSType[] items = GuestOSType.values(); + for (GuestOSType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/NICType.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/NICType.java new file mode 100644 index 0000000000000..00b83a24dca68 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/NICType.java @@ -0,0 +1,65 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NICType. + */ +public enum NICType { + /** Enum value E1000. */ + E1000("E1000"), + + /** Enum value E1000E. */ + E1000E("E1000E"), + + /** Enum value PCNET32. */ + PCNET32("PCNET32"), + + /** Enum value VMXNET. */ + VMXNET("VMXNET"), + + /** Enum value VMXNET2. */ + VMXNET2("VMXNET2"), + + /** Enum value VMXNET3. */ + VMXNET3("VMXNET3"); + + /** The actual serialized value for a NICType instance. */ + private String value; + + NICType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NICType instance. + * + * @param value the serialized value to parse. + * @return the parsed NICType object, or null if unable to parse. + */ + @JsonCreator + public static NICType fromString(String value) { + NICType[] items = NICType.values(); + for (NICType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/NodeStatus.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/NodeStatus.java new file mode 100644 index 0000000000000..728a9afdda862 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/NodeStatus.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NodeStatus. + */ +public enum NodeStatus { + /** Enum value unused. */ + UNUSED("unused"), + + /** Enum value used. */ + USED("used"); + + /** The actual serialized value for a NodeStatus instance. */ + private String value; + + NodeStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NodeStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed NodeStatus object, or null if unable to parse. + */ + @JsonCreator + public static NodeStatus fromString(String value) { + NodeStatus[] items = NodeStatus.values(); + for (NodeStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OnboardingStatus.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OnboardingStatus.java new file mode 100644 index 0000000000000..78b309033e2e8 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OnboardingStatus.java @@ -0,0 +1,59 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OnboardingStatus. + */ +public enum OnboardingStatus { + /** Enum value notOnBoarded. */ + NOT_ON_BOARDED("notOnBoarded"), + + /** Enum value onBoarded. */ + ON_BOARDED("onBoarded"), + + /** Enum value onBoardingFailed. */ + ON_BOARDING_FAILED("onBoardingFailed"), + + /** Enum value onBoarding. */ + ON_BOARDING("onBoarding"); + + /** The actual serialized value for a OnboardingStatus instance. */ + private String value; + + OnboardingStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OnboardingStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OnboardingStatus object, or null if unable to parse. + */ + @JsonCreator + public static OnboardingStatus fromString(String value) { + OnboardingStatus[] items = OnboardingStatus.values(); + for (OnboardingStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OperationError.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OperationError.java new file mode 100644 index 0000000000000..e361655c31dc8 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OperationError.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation error model. + */ +public class OperationError { + /** + * Error's code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error's message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error's code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error's code. + * + * @param code the code value to set + * @return the OperationError object itself. + */ + public OperationError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error's message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error's message. + * + * @param message the message value to set + * @return the OperationError object itself. + */ + public OperationError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OperationOrigin.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OperationOrigin.java new file mode 100644 index 0000000000000..7a9c6ad79e069 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/OperationOrigin.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OperationOrigin. + */ +public enum OperationOrigin { + /** Enum value user. */ + USER("user"), + + /** Enum value system. */ + SYSTEM("system"), + + /** Enum value user,system. */ + USERSYSTEM("user,system"); + + /** The actual serialized value for a OperationOrigin instance. */ + private String value; + + OperationOrigin(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperationOrigin instance. + * + * @param value the serialized value to parse. + * @return the parsed OperationOrigin object, or null if unable to parse. + */ + @JsonCreator + public static OperationOrigin fromString(String value) { + OperationOrigin[] items = OperationOrigin.values(); + for (OperationOrigin item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PatchPayload.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PatchPayload.java new file mode 100644 index 0000000000000..674c363bb9366 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PatchPayload.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.vmwarecloudsimple.v2019_04_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * General patch payload modal. + */ +public class PatchPayload { + /** + * The tags key:value pairs. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags key:value pairs. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags key:value pairs. + * + * @param tags the tags value to set + * @return the PatchPayload object itself. + */ + public PatchPayload withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloud.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloud.java new file mode 100644 index 0000000000000..5b009a4b31a32 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloud.java @@ -0,0 +1,163 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.PrivateCloudInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; +import org.joda.time.DateTime; +import java.util.List; +import java.util.UUID; + +/** + * Type representing PrivateCloud. + */ +public interface PrivateCloud extends HasInner, HasManager { + /** + * @return the availabilityZoneId value. + */ + String availabilityZoneId(); + + /** + * @return the availabilityZoneName value. + */ + String availabilityZoneName(); + + /** + * @return the clustersNumber value. + */ + Integer clustersNumber(); + + /** + * @return the createdBy value. + */ + String createdBy(); + + /** + * @return the createdOn value. + */ + DateTime createdOn(); + + /** + * @return the dnsServers value. + */ + List dnsServers(); + + /** + * @return the expires value. + */ + String expires(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nsxType value. + */ + String nsxType(); + + /** + * @return the placementGroupId value. + */ + String placementGroupId(); + + /** + * @return the placementGroupName value. + */ + String placementGroupName(); + + /** + * @return the privateCloudId value. + */ + UUID privateCloudId(); + + /** + * @return the privateCloudPropertiesType value. + */ + String privateCloudPropertiesType(); + + /** + * @return the resourcePools value. + */ + List resourcePools(); + + /** + * @return the state value. + */ + String state(); + + /** + * @return the totalCpuCores value. + */ + Integer totalCpuCores(); + + /** + * @return the totalNodes value. + */ + Integer totalNodes(); + + /** + * @return the totalRam value. + */ + Integer totalRam(); + + /** + * @return the totalStorage value. + */ + Double totalStorage(); + + /** + * @return the type value. + */ + PrivateCloudResourceType type(); + + /** + * @return the vcenterFqdn value. + */ + String vcenterFqdn(); + + /** + * @return the vcenterRefid value. + */ + String vcenterRefid(); + + /** + * @return the virtualMachineTemplates value. + */ + List virtualMachineTemplates(); + + /** + * @return the virtualNetworks value. + */ + List virtualNetworks(); + + /** + * @return the vrOpsEnabled value. + */ + Boolean vrOpsEnabled(); + + /** + * @return the vSphereVersion value. + */ + String vSphereVersion(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudByRegions.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudByRegions.java new file mode 100644 index 0000000000000..d20e0453e6818 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudByRegions.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloud; + +/** + * Type representing PrivateCloudByRegions. + */ +public interface PrivateCloudByRegions { + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationResourcePool.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationResourcePool.java new file mode 100644 index 0000000000000..60f39a5ec78ae --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationResourcePool.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.ResourcePoolInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; + +/** + * Type representing PrivateCloudLocationResourcePool. + */ +public interface PrivateCloudLocationResourcePool extends HasInner, HasManager { + /** + * @return the fullName value. + */ + String fullName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationResourcePoolModel.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationResourcePoolModel.java new file mode 100644 index 0000000000000..29694b3ee50ac --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationResourcePoolModel.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.ResourcePoolInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; + +/** + * Type representing PrivateCloudLocationResourcePoolModel. + */ +public interface PrivateCloudLocationResourcePoolModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the fullName value. + */ + String fullName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualMachineTemplate.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualMachineTemplate.java new file mode 100644 index 0000000000000..47bd5b4561ed7 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualMachineTemplate.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualMachineTemplateInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; +import java.util.List; + +/** + * Type representing PrivateCloudLocationVirtualMachineTemplate. + */ +public interface PrivateCloudLocationVirtualMachineTemplate extends HasInner, HasManager { + /** + * @return the amountOfRam value. + */ + Integer amountOfRam(); + + /** + * @return the controllers value. + */ + List controllers(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the disks value. + */ + List disks(); + + /** + * @return the exposeToGuestVM value. + */ + Boolean exposeToGuestVM(); + + /** + * @return the guestOS value. + */ + String guestOS(); + + /** + * @return the guestOSType value. + */ + String guestOSType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nics value. + */ + List nics(); + + /** + * @return the numberOfCores value. + */ + Integer numberOfCores(); + + /** + * @return the path value. + */ + String path(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vmwaretools value. + */ + String vmwaretools(); + + /** + * @return the vSphereNetworks value. + */ + List vSphereNetworks(); + + /** + * @return the vSphereTags value. + */ + List vSphereTags(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualMachineTemplateModel.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualMachineTemplateModel.java new file mode 100644 index 0000000000000..1ab733fb32bfd --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualMachineTemplateModel.java @@ -0,0 +1,113 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualMachineTemplateInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; +import java.util.List; + +/** + * Type representing PrivateCloudLocationVirtualMachineTemplateModel. + */ +public interface PrivateCloudLocationVirtualMachineTemplateModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the amountOfRam value. + */ + Integer amountOfRam(); + + /** + * @return the controllers value. + */ + List controllers(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the disks value. + */ + List disks(); + + /** + * @return the exposeToGuestVM value. + */ + Boolean exposeToGuestVM(); + + /** + * @return the guestOS value. + */ + String guestOS(); + + /** + * @return the guestOSType value. + */ + String guestOSType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nics value. + */ + List nics(); + + /** + * @return the numberOfCores value. + */ + Integer numberOfCores(); + + /** + * @return the path value. + */ + String path(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vmwaretools value. + */ + String vmwaretools(); + + /** + * @return the vSphereNetworks value. + */ + List vSphereNetworks(); + + /** + * @return the vSphereTags value. + */ + List vSphereTags(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualNetwork.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualNetwork.java new file mode 100644 index 0000000000000..fbce7bdd2976e --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualNetwork.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualNetworkInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; + +/** + * Type representing PrivateCloudLocationVirtualNetwork. + */ +public interface PrivateCloudLocationVirtualNetwork extends HasInner, HasManager { + /** + * @return the assignable value. + */ + Boolean assignable(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualNetworkModel.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualNetworkModel.java new file mode 100644 index 0000000000000..9526ce8bee365 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudLocationVirtualNetworkModel.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualNetworkInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; + +/** + * Type representing PrivateCloudLocationVirtualNetworkModel. + */ +public interface PrivateCloudLocationVirtualNetworkModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the assignable value. + */ + Boolean assignable(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudResourceType.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudResourceType.java new file mode 100644 index 0000000000000..4917305ce5a91 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/PrivateCloudResourceType.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PrivateCloudResourceType. + */ +public enum PrivateCloudResourceType { + /** Enum value Microsoft.VMwareCloudSimple/privateClouds. */ + MICROSOFT_VMWARE_CLOUD_SIMPLEPRIVATE_CLOUDS("Microsoft.VMwareCloudSimple/privateClouds"); + + /** The actual serialized value for a PrivateCloudResourceType instance. */ + private String value; + + PrivateCloudResourceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PrivateCloudResourceType instance. + * + * @param value the serialized value to parse. + * @return the parsed PrivateCloudResourceType object, or null if unable to parse. + */ + @JsonCreator + public static PrivateCloudResourceType fromString(String value) { + PrivateCloudResourceType[] items = PrivateCloudResourceType.values(); + for (PrivateCloudResourceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/ResourcePoolByPCs.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/ResourcePoolByPCs.java new file mode 100644 index 0000000000000..4e96c6e0271f0 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/ResourcePoolByPCs.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.ResourcePoolByPCsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ResourcePoolByPCs. + */ +public interface ResourcePoolByPCs extends HasInner { + /** + * Implements get of resource pool. + * Returns resource pool templates by its name. + * + * @param pcName The private cloud name + * @param resourcePoolName resource pool id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String pcName, String resourcePoolName); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/ResourcePoolsByPCs.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/ResourcePoolsByPCs.java new file mode 100644 index 0000000000000..574cc8fc901d4 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/ResourcePoolsByPCs.java @@ -0,0 +1,29 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.ResourcePoolsByPCsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ResourcePoolsByPCs. + */ +public interface ResourcePoolsByPCs extends HasInner { + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for private cloud. + * + * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String pcName); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/Sku.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/Sku.java new file mode 100644 index 0000000000000..3404b6fae09f7 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/Sku.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The purchase SKU for CloudSimple paid resources. + */ +public class Sku { + /** + * The capacity of the SKU. + */ + @JsonProperty(value = "capacity") + private String capacity; + + /** + * dedicatedCloudNode example: 8 x Ten-Core Intel® Xeon® Processor E5-2640 + * v4 2.40GHz 25MB Cache (90W); 12 x 64GB PC4-19200 2400MHz DDR4 ECC + * Registered DIMM, ... + */ + @JsonProperty(value = "description") + private String description; + + /** + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /** + * The name of the SKU for VMWare CloudSimple Node. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The tier of the SKU. + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the capacity of the SKU. + * + * @return the capacity value + */ + public String capacity() { + return this.capacity; + } + + /** + * Set the capacity of the SKU. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(String capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get dedicatedCloudNode example: 8 x Ten-Core Intel® Xeon® Processor E5-2640 v4 2.40GHz 25MB Cache (90W); 12 x 64GB PC4-19200 2400MHz DDR4 ECC Registered DIMM, ... + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set dedicatedCloudNode example: 8 x Ten-Core Intel® Xeon® Processor E5-2640 v4 2.40GHz 25MB Cache (90W); 12 x 64GB PC4-19200 2400MHz DDR4 ECC Registered DIMM, ... + * + * @param description the description value to set + * @return the Sku object itself. + */ + public Sku withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set if the service has different generations of hardware, for the same SKU, then that can be captured here. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the name of the SKU for VMWare CloudSimple Node. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU for VMWare CloudSimple Node. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier of the SKU. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier of the SKU. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/SkuAvailability.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/SkuAvailability.java new file mode 100644 index 0000000000000..646296b6ac72f --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/SkuAvailability.java @@ -0,0 +1,60 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.SkuAvailabilityInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; + +/** + * Type representing SkuAvailability. + */ +public interface SkuAvailability extends HasInner, HasManager { + /** + * @return the dedicatedAvailabilityZoneId value. + */ + String dedicatedAvailabilityZoneId(); + + /** + * @return the dedicatedAvailabilityZoneName value. + */ + String dedicatedAvailabilityZoneName(); + + /** + * @return the dedicatedPlacementGroupId value. + */ + String dedicatedPlacementGroupId(); + + /** + * @return the dedicatedPlacementGroupName value. + */ + String dedicatedPlacementGroupName(); + + /** + * @return the limit value. + */ + int limit(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the skuId value. + */ + String skuId(); + + /** + * @return the skuName value. + */ + String skuName(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/SkusAvailabilityWithinRegions.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/SkusAvailabilityWithinRegions.java new file mode 100644 index 0000000000000..bc33785b12603 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/SkusAvailabilityWithinRegions.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.SkuAvailability; + +/** + * Type representing SkusAvailabilityWithinRegions. + */ +public interface SkusAvailabilityWithinRegions { + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/StopMode.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/StopMode.java new file mode 100644 index 0000000000000..6dd9f2ed7cce8 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/StopMode.java @@ -0,0 +1,59 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StopMode. + */ +public enum StopMode { + /** Enum value reboot. */ + REBOOT("reboot"), + + /** Enum value suspend. */ + SUSPEND("suspend"), + + /** Enum value shutdown. */ + SHUTDOWN("shutdown"), + + /** Enum value poweroff. */ + POWEROFF("poweroff"); + + /** The actual serialized value for a StopMode instance. */ + private String value; + + StopMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StopMode instance. + * + * @param value the serialized value to parse. + * @return the parsed StopMode object, or null if unable to parse. + */ + @JsonCreator + public static StopMode fromString(String value) { + StopMode[] items = StopMode.values(); + for (StopMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/Usage.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/Usage.java new file mode 100644 index 0000000000000..0fb976b005977 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/Usage.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.vmwarecloudsimple.v2019_04_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + int currentValue(); + + /** + * @return the limit value. + */ + int limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + UsageCount unit(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsageCount.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsageCount.java new file mode 100644 index 0000000000000..f9e40b9c3b1b4 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsageCount.java @@ -0,0 +1,65 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UsageCount. + */ +public enum UsageCount { + /** Enum value Count. */ + COUNT("Count"), + + /** Enum value Bytes. */ + BYTES("Bytes"), + + /** Enum value Seconds. */ + SECONDS("Seconds"), + + /** Enum value Percent. */ + PERCENT("Percent"), + + /** Enum value CountPerSecond. */ + COUNT_PER_SECOND("CountPerSecond"), + + /** Enum value BytesPerSecond. */ + BYTES_PER_SECOND("BytesPerSecond"); + + /** The actual serialized value for a UsageCount instance. */ + private String value; + + UsageCount(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UsageCount instance. + * + * @param value the serialized value to parse. + * @return the parsed UsageCount object, or null if unable to parse. + */ + @JsonCreator + public static UsageCount fromString(String value) { + UsageCount[] items = UsageCount.values(); + for (UsageCount item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsageName.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsageName.java new file mode 100644 index 0000000000000..08233d7fa494c --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsageName.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User name model. + */ +public class UsageName { + /** + * e.g. "Virtual Machines". + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * resource type or resource type sku name, e.g. virtualMachines. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get e.g. "Virtual Machines". + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set e.g. "Virtual Machines". + * + * @param localizedValue the localizedValue value to set + * @return the UsageName object itself. + */ + public UsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Get resource type or resource type sku name, e.g. virtualMachines. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set resource type or resource type sku name, e.g. virtualMachines. + * + * @param value the value value to set + * @return the UsageName object itself. + */ + public UsageName withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsagesWithinRegions.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsagesWithinRegions.java new file mode 100644 index 0000000000000..dc6d121bdafa6 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/UsagesWithinRegions.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.Usage; + +/** + * Type representing UsagesWithinRegions. + */ +public interface UsagesWithinRegions { + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualDisk.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualDisk.java new file mode 100644 index 0000000000000..b67a7fa563c9f --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualDisk.java @@ -0,0 +1,137 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual disk model. + */ +public class VirtualDisk { + /** + * Disk's Controller id. + */ + @JsonProperty(value = "controllerId", required = true) + private String controllerId; + + /** + * Disk's independence mode type. Possible values include: 'persistent', + * 'independent_persistent', 'independent_nonpersistent'. + */ + @JsonProperty(value = "independenceMode", required = true) + private DiskIndependenceMode independenceMode; + + /** + * Disk's total size. + */ + @JsonProperty(value = "totalSize", required = true) + private int totalSize; + + /** + * Disk's id. + */ + @JsonProperty(value = "virtualDiskId") + private String virtualDiskId; + + /** + * Disk's display name. + */ + @JsonProperty(value = "virtualDiskName", access = JsonProperty.Access.WRITE_ONLY) + private String virtualDiskName; + + /** + * Get disk's Controller id. + * + * @return the controllerId value + */ + public String controllerId() { + return this.controllerId; + } + + /** + * Set disk's Controller id. + * + * @param controllerId the controllerId value to set + * @return the VirtualDisk object itself. + */ + public VirtualDisk withControllerId(String controllerId) { + this.controllerId = controllerId; + return this; + } + + /** + * Get disk's independence mode type. Possible values include: 'persistent', 'independent_persistent', 'independent_nonpersistent'. + * + * @return the independenceMode value + */ + public DiskIndependenceMode independenceMode() { + return this.independenceMode; + } + + /** + * Set disk's independence mode type. Possible values include: 'persistent', 'independent_persistent', 'independent_nonpersistent'. + * + * @param independenceMode the independenceMode value to set + * @return the VirtualDisk object itself. + */ + public VirtualDisk withIndependenceMode(DiskIndependenceMode independenceMode) { + this.independenceMode = independenceMode; + return this; + } + + /** + * Get disk's total size. + * + * @return the totalSize value + */ + public int totalSize() { + return this.totalSize; + } + + /** + * Set disk's total size. + * + * @param totalSize the totalSize value to set + * @return the VirtualDisk object itself. + */ + public VirtualDisk withTotalSize(int totalSize) { + this.totalSize = totalSize; + return this; + } + + /** + * Get disk's id. + * + * @return the virtualDiskId value + */ + public String virtualDiskId() { + return this.virtualDiskId; + } + + /** + * Set disk's id. + * + * @param virtualDiskId the virtualDiskId value to set + * @return the VirtualDisk object itself. + */ + public VirtualDisk withVirtualDiskId(String virtualDiskId) { + this.virtualDiskId = virtualDiskId; + return this; + } + + /** + * Get disk's display name. + * + * @return the virtualDiskName value + */ + public String virtualDiskName() { + return this.virtualDiskName; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualDiskController.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualDiskController.java new file mode 100644 index 0000000000000..38176e287257e --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualDiskController.java @@ -0,0 +1,78 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual disk controller model. + */ +public class VirtualDiskController { + /** + * Controller's id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The display name of Controller. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * dik controller subtype (VMWARE_PARAVIRTUAL, BUS_PARALLEL, LSI_PARALLEL, + * LSI_SAS). + */ + @JsonProperty(value = "subType", access = JsonProperty.Access.WRITE_ONLY) + private String subType; + + /** + * disk controller type (SCSI). + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get controller's id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the display name of Controller. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get dik controller subtype (VMWARE_PARAVIRTUAL, BUS_PARALLEL, LSI_PARALLEL, LSI_SAS). + * + * @return the subType value + */ + public String subType() { + return this.subType; + } + + /** + * Get disk controller type (SCSI). + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachine.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachine.java new file mode 100644 index 0000000000000..f0704fa9fdeef --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachine.java @@ -0,0 +1,427 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +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.vmwarecloudsimple.v2019_04_01.implementation.VMwareCloudSimpleManager; +import java.util.List; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.ResourcePoolInner; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualMachineInner; + +/** + * Type representing VirtualMachine. + */ +public interface VirtualMachine extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the amountOfRam value. + */ + int amountOfRam(); + + /** + * @return the controllers value. + */ + List controllers(); + + /** + * @return the disks value. + */ + List disks(); + + /** + * @return the dnsname value. + */ + String dnsname(); + + /** + * @return the exposeToGuestVM value. + */ + Boolean exposeToGuestVM(); + + /** + * @return the folder value. + */ + String folder(); + + /** + * @return the guestOS value. + */ + String guestOS(); + + /** + * @return the guestOSType value. + */ + GuestOSType guestOSType(); + + /** + * @return the nics value. + */ + List nics(); + + /** + * @return the numberOfCores value. + */ + int numberOfCores(); + + /** + * @return the password value. + */ + String password(); + + /** + * @return the privateCloudId value. + */ + String privateCloudId(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publicIP value. + */ + String publicIP(); + + /** + * @return the resourcePool value. + */ + PrivateCloudLocationResourcePool resourcePool(); + + /** + * @return the status value. + */ + VirtualMachineStatus status(); + + /** + * @return the templateId value. + */ + String templateId(); + + /** + * @return the username value. + */ + String username(); + + /** + * @return the vmId value. + */ + String vmId(); + + /** + * @return the vmwaretools value. + */ + String vmwaretools(); + + /** + * @return the vSphereNetworks value. + */ + List vSphereNetworks(); + + /** + * The entirety of the VirtualMachine definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithAmountOfRam, DefinitionStages.WithGuestOS, DefinitionStages.WithGuestOSType, DefinitionStages.WithNumberOfCores, DefinitionStages.WithPrivateCloudId, DefinitionStages.WithCreate { + } + + /** + * Grouping of VirtualMachine definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VirtualMachine definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the VirtualMachine definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the virtualmachine definition allowing to specify AmountOfRam. + */ + interface WithAmountOfRam { + /** + * Specifies amountOfRam. + * @param amountOfRam The amount of memory + * @return the next definition stage +*/ + WithGuestOS withAmountOfRam(int amountOfRam); + } + + /** + * The stage of the virtualmachine definition allowing to specify GuestOS. + */ + interface WithGuestOS { + /** + * Specifies guestOS. + * @param guestOS The name of Guest OS + * @return the next definition stage +*/ + WithGuestOSType withGuestOS(String guestOS); + } + + /** + * The stage of the virtualmachine definition allowing to specify GuestOSType. + */ + interface WithGuestOSType { + /** + * Specifies guestOSType. + * @param guestOSType The Guest OS type. Possible values include: 'linux', 'windows', 'other' + * @return the next definition stage +*/ + WithNumberOfCores withGuestOSType(GuestOSType guestOSType); + } + + /** + * The stage of the virtualmachine definition allowing to specify NumberOfCores. + */ + interface WithNumberOfCores { + /** + * Specifies numberOfCores. + * @param numberOfCores The number of CPU cores + * @return the next definition stage +*/ + WithPrivateCloudId withNumberOfCores(int numberOfCores); + } + + /** + * The stage of the virtualmachine definition allowing to specify PrivateCloudId. + */ + interface WithPrivateCloudId { + /** + * Specifies privateCloudId. + * @param privateCloudId Private Cloud Id + * @return the next definition stage +*/ + WithCreate withPrivateCloudId(String privateCloudId); + } + + /** + * The stage of the virtualmachine definition allowing to specify Disks. + */ + interface WithDisks { + /** + * Specifies disks. + * @param disks The list of Virtual Disks + * @return the next definition stage + */ + WithCreate withDisks(List disks); + } + + /** + * The stage of the virtualmachine definition allowing to specify ExposeToGuestVM. + */ + interface WithExposeToGuestVM { + /** + * Specifies exposeToGuestVM. + * @param exposeToGuestVM Expose Guest OS or not + * @return the next definition stage + */ + WithCreate withExposeToGuestVM(Boolean exposeToGuestVM); + } + + /** + * The stage of the virtualmachine definition allowing to specify Nics. + */ + interface WithNics { + /** + * Specifies nics. + * @param nics The list of Virtual NICs + * @return the next definition stage + */ + WithCreate withNics(List nics); + } + + /** + * The stage of the virtualmachine definition allowing to specify Password. + */ + interface WithPassword { + /** + * Specifies password. + * @param password Password for login + * @return the next definition stage + */ + WithCreate withPassword(String password); + } + + /** + * The stage of the virtualmachine definition allowing to specify ResourcePool. + */ + interface WithResourcePool { + /** + * Specifies resourcePool. + * @param resourcePool Virtual Machines Resource Pool + * @return the next definition stage + */ + WithCreate withResourcePool(ResourcePoolInner resourcePool); + } + + /** + * The stage of the virtualmachine definition allowing to specify TemplateId. + */ + interface WithTemplateId { + /** + * Specifies templateId. + * @param templateId Virtual Machine Template Id + * @return the next definition stage + */ + WithCreate withTemplateId(String templateId); + } + + /** + * The stage of the virtualmachine definition allowing to specify Username. + */ + interface WithUsername { + /** + * Specifies username. + * @param username Username for login + * @return the next definition stage + */ + WithCreate withUsername(String username); + } + + /** + * The stage of the virtualmachine definition allowing to specify VSphereNetworks. + */ + interface WithVSphereNetworks { + /** + * Specifies vSphereNetworks. + * @param vSphereNetworks The list of Virtual VSphere Networks + * @return the next definition stage + */ + WithCreate withVSphereNetworks(List vSphereNetworks); + } + + /** + * 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.WithDisks, DefinitionStages.WithExposeToGuestVM, DefinitionStages.WithNics, DefinitionStages.WithPassword, DefinitionStages.WithResourcePool, DefinitionStages.WithTemplateId, DefinitionStages.WithUsername, DefinitionStages.WithVSphereNetworks { + } + } + /** + * The template for a VirtualMachine update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDisks, UpdateStages.WithExposeToGuestVM, UpdateStages.WithNics, UpdateStages.WithPassword, UpdateStages.WithResourcePool, UpdateStages.WithTemplateId, UpdateStages.WithUsername, UpdateStages.WithVSphereNetworks { + } + + /** + * Grouping of VirtualMachine update stages. + */ + interface UpdateStages { + /** + * The stage of the virtualmachine update allowing to specify Disks. + */ + interface WithDisks { + /** + * Specifies disks. + * @param disks The list of Virtual Disks + * @return the next update stage + */ + Update withDisks(List disks); + } + + /** + * The stage of the virtualmachine update allowing to specify ExposeToGuestVM. + */ + interface WithExposeToGuestVM { + /** + * Specifies exposeToGuestVM. + * @param exposeToGuestVM Expose Guest OS or not + * @return the next update stage + */ + Update withExposeToGuestVM(Boolean exposeToGuestVM); + } + + /** + * The stage of the virtualmachine update allowing to specify Nics. + */ + interface WithNics { + /** + * Specifies nics. + * @param nics The list of Virtual NICs + * @return the next update stage + */ + Update withNics(List nics); + } + + /** + * The stage of the virtualmachine update allowing to specify Password. + */ + interface WithPassword { + /** + * Specifies password. + * @param password Password for login + * @return the next update stage + */ + Update withPassword(String password); + } + + /** + * The stage of the virtualmachine update allowing to specify ResourcePool. + */ + interface WithResourcePool { + /** + * Specifies resourcePool. + * @param resourcePool Virtual Machines Resource Pool + * @return the next update stage + */ + Update withResourcePool(ResourcePoolInner resourcePool); + } + + /** + * The stage of the virtualmachine update allowing to specify TemplateId. + */ + interface WithTemplateId { + /** + * Specifies templateId. + * @param templateId Virtual Machine Template Id + * @return the next update stage + */ + Update withTemplateId(String templateId); + } + + /** + * The stage of the virtualmachine update allowing to specify Username. + */ + interface WithUsername { + /** + * Specifies username. + * @param username Username for login + * @return the next update stage + */ + Update withUsername(String username); + } + + /** + * The stage of the virtualmachine update allowing to specify VSphereNetworks. + */ + interface WithVSphereNetworks { + /** + * Specifies vSphereNetworks. + * @param vSphereNetworks The list of Virtual VSphere Networks + * @return the next update stage + */ + Update withVSphereNetworks(List vSphereNetworks); + } + + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineCreateOrUpdateHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..0b77b1bf98898 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineCreateOrUpdateHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for CreateOrUpdate operation. + */ +public class VirtualMachineCreateOrUpdateHeaders { + /** + * The azureAsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the VirtualMachineCreateOrUpdateHeaders object itself. + */ + public VirtualMachineCreateOrUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineDeleteHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineDeleteHeaders.java new file mode 100644 index 0000000000000..df1e230e53c2e --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineDeleteHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Delete operation. + */ +public class VirtualMachineDeleteHeaders { + /** + * The azureAsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * The location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The retryAfter property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * The contentType property. + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the VirtualMachineDeleteHeaders object itself. + */ + public VirtualMachineDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the VirtualMachineDeleteHeaders object itself. + */ + public VirtualMachineDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the VirtualMachineDeleteHeaders object itself. + */ + public VirtualMachineDeleteHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the VirtualMachineDeleteHeaders object itself. + */ + public VirtualMachineDeleteHeaders withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStartHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStartHeaders.java new file mode 100644 index 0000000000000..6276473c118ae --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStartHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Start operation. + */ +public class VirtualMachineStartHeaders { + /** + * The azureAsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * The location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The retryAfter property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * The contentType property. + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the VirtualMachineStartHeaders object itself. + */ + public VirtualMachineStartHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the VirtualMachineStartHeaders object itself. + */ + public VirtualMachineStartHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the VirtualMachineStartHeaders object itself. + */ + public VirtualMachineStartHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the VirtualMachineStartHeaders object itself. + */ + public VirtualMachineStartHeaders withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStatus.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStatus.java new file mode 100644 index 0000000000000..64e1acc5b5c04 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStatus.java @@ -0,0 +1,65 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for VirtualMachineStatus. + */ +public enum VirtualMachineStatus { + /** Enum value running. */ + RUNNING("running"), + + /** Enum value suspended. */ + SUSPENDED("suspended"), + + /** Enum value poweredoff. */ + POWEREDOFF("poweredoff"), + + /** Enum value updating. */ + UPDATING("updating"), + + /** Enum value deallocating. */ + DEALLOCATING("deallocating"), + + /** Enum value deleting. */ + DELETING("deleting"); + + /** The actual serialized value for a VirtualMachineStatus instance. */ + private String value; + + VirtualMachineStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VirtualMachineStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed VirtualMachineStatus object, or null if unable to parse. + */ + @JsonCreator + public static VirtualMachineStatus fromString(String value) { + VirtualMachineStatus[] items = VirtualMachineStatus.values(); + for (VirtualMachineStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStopHeaders.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStopHeaders.java new file mode 100644 index 0000000000000..2de04c0bfe0bb --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStopHeaders.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Stop operation. + */ +public class VirtualMachineStopHeaders { + /** + * The azureAsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * The location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * The retryAfter property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * The contentType property. + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the VirtualMachineStopHeaders object itself. + */ + public VirtualMachineStopHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the VirtualMachineStopHeaders object itself. + */ + public VirtualMachineStopHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the VirtualMachineStopHeaders object itself. + */ + public VirtualMachineStopHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the VirtualMachineStopHeaders object itself. + */ + public VirtualMachineStopHeaders withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStopMode.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStopMode.java new file mode 100644 index 0000000000000..4860df0d86e76 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineStopMode.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.vmwarecloudsimple.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of virtual machine stop modes. + */ +public class VirtualMachineStopMode { + /** + * mode indicates a type of stop operation - reboot, suspend, shutdown or + * power-off. Possible values include: 'reboot', 'suspend', 'shutdown', + * 'poweroff'. + */ + @JsonProperty(value = "mode") + private StopMode mode; + + /** + * Get mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff'. + * + * @return the mode value + */ + public StopMode mode() { + return this.mode; + } + + /** + * Set mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff'. + * + * @param mode the mode value to set + * @return the VirtualMachineStopMode object itself. + */ + public VirtualMachineStopMode withMode(StopMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineTemplateByPCs.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineTemplateByPCs.java new file mode 100644 index 0000000000000..18bdb206a21c4 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineTemplateByPCs.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualMachineTemplateByPCsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualMachineTemplateByPCs. + */ +public interface VirtualMachineTemplateByPCs extends HasInner { + /** + * Implements virtual machine template GET method. + * Returns virtual machine templates by its name. + * + * @param pcName The private cloud name + * @param virtualMachineTemplateName virtual machine template id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String pcName, String virtualMachineTemplateName); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineTemplatesByPCs.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineTemplatesByPCs.java new file mode 100644 index 0000000000000..d63bfbbd123b6 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachineTemplatesByPCs.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualMachineTemplatesByPCsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualMachineTemplatesByPCs. + */ +public interface VirtualMachineTemplatesByPCs extends HasInner { + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String pcName, final String resourcePoolName); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachines.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachines.java new file mode 100644 index 0000000000000..bf7ca76b24f06 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualMachines.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.vmwarecloudsimple.v2019_04_01; + +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 rx.Completable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualMachinesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualMachines. + */ +public interface VirtualMachines extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String virtualMachineName); + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String virtualMachineName); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNetworkByPCs.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNetworkByPCs.java new file mode 100644 index 0000000000000..49161d0ea9458 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNetworkByPCs.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualNetworkByPCsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworkByPCs. + */ +public interface VirtualNetworkByPCs extends HasInner { + /** + * Implements virtual network GET method. + * Return virtual network by its name. + * + * @param pcName The private cloud name + * @param virtualNetworkName virtual network id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String pcName, String virtualNetworkName); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNetworksByPCs.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNetworksByPCs.java new file mode 100644 index 0000000000000..dd940db7abb1d --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNetworksByPCs.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.vmwarecloudsimple.v2019_04_01; + +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualNetworksByPCsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing VirtualNetworksByPCs. + */ +public interface VirtualNetworksByPCs extends HasInner { + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String pcName, final String resourcePoolName); + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNic.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNic.java new file mode 100644 index 0000000000000..4fc1c55210ae5 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/VirtualNic.java @@ -0,0 +1,191 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01; + +import java.util.List; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation.VirtualNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual NIC model. + */ +public class VirtualNic { + /** + * NIC ip address. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** + * NIC MAC address. + */ + @JsonProperty(value = "macAddress") + private String macAddress; + + /** + * The list of Virtual Networks. + */ + @JsonProperty(value = "network") + private VirtualNetworkInner network; + + /** + * NIC type. Possible values include: 'E1000', 'E1000E', 'PCNET32', + * 'VMXNET', 'VMXNET2', 'VMXNET3'. + */ + @JsonProperty(value = "nicType", required = true) + private NICType nicType; + + /** + * Is NIC powered on/off on boot. + */ + @JsonProperty(value = "powerOnBoot") + private Boolean powerOnBoot; + + /** + * NIC id. + */ + @JsonProperty(value = "virtualNicId") + private String virtualNicId; + + /** + * NIC name. + */ + @JsonProperty(value = "virtualNicName", access = JsonProperty.Access.WRITE_ONLY) + private String virtualNicName; + + /** + * Get nIC ip address. + * + * @return the ipAddresses value + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set nIC ip address. + * + * @param ipAddresses the ipAddresses value to set + * @return the VirtualNic object itself. + */ + public VirtualNic withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Get nIC MAC address. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set nIC MAC address. + * + * @param macAddress the macAddress value to set + * @return the VirtualNic object itself. + */ + public VirtualNic withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get the list of Virtual Networks. + * + * @return the network value + */ + public VirtualNetworkInner network() { + return this.network; + } + + /** + * Set the list of Virtual Networks. + * + * @param network the network value to set + * @return the VirtualNic object itself. + */ + public VirtualNic withNetwork(VirtualNetworkInner network) { + this.network = network; + return this; + } + + /** + * Get nIC type. Possible values include: 'E1000', 'E1000E', 'PCNET32', 'VMXNET', 'VMXNET2', 'VMXNET3'. + * + * @return the nicType value + */ + public NICType nicType() { + return this.nicType; + } + + /** + * Set nIC type. Possible values include: 'E1000', 'E1000E', 'PCNET32', 'VMXNET', 'VMXNET2', 'VMXNET3'. + * + * @param nicType the nicType value to set + * @return the VirtualNic object itself. + */ + public VirtualNic withNicType(NICType nicType) { + this.nicType = nicType; + return this; + } + + /** + * Get is NIC powered on/off on boot. + * + * @return the powerOnBoot value + */ + public Boolean powerOnBoot() { + return this.powerOnBoot; + } + + /** + * Set is NIC powered on/off on boot. + * + * @param powerOnBoot the powerOnBoot value to set + * @return the VirtualNic object itself. + */ + public VirtualNic withPowerOnBoot(Boolean powerOnBoot) { + this.powerOnBoot = powerOnBoot; + return this; + } + + /** + * Get nIC id. + * + * @return the virtualNicId value + */ + public String virtualNicId() { + return this.virtualNicId; + } + + /** + * Set nIC id. + * + * @param virtualNicId the virtualNicId value to set + * @return the VirtualNic object itself. + */ + public VirtualNic withVirtualNicId(String virtualNicId) { + this.virtualNicId = virtualNicId; + return this; + } + + /** + * Get nIC name. + * + * @return the virtualNicName value + */ + public String virtualNicName() { + return this.virtualNicName; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationImpl.java new file mode 100644 index 0000000000000..311933a9fd195 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationImpl.java @@ -0,0 +1,54 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperationDisplay; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.OperationOrigin; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperationDisplayPropertyServiceSpecificationMetricsList; + +class AvailableOperationImpl extends WrapperImpl implements AvailableOperation { + private final VMwareCloudSimpleManager manager; + AvailableOperationImpl(AvailableOperationInner inner, VMwareCloudSimpleManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + @Override + public AvailableOperationDisplay display() { + return this.inner().display(); + } + + @Override + public Boolean isDataAction() { + return this.inner().isDataAction(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public OperationOrigin origin() { + return this.inner().origin(); + } + + @Override + public AvailableOperationDisplayPropertyServiceSpecificationMetricsList serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationInner.java new file mode 100644 index 0000000000000..6ea552f6d42f8 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationInner.java @@ -0,0 +1,153 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperationDisplay; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.OperationOrigin; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperationDisplayPropertyServiceSpecificationMetricsList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Resource provider available operation model. + */ +@JsonFlatten +public class AvailableOperationInner { + /** + * The list of operations. + */ + @JsonProperty(value = "display") + private AvailableOperationDisplay display; + + /** + * Indicating whether the operation is a data action or not. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The origin of operation. Possible values include: 'user', 'system', + * 'user,system'. + */ + @JsonProperty(value = "origin") + private OperationOrigin origin; + + /** + * The list of specification's service metrics. + */ + @JsonProperty(value = "properties.serviceSpecification") + private AvailableOperationDisplayPropertyServiceSpecificationMetricsList serviceSpecification; + + /** + * Get the list of operations. + * + * @return the display value + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set the list of operations. + * + * @param display the display value to set + * @return the AvailableOperationInner object itself. + */ + public AvailableOperationInner withDisplay(AvailableOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get indicating whether the operation is a data action or not. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set indicating whether the operation is a data action or not. + * + * @param isDataAction the isDataAction value to set + * @return the AvailableOperationInner object itself. + */ + public AvailableOperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + * + * @param name the name value to set + * @return the AvailableOperationInner object itself. + */ + public AvailableOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the origin of operation. Possible values include: 'user', 'system', 'user,system'. + * + * @return the origin value + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Set the origin of operation. Possible values include: 'user', 'system', 'user,system'. + * + * @param origin the origin value to set + * @return the AvailableOperationInner object itself. + */ + public AvailableOperationInner withOrigin(OperationOrigin origin) { + this.origin = origin; + return this; + } + + /** + * Get the list of specification's service metrics. + * + * @return the serviceSpecification value + */ + public AvailableOperationDisplayPropertyServiceSpecificationMetricsList serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the list of specification's service metrics. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the AvailableOperationInner object itself. + */ + public AvailableOperationInner withServiceSpecification(AvailableOperationDisplayPropertyServiceSpecificationMetricsList serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationsImpl.java new file mode 100644 index 0000000000000..f8a3937e99007 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationsImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperation; + +class AvailableOperationsImpl extends WrapperImpl implements AvailableOperations { + private final VMwareCloudSimpleManager manager; + + AvailableOperationsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().availableOperations()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + AvailableOperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AvailableOperation call(AvailableOperationInner inner) { + return new AvailableOperationImpl(inner, manager()); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationsInner.java new file mode 100644 index 0000000000000..8eecf503a3f1d --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/AvailableOperationsInner.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. + */ + +package com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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 AvailableOperations. + */ +public class AvailableOperationsInner { + /** The Retrofit service to perform REST calls. */ + private AvailableOperationsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of AvailableOperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableOperationsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(AvailableOperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableOperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.AvailableOperations list" }) + @GET("providers/Microsoft.VMwareCloudSimple/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.vmwarecloudsimple.v2019_04_01.AvailableOperations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements list of available operations. + * Return list of operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<AvailableOperationInner> 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(); + } + }; + } + + /** + * Implements list of available operations. + * Return list of 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); + } + + /** + * Implements list of available operations. + * Return list of operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableOperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of available operations. + * Return list of operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AvailableOperationInner> 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)); + } + }); + } + + /** + * Implements list of available operations. + * Return list of operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AvailableOperationInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of available operations. + * Return list of operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<AvailableOperationInner> 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(); + } + }; + } + + /** + * Implements list of available operations. + * Return list of 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); + } + + /** + * Implements list of available operations. + * Return list of 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<AvailableOperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of available operations. + * Return list of 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<AvailableOperationInner> 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)); + } + }); + } + + /** + * Implements list of available operations. + * Return list of 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<AvailableOperationInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodeImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodeImpl.java new file mode 100644 index 0000000000000..1149a0cd02936 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodeImpl.java @@ -0,0 +1,171 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNode; +import rx.Observable; +import java.util.UUID; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.NodeStatus; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.Sku; + +class DedicatedCloudNodeImpl extends GroupableResourceCoreImpl implements DedicatedCloudNode, DedicatedCloudNode.Definition, DedicatedCloudNode.Update { + DedicatedCloudNodeImpl(String name, DedicatedCloudNodeInner inner, VMwareCloudSimpleManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DedicatedCloudNodesInner client = this.manager().inner().dedicatedCloudNodes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DedicatedCloudNodesInner client = this.manager().inner().dedicatedCloudNodes(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DedicatedCloudNodesInner client = this.manager().inner().dedicatedCloudNodes(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String availabilityZoneId() { + return this.inner().availabilityZoneId(); + } + + @Override + public String availabilityZoneName() { + return this.inner().availabilityZoneName(); + } + + @Override + public String cloudRackName() { + return this.inner().cloudRackName(); + } + + @Override + public Object created() { + return this.inner().created(); + } + + @Override + public String id1() { + return this.inner().id1(); + } + + @Override + public String name1() { + return this.inner().name1(); + } + + @Override + public int nodesCount() { + return this.inner().nodesCount(); + } + + @Override + public String placementGroupId() { + return this.inner().placementGroupId(); + } + + @Override + public String placementGroupName() { + return this.inner().placementGroupName(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String privateCloudName() { + return this.inner().privateCloudName(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public UUID purchaseId() { + return this.inner().purchaseId(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public NodeStatus status() { + return this.inner().status(); + } + + @Override + public String vmwareClusterName() { + return this.inner().vmwareClusterName(); + } + + @Override + public DedicatedCloudNodeImpl withAvailabilityZoneId(String availabilityZoneId) { + this.inner().withAvailabilityZoneId(availabilityZoneId); + return this; + } + + @Override + public DedicatedCloudNodeImpl withId1(String id1) { + this.inner().withId1(id1); + return this; + } + + @Override + public DedicatedCloudNodeImpl withName1(String name1) { + this.inner().withName1(name1); + return this; + } + + @Override + public DedicatedCloudNodeImpl withNodesCount(int nodesCount) { + this.inner().withNodesCount(nodesCount); + return this; + } + + @Override + public DedicatedCloudNodeImpl withPlacementGroupId(String placementGroupId) { + this.inner().withPlacementGroupId(placementGroupId); + return this; + } + + @Override + public DedicatedCloudNodeImpl withPurchaseId(UUID purchaseId) { + this.inner().withPurchaseId(purchaseId); + return this; + } + + @Override + public DedicatedCloudNodeImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodeInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodeInner.java new file mode 100644 index 0000000000000..77da6a319d67b --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodeInner.java @@ -0,0 +1,341 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import java.util.UUID; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.NodeStatus; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Dedicated cloud node model. + */ +@JsonFlatten +public class DedicatedCloudNodeInner extends Resource { + /** + * Availability Zone id, e.g. "az1". + */ + @JsonProperty(value = "properties.availabilityZoneId", required = true) + private String availabilityZoneId; + + /** + * Availability Zone name, e.g. "Availability Zone 1". + */ + @JsonProperty(value = "properties.availabilityZoneName", access = JsonProperty.Access.WRITE_ONLY) + private String availabilityZoneName; + + /** + * VMWare Cloud Rack Name. + */ + @JsonProperty(value = "properties.cloudRackName", access = JsonProperty.Access.WRITE_ONLY) + private String cloudRackName; + + /** + * date time the resource was created. + */ + @JsonProperty(value = "properties.created", access = JsonProperty.Access.WRITE_ONLY) + private Object created; + + /** + * count of nodes to create. + */ + @JsonProperty(value = "properties.nodesCount", required = true) + private int nodesCount; + + /** + * Placement Group id, e.g. "n1". + */ + @JsonProperty(value = "properties.placementGroupId", required = true) + private String placementGroupId; + + /** + * Placement Name, e.g. "Placement Group 1". + */ + @JsonProperty(value = "properties.placementGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String placementGroupName; + + /** + * Private Cloud Id. + */ + @JsonProperty(value = "properties.privateCloudId", access = JsonProperty.Access.WRITE_ONLY) + private String privateCloudId; + + /** + * Resource Pool Name. + */ + @JsonProperty(value = "properties.privateCloudName", access = JsonProperty.Access.WRITE_ONLY) + private String privateCloudName; + + /** + * The provisioning status of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * purchase id. + */ + @JsonProperty(value = "properties.purchaseId", required = true) + private UUID purchaseId; + + /** + * SKU's id. + */ + @JsonProperty(value = "properties.skuDescription.id", required = true) + private String id1; + + /** + * SKU's name. + */ + @JsonProperty(value = "properties.skuDescription.name", required = true) + private String name1; + + /** + * Node status, indicates is private cloud set up on this node or not. + * Possible values include: 'unused', 'used'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private NodeStatus status; + + /** + * VMWare Cluster Name. + */ + @JsonProperty(value = "properties.vmwareClusterName", access = JsonProperty.Access.WRITE_ONLY) + private String vmwareClusterName; + + /** + * Dedicated Cloud Nodes SKU. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get availability Zone id, e.g. "az1". + * + * @return the availabilityZoneId value + */ + public String availabilityZoneId() { + return this.availabilityZoneId; + } + + /** + * Set availability Zone id, e.g. "az1". + * + * @param availabilityZoneId the availabilityZoneId value to set + * @return the DedicatedCloudNodeInner object itself. + */ + public DedicatedCloudNodeInner withAvailabilityZoneId(String availabilityZoneId) { + this.availabilityZoneId = availabilityZoneId; + return this; + } + + /** + * Get availability Zone name, e.g. "Availability Zone 1". + * + * @return the availabilityZoneName value + */ + public String availabilityZoneName() { + return this.availabilityZoneName; + } + + /** + * Get vMWare Cloud Rack Name. + * + * @return the cloudRackName value + */ + public String cloudRackName() { + return this.cloudRackName; + } + + /** + * Get date time the resource was created. + * + * @return the created value + */ + public Object created() { + return this.created; + } + + /** + * Get count of nodes to create. + * + * @return the nodesCount value + */ + public int nodesCount() { + return this.nodesCount; + } + + /** + * Set count of nodes to create. + * + * @param nodesCount the nodesCount value to set + * @return the DedicatedCloudNodeInner object itself. + */ + public DedicatedCloudNodeInner withNodesCount(int nodesCount) { + this.nodesCount = nodesCount; + return this; + } + + /** + * Get placement Group id, e.g. "n1". + * + * @return the placementGroupId value + */ + public String placementGroupId() { + return this.placementGroupId; + } + + /** + * Set placement Group id, e.g. "n1". + * + * @param placementGroupId the placementGroupId value to set + * @return the DedicatedCloudNodeInner object itself. + */ + public DedicatedCloudNodeInner withPlacementGroupId(String placementGroupId) { + this.placementGroupId = placementGroupId; + return this; + } + + /** + * Get placement Name, e.g. "Placement Group 1". + * + * @return the placementGroupName value + */ + public String placementGroupName() { + return this.placementGroupName; + } + + /** + * Get private Cloud Id. + * + * @return the privateCloudId value + */ + public String privateCloudId() { + return this.privateCloudId; + } + + /** + * Get resource Pool Name. + * + * @return the privateCloudName value + */ + public String privateCloudName() { + return this.privateCloudName; + } + + /** + * Get the provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get purchase id. + * + * @return the purchaseId value + */ + public UUID purchaseId() { + return this.purchaseId; + } + + /** + * Set purchase id. + * + * @param purchaseId the purchaseId value to set + * @return the DedicatedCloudNodeInner object itself. + */ + public DedicatedCloudNodeInner withPurchaseId(UUID purchaseId) { + this.purchaseId = purchaseId; + return this; + } + + /** + * Get sKU's id. + * + * @return the id1 value + */ + public String id1() { + return this.id1; + } + + /** + * Set sKU's id. + * + * @param id1 the id1 value to set + * @return the DedicatedCloudNodeInner object itself. + */ + public DedicatedCloudNodeInner withId1(String id1) { + this.id1 = id1; + return this; + } + + /** + * Get sKU's name. + * + * @return the name1 value + */ + public String name1() { + return this.name1; + } + + /** + * Set sKU's name. + * + * @param name1 the name1 value to set + * @return the DedicatedCloudNodeInner object itself. + */ + public DedicatedCloudNodeInner withName1(String name1) { + this.name1 = name1; + return this; + } + + /** + * Get node status, indicates is private cloud set up on this node or not. Possible values include: 'unused', 'used'. + * + * @return the status value + */ + public NodeStatus status() { + return this.status; + } + + /** + * Get vMWare Cluster Name. + * + * @return the vmwareClusterName value + */ + public String vmwareClusterName() { + return this.vmwareClusterName; + } + + /** + * Get dedicated Cloud Nodes SKU. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set dedicated Cloud Nodes SKU. + * + * @param sku the sku value to set + * @return the DedicatedCloudNodeInner object itself. + */ + public DedicatedCloudNodeInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodesImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodesImpl.java new file mode 100644 index 0000000000000..37a8b7ce86b19 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodesImpl.java @@ -0,0 +1,138 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNode; +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; + +class DedicatedCloudNodesImpl extends GroupableResourcesCoreImpl implements DedicatedCloudNodes { + protected DedicatedCloudNodesImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().dedicatedCloudNodes(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DedicatedCloudNodesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DedicatedCloudNodesInner 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) { + DedicatedCloudNodesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DedicatedCloudNodesInner 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 DedicatedCloudNode call(DedicatedCloudNodeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DedicatedCloudNodesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DedicatedCloudNodesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DedicatedCloudNode call(DedicatedCloudNodeInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DedicatedCloudNodeImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DedicatedCloudNodeImpl wrapModel(DedicatedCloudNodeInner inner) { + return new DedicatedCloudNodeImpl(inner.name(), inner, manager()); + } + + @Override + protected DedicatedCloudNodeImpl wrapModel(String name) { + return new DedicatedCloudNodeImpl(name, new DedicatedCloudNodeInner(), this.manager()); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodesInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodesInner.java new file mode 100644 index 0000000000000..26dd0d3494fc6 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudNodesInner.java @@ -0,0 +1,1373 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.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.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodeCreateOrUpdateHeaders; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodeDeleteHeaders; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PatchPayload; +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.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +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 DedicatedCloudNodes. + */ +public class DedicatedCloudNodesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DedicatedCloudNodesService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of DedicatedCloudNodesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DedicatedCloudNodesInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(DedicatedCloudNodesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DedicatedCloudNodes to be + * used by Retrofit to perform actually REST calls. + */ + interface DedicatedCloudNodesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skipToken") String skipToken, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skipToken") String skipToken, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudNodeName") String dedicatedCloudNodeName, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudNodeName") String dedicatedCloudNodeName, @Header("Referer") String referer, @Body DedicatedCloudNodeInner dedicatedCloudNodeRequest, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudNodeName") String dedicatedCloudNodeName, @Header("Referer") String referer, @Body DedicatedCloudNodeInner dedicatedCloudNodeRequest, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudNodeName") String dedicatedCloudNodeName, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudNodeName") String dedicatedCloudNodeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PatchPayload dedicatedCloudNodeRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes listNext" }) + @GET + Observable> listNext(@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.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudNodeInner> 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(); + } + }; + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within 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); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> 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)); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudNodeInner> 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."); + } + final String filter = null; + final Integer top = null; + final String skipToken = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, skipToken, 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); + } + } + }); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudNodeInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(filter, top, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @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 filter, final Integer top, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final String skipToken) { + return listWithServiceResponseAsync(filter, top, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final String skipToken) { + return listSinglePageAsync(filter, top, skipToken) + .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)); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + ServiceResponse> * @param filter The filter to apply on the list operation + ServiceResponse> * @param top The maximum number of record sets to return + ServiceResponse> * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudNodeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final String skipToken) { + 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(), filter, top, skipToken, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudNodeInner> 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(); + } + }; + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> 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)); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudNodeInner> 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."); + } + final String filter = null; + final Integer top = null; + final String skipToken = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, skipToken, 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); + } + } + }); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudNodeInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @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 String filter, final Integer top, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudNodeInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken) + .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)); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group + ServiceResponse> * @param filter The filter to apply on the list operation + ServiceResponse> * @param top The maximum number of record sets to return + ServiceResponse> * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudNodeInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + 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(), filter, top, skipToken, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements dedicated cloud node GET method. + * Returns dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudNodeInner object if successful. + */ + public DedicatedCloudNodeInner getByResourceGroup(String resourceGroupName, String dedicatedCloudNodeName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName).toBlocking().single().body(); + } + + /** + * Implements dedicated cloud node GET method. + * Returns dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node 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 getByResourceGroupAsync(String resourceGroupName, String dedicatedCloudNodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName), serviceCallback); + } + + /** + * Implements dedicated cloud node GET method. + * Returns dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String dedicatedCloudNodeName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName).map(new Func1, DedicatedCloudNodeInner>() { + @Override + public DedicatedCloudNodeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements dedicated cloud node GET method. + * Returns dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudNodeName) { + 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 (dedicatedCloudNodeName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeName is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, dedicatedCloudNodeName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudNodeInner object if successful. + */ + public DedicatedCloudNodeInner createOrUpdate(String resourceGroupName, String dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest).toBlocking().last().body(); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @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 dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest), serviceCallback); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest).map(new Func1, DedicatedCloudNodeInner>() { + @Override + public DedicatedCloudNodeInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest) { + 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 (dedicatedCloudNodeName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (dedicatedCloudNodeRequest == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeRequest 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(dedicatedCloudNodeRequest); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, dedicatedCloudNodeName, this.client.referer(), dedicatedCloudNodeRequest, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), DedicatedCloudNodeCreateOrUpdateHeaders.class); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudNodeInner object if successful. + */ + public DedicatedCloudNodeInner beginCreateOrUpdate(String resourceGroupName, String dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest).toBlocking().single().body(); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @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 dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest), serviceCallback); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, dedicatedCloudNodeRequest).map(new Func1, DedicatedCloudNodeInner>() { + @Override + public DedicatedCloudNodeInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements dedicated cloud node PUT method. + * Returns dedicated cloud node by its name. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param dedicatedCloudNodeRequest Create Dedicated Cloud Node request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudNodeName, DedicatedCloudNodeInner dedicatedCloudNodeRequest) { + 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 (dedicatedCloudNodeName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (dedicatedCloudNodeRequest == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeRequest 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(dedicatedCloudNodeRequest); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, dedicatedCloudNodeName, this.client.referer(), dedicatedCloudNodeRequest, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateOrUpdateDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, DedicatedCloudNodeCreateOrUpdateHeaders.class); + } + + /** + * Implements dedicated cloud node DELETE method. + * Delete dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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 dedicatedCloudNodeName) { + deleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName).toBlocking().single().body(); + } + + /** + * Implements dedicated cloud node DELETE method. + * Delete dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node 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 deleteAsync(String resourceGroupName, String dedicatedCloudNodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName), serviceCallback); + } + + /** + * Implements dedicated cloud node DELETE method. + * Delete dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String dedicatedCloudNodeName) { + return deleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements dedicated cloud node DELETE method. + * Delete dedicated cloud node. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudNodeName) { + 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 (dedicatedCloudNodeName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeName 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, dedicatedCloudNodeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders deleteDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, DedicatedCloudNodeDeleteHeaders.class); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudNodeInner object if successful. + */ + public DedicatedCloudNodeInner update(String resourceGroupName, String dedicatedCloudNodeName) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName).toBlocking().single().body(); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node 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 updateAsync(String resourceGroupName, String dedicatedCloudNodeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName), serviceCallback); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable updateAsync(String resourceGroupName, String dedicatedCloudNodeName) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName).map(new Func1, DedicatedCloudNodeInner>() { + @Override + public DedicatedCloudNodeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudNodeName) { + 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 (dedicatedCloudNodeName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + PatchPayload dedicatedCloudNodeRequest = new PatchPayload(); + dedicatedCloudNodeRequest.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, dedicatedCloudNodeName, this.client.apiVersion(), this.client.acceptLanguage(), dedicatedCloudNodeRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudNodeInner object if successful. + */ + public DedicatedCloudNodeInner update(String resourceGroupName, String dedicatedCloudNodeName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, tags).toBlocking().single().body(); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param tags The tags key:value pairs + * @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 dedicatedCloudNodeName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, tags), serviceCallback); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable updateAsync(String resourceGroupName, String dedicatedCloudNodeName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudNodeName, tags).map(new Func1, DedicatedCloudNodeInner>() { + @Override + public DedicatedCloudNodeInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements dedicated cloud node PATCH method. + * Patches dedicated node properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudNodeName dedicated cloud node name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudNodeInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudNodeName, Map tags) { + 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 (dedicatedCloudNodeName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudNodeName 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(tags); + PatchPayload dedicatedCloudNodeRequest = new PatchPayload(); + dedicatedCloudNodeRequest.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, dedicatedCloudNodeName, this.client.apiVersion(), this.client.acceptLanguage(), dedicatedCloudNodeRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudNodeInner> 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(); + } + }; + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within 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); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within 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<DedicatedCloudNodeInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within 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<DedicatedCloudNodeInner> 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)); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within subscription method. + * Returns list of dedicate cloud nodes within 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<DedicatedCloudNodeInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudNodeInner> 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(); + } + }; + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within 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); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within 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<DedicatedCloudNodeInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within 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<DedicatedCloudNodeInner> 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)); + } + }); + } + + /** + * Implements list of dedicated cloud nodes within RG method. + * Returns list of dedicate cloud nodes within 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<DedicatedCloudNodeInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServiceImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServiceImpl.java new file mode 100644 index 0000000000000..d270af0f89c4b --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServiceImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudService; +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.OnboardingStatus; + +class DedicatedCloudServiceImpl extends GroupableResourceCoreImpl implements DedicatedCloudService, DedicatedCloudService.Definition, DedicatedCloudService.Update { + DedicatedCloudServiceImpl(String name, DedicatedCloudServiceInner inner, VMwareCloudSimpleManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DedicatedCloudServicesInner client = this.manager().inner().dedicatedCloudServices(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DedicatedCloudServicesInner client = this.manager().inner().dedicatedCloudServices(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DedicatedCloudServicesInner client = this.manager().inner().dedicatedCloudServices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String gatewaySubnet() { + return this.inner().gatewaySubnet(); + } + + @Override + public OnboardingStatus isAccountOnboarded() { + return this.inner().isAccountOnboarded(); + } + + @Override + public Integer nodes() { + return this.inner().nodes(); + } + + @Override + public String serviceURL() { + return this.inner().serviceURL(); + } + + @Override + public DedicatedCloudServiceImpl withGatewaySubnet(String gatewaySubnet) { + this.inner().withGatewaySubnet(gatewaySubnet); + return this; + } + + @Override + public DedicatedCloudServiceImpl withNodes(Integer nodes) { + this.inner().withNodes(nodes); + return this; + } + + @Override + public DedicatedCloudServiceImpl withServiceURL(String serviceURL) { + this.inner().withServiceURL(serviceURL); + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServiceInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServiceInner.java new file mode 100644 index 0000000000000..766894432884f --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServiceInner.java @@ -0,0 +1,117 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.OnboardingStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Dedicated cloud service model. + */ +@JsonFlatten +public class DedicatedCloudServiceInner extends Resource { + /** + * gateway Subnet for the account. It will collect the subnet address and + * always treat it as /28. + */ + @JsonProperty(value = "properties.gatewaySubnet", required = true) + private String gatewaySubnet; + + /** + * indicates whether account onboarded or not in a given region. Possible + * values include: 'notOnBoarded', 'onBoarded', 'onBoardingFailed', + * 'onBoarding'. + */ + @JsonProperty(value = "properties.isAccountOnboarded", access = JsonProperty.Access.WRITE_ONLY) + private OnboardingStatus isAccountOnboarded; + + /** + * total nodes purchased. + */ + @JsonProperty(value = "properties.nodes") + private Integer nodes; + + /** + * link to a service management web portal. + */ + @JsonProperty(value = "properties.serviceURL") + private String serviceURL; + + /** + * Get gateway Subnet for the account. It will collect the subnet address and always treat it as /28. + * + * @return the gatewaySubnet value + */ + public String gatewaySubnet() { + return this.gatewaySubnet; + } + + /** + * Set gateway Subnet for the account. It will collect the subnet address and always treat it as /28. + * + * @param gatewaySubnet the gatewaySubnet value to set + * @return the DedicatedCloudServiceInner object itself. + */ + public DedicatedCloudServiceInner withGatewaySubnet(String gatewaySubnet) { + this.gatewaySubnet = gatewaySubnet; + return this; + } + + /** + * Get indicates whether account onboarded or not in a given region. Possible values include: 'notOnBoarded', 'onBoarded', 'onBoardingFailed', 'onBoarding'. + * + * @return the isAccountOnboarded value + */ + public OnboardingStatus isAccountOnboarded() { + return this.isAccountOnboarded; + } + + /** + * Get total nodes purchased. + * + * @return the nodes value + */ + public Integer nodes() { + return this.nodes; + } + + /** + * Set total nodes purchased. + * + * @param nodes the nodes value to set + * @return the DedicatedCloudServiceInner object itself. + */ + public DedicatedCloudServiceInner withNodes(Integer nodes) { + this.nodes = nodes; + return this; + } + + /** + * Get link to a service management web portal. + * + * @return the serviceURL value + */ + public String serviceURL() { + return this.serviceURL; + } + + /** + * Set link to a service management web portal. + * + * @param serviceURL the serviceURL value to set + * @return the DedicatedCloudServiceInner object itself. + */ + public DedicatedCloudServiceInner withServiceURL(String serviceURL) { + this.serviceURL = serviceURL; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServicesImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServicesImpl.java new file mode 100644 index 0000000000000..aa714d6fb00e0 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServicesImpl.java @@ -0,0 +1,138 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudService; +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; + +class DedicatedCloudServicesImpl extends GroupableResourcesCoreImpl implements DedicatedCloudServices { + protected DedicatedCloudServicesImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().dedicatedCloudServices(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DedicatedCloudServicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DedicatedCloudServicesInner 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) { + DedicatedCloudServicesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DedicatedCloudServicesInner 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 DedicatedCloudService call(DedicatedCloudServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DedicatedCloudServicesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DedicatedCloudServicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DedicatedCloudService call(DedicatedCloudServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DedicatedCloudServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + protected DedicatedCloudServiceImpl wrapModel(DedicatedCloudServiceInner inner) { + return new DedicatedCloudServiceImpl(inner.name(), inner, manager()); + } + + @Override + protected DedicatedCloudServiceImpl wrapModel(String name) { + return new DedicatedCloudServiceImpl(name, new DedicatedCloudServiceInner(), this.manager()); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServicesInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServicesInner.java new file mode 100644 index 0000000000000..d99f705de0c40 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/DedicatedCloudServicesInner.java @@ -0,0 +1,1360 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.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.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudServiceDeleteHeaders; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PatchPayload; +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.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +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 DedicatedCloudServices. + */ +public class DedicatedCloudServicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DedicatedCloudServicesService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of DedicatedCloudServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DedicatedCloudServicesInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(DedicatedCloudServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DedicatedCloudServices to be + * used by Retrofit to perform actually REST calls. + */ + interface DedicatedCloudServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skipToken") String skipToken, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skipToken") String skipToken, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudServiceName") String dedicatedCloudServiceName, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudServiceName") String dedicatedCloudServiceName, @Body DedicatedCloudServiceInner dedicatedCloudServiceRequest, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudServiceName") String dedicatedCloudServiceName, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudServiceName") String dedicatedCloudServiceName, @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.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("dedicatedCloudServiceName") String dedicatedCloudServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PatchPayload dedicatedCloudServiceRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices listNext" }) + @GET + Observable> listNext(@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.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudServiceInner> 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(); + } + }; + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within 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); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> 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)); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudServiceInner> 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."); + } + final String filter = null; + final Integer top = null; + final String skipToken = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, skipToken, 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); + } + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudServiceInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(filter, top, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @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 filter, final Integer top, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final String skipToken) { + return listWithServiceResponseAsync(filter, top, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final String skipToken) { + return listSinglePageAsync(filter, top, skipToken) + .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)); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + ServiceResponse> * @param filter The filter to apply on the list operation + ServiceResponse> * @param top The maximum number of record sets to return + ServiceResponse> * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final String skipToken) { + 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(), filter, top, skipToken, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudServiceInner> 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(); + } + }; + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> 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)); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudServiceInner> 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."); + } + final String filter = null; + final Integer top = null; + final String skipToken = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, skipToken, 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); + } + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudServiceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @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 String filter, final Integer top, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DedicatedCloudServiceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken) + .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)); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group + ServiceResponse> * @param filter The filter to apply on the list operation + ServiceResponse> * @param top The maximum number of record sets to return + ServiceResponse> * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DedicatedCloudServiceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + 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(), filter, top, skipToken, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements dedicatedCloudService GET method. + * Returns Dedicate Cloud Service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudServiceInner object if successful. + */ + public DedicatedCloudServiceInner getByResourceGroup(String resourceGroupName, String dedicatedCloudServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).toBlocking().single().body(); + } + + /** + * Implements dedicatedCloudService GET method. + * Returns Dedicate Cloud Service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service 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 getByResourceGroupAsync(String resourceGroupName, String dedicatedCloudServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName), serviceCallback); + } + + /** + * Implements dedicatedCloudService GET method. + * Returns Dedicate Cloud Service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String dedicatedCloudServiceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).map(new Func1, DedicatedCloudServiceInner>() { + @Override + public DedicatedCloudServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements dedicatedCloudService GET method. + * Returns Dedicate Cloud Service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudServiceName) { + 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 (dedicatedCloudServiceName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudServiceName 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, dedicatedCloudServiceName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements dedicated cloud service PUT method. + * Create dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudServiceInner object if successful. + */ + public DedicatedCloudServiceInner createOrUpdate(String resourceGroupName, String dedicatedCloudServiceName, DedicatedCloudServiceInner dedicatedCloudServiceRequest) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName, dedicatedCloudServiceRequest).toBlocking().single().body(); + } + + /** + * Implements dedicated cloud service PUT method. + * Create dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request + * @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 dedicatedCloudServiceName, DedicatedCloudServiceInner dedicatedCloudServiceRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName, dedicatedCloudServiceRequest), serviceCallback); + } + + /** + * Implements dedicated cloud service PUT method. + * Create dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String dedicatedCloudServiceName, DedicatedCloudServiceInner dedicatedCloudServiceRequest) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName, dedicatedCloudServiceRequest).map(new Func1, DedicatedCloudServiceInner>() { + @Override + public DedicatedCloudServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements dedicated cloud service PUT method. + * Create dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud Service name + * @param dedicatedCloudServiceRequest Create Dedicated Cloud Service request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudServiceName, DedicatedCloudServiceInner dedicatedCloudServiceRequest) { + 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 (dedicatedCloudServiceName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudServiceName is required and cannot be null."); + } + if (dedicatedCloudServiceRequest == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudServiceRequest 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(dedicatedCloudServiceRequest); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, dedicatedCloudServiceName, dedicatedCloudServiceRequest, this.client.apiVersion(), this.client.acceptLanguage(), 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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 dedicatedCloudServiceName) { + deleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).toBlocking().last().body(); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service 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 deleteAsync(String resourceGroupName, String dedicatedCloudServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName), serviceCallback); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String dedicatedCloudServiceName) { + return deleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudServiceName) { + 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 (dedicatedCloudServiceName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudServiceName 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, dedicatedCloudServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), DedicatedCloudServiceDeleteHeaders.class); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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 dedicatedCloudServiceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).toBlocking().single().body(); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service 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 beginDeleteAsync(String resourceGroupName, String dedicatedCloudServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName), serviceCallback); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String dedicatedCloudServiceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements dedicatedCloudService DELETE method. + * Delete dedicate cloud service. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudServiceName) { + 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 (dedicatedCloudServiceName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudServiceName 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, dedicatedCloudServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, DedicatedCloudServiceDeleteHeaders.class); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudServiceInner object if successful. + */ + public DedicatedCloudServiceInner update(String resourceGroupName, String dedicatedCloudServiceName) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).toBlocking().single().body(); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service 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 updateAsync(String resourceGroupName, String dedicatedCloudServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName), serviceCallback); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String dedicatedCloudServiceName) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName).map(new Func1, DedicatedCloudServiceInner>() { + @Override + public DedicatedCloudServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudServiceName) { + 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 (dedicatedCloudServiceName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudServiceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + PatchPayload dedicatedCloudServiceRequest = new PatchPayload(); + dedicatedCloudServiceRequest.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, dedicatedCloudServiceName, this.client.apiVersion(), this.client.acceptLanguage(), dedicatedCloudServiceRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DedicatedCloudServiceInner object if successful. + */ + public DedicatedCloudServiceInner update(String resourceGroupName, String dedicatedCloudServiceName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName, tags).toBlocking().single().body(); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @param tags The tags key:value pairs + * @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 dedicatedCloudServiceName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName, tags), serviceCallback); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable updateAsync(String resourceGroupName, String dedicatedCloudServiceName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, dedicatedCloudServiceName, tags).map(new Func1, DedicatedCloudServiceInner>() { + @Override + public DedicatedCloudServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements dedicatedCloudService PATCH method. + * Patch dedicated cloud service's properties. + * + * @param resourceGroupName The name of the resource group + * @param dedicatedCloudServiceName dedicated cloud service name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DedicatedCloudServiceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String dedicatedCloudServiceName, Map tags) { + 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 (dedicatedCloudServiceName == null) { + throw new IllegalArgumentException("Parameter dedicatedCloudServiceName 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(tags); + PatchPayload dedicatedCloudServiceRequest = new PatchPayload(); + dedicatedCloudServiceRequest.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, dedicatedCloudServiceName, this.client.apiVersion(), this.client.acceptLanguage(), dedicatedCloudServiceRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudServiceInner> 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(); + } + }; + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within 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); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within 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<DedicatedCloudServiceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within 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<DedicatedCloudServiceInner> 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)); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within subscription method. + * Returns list of dedicated cloud service within within 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<DedicatedCloudServiceInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<DedicatedCloudServiceInner> 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(); + } + }; + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within 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); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within 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<DedicatedCloudServiceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within 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<DedicatedCloudServiceInner> 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)); + } + }); + } + + /** + * Implements list of dedicatedCloudService objects within RG method. + * Returns list of dedicated cloud service within 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<DedicatedCloudServiceInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/IdParsingUtils.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..63fed176b837b --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/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.vmwarecloudsimple.v2019_04_01.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/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/OperationResourceInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/OperationResourceInner.java new file mode 100644 index 0000000000000..c815ae1f2bc87 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/OperationResourceInner.java @@ -0,0 +1,120 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.OperationError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation status response. + */ +public class OperationResourceInner { + /** + * End time of the operation. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * Error Message if operation failed. + */ + @JsonProperty(value = "error") + private OperationError error; + + /** + * Operation Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Operation ID. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Start time of the operation. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * Operation status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Get end time of the operation. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get error Message if operation failed. + * + * @return the error value + */ + public OperationError error() { + return this.error; + } + + /** + * Set error Message if operation failed. + * + * @param error the error value to set + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withError(OperationError error) { + this.error = error; + return this; + } + + /** + * Get operation Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get operation ID. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get start time of the operation. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get operation status. + * + * @return the status value + */ + public String status() { + return this.status; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PageImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..53049427ff0ae --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/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.vmwarecloudsimple.v2019_04_01.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/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudByRegionsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudByRegionsImpl.java new file mode 100644 index 0000000000000..d6f56a51c74db --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudByRegionsImpl.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. + * abc + */ + +package com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudByRegions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloud; + +class PrivateCloudByRegionsImpl extends WrapperImpl implements PrivateCloudByRegions { + private final VMwareCloudSimpleManager manager; + + PrivateCloudByRegionsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().privateCloudByRegions()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private PrivateCloudImpl wrapPrivateCloudModel(PrivateCloudInner inner) { + return new PrivateCloudImpl(inner, manager()); + } + + @Override + public Observable listAsync() { + PrivateCloudByRegionsInner 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 wrapPrivateCloudModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudByRegionsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudByRegionsInner.java new file mode 100644 index 0000000000000..30845e0dc5a74 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudByRegionsInner.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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.Path; +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 PrivateCloudByRegions. + */ +public class PrivateCloudByRegionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateCloudByRegionsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of PrivateCloudByRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateCloudByRegionsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(PrivateCloudByRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateCloudByRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateCloudByRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudByRegions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @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.vmwarecloudsimple.v2019_04_01.PrivateCloudByRegions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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(); + } + }; + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular 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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @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(); + } + }); + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @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)); + } + }); + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @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.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() 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.regionId(), 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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(); + } + }; + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @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); + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @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(); + } + }); + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + * @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)); + } + }); + } + + /** + * Implements private cloud list GET method. + * Returns list of private clouds in particular region. + * + 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudImpl.java new file mode 100644 index 0000000000000..16cbf85d47c87 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudImpl.java @@ -0,0 +1,196 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloud; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import java.util.UUID; +import java.util.ArrayList; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationResourcePool; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudResourceType; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualMachineTemplate; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualNetwork; + +class PrivateCloudImpl extends WrapperImpl implements PrivateCloud { + private final VMwareCloudSimpleManager manager; + + PrivateCloudImpl(PrivateCloudInner inner, VMwareCloudSimpleManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + + + @Override + public String availabilityZoneId() { + return this.inner().availabilityZoneId(); + } + + @Override + public String availabilityZoneName() { + return this.inner().availabilityZoneName(); + } + + @Override + public Integer clustersNumber() { + return this.inner().clustersNumber(); + } + + @Override + public String createdBy() { + return this.inner().createdBy(); + } + + @Override + public DateTime createdOn() { + return this.inner().createdOn(); + } + + @Override + public List dnsServers() { + return this.inner().dnsServers(); + } + + @Override + public String expires() { + return this.inner().expires(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String nsxType() { + return this.inner().nsxType(); + } + + @Override + public String placementGroupId() { + return this.inner().placementGroupId(); + } + + @Override + public String placementGroupName() { + return this.inner().placementGroupName(); + } + + @Override + public UUID privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String privateCloudPropertiesType() { + return this.inner().privateCloudPropertiesType(); + } + + @Override + public List resourcePools() { + List lst = new ArrayList(); + if (this.inner().resourcePools() != null) { + for (ResourcePoolInner inner : this.inner().resourcePools()) { + lst.add( new PrivateCloudLocationResourcePoolImpl(inner, manager())); + } + } + return lst; + } + + @Override + public String state() { + return this.inner().state(); + } + + @Override + public Integer totalCpuCores() { + return this.inner().totalCpuCores(); + } + + @Override + public Integer totalNodes() { + return this.inner().totalNodes(); + } + + @Override + public Integer totalRam() { + return this.inner().totalRam(); + } + + @Override + public Double totalStorage() { + return this.inner().totalStorage(); + } + + @Override + public PrivateCloudResourceType type() { + return this.inner().type(); + } + + @Override + public String vcenterFqdn() { + return this.inner().vcenterFqdn(); + } + + @Override + public String vcenterRefid() { + return this.inner().vcenterRefid(); + } + + @Override + public List virtualMachineTemplates() { + List lst = new ArrayList(); + if (this.inner().virtualMachineTemplates() != null) { + for (VirtualMachineTemplateInner inner : this.inner().virtualMachineTemplates()) { + lst.add( new PrivateCloudLocationVirtualMachineTemplateImpl(inner, manager())); + } + } + return lst; + } + + @Override + public List virtualNetworks() { + List lst = new ArrayList(); + if (this.inner().virtualNetworks() != null) { + for (VirtualNetworkInner inner : this.inner().virtualNetworks()) { + lst.add( new PrivateCloudLocationVirtualNetworkImpl(inner, manager())); + } + } + return lst; + } + + @Override + public Boolean vrOpsEnabled() { + return this.inner().vrOpsEnabled(); + } + + @Override + public String vSphereVersion() { + return this.inner().vSphereVersion(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudInner.java new file mode 100644 index 0000000000000..ed574b987048e --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudInner.java @@ -0,0 +1,753 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import org.joda.time.DateTime; +import java.util.List; +import java.util.UUID; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudResourceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Private cloud model. + */ +@JsonFlatten +public class PrivateCloudInner { + /** + * Azure Id, e.g. + * "/subscriptions/4da99247-a172-4ed6-8ae9-ebed2d12f839/providers/Microsoft.VMwareCloudSimple/privateClouds/cloud123". + */ + @JsonProperty(value = "id") + private String id; + + /** + * Location where private cloud created, e.g "westus". + */ + @JsonProperty(value = "location") + private String location; + + /** + * Private cloud name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Availability Zone id, e.g. "az1". + */ + @JsonProperty(value = "properties.availabilityZoneId") + private String availabilityZoneId; + + /** + * Availability Zone name, e.g. "Availability Zone 1". + */ + @JsonProperty(value = "properties.availabilityZoneName") + private String availabilityZoneName; + + /** + * Number of clusters. + */ + @JsonProperty(value = "properties.clustersNumber") + private Integer clustersNumber; + + /** + * User's emails who created cloud. + */ + @JsonProperty(value = "properties.createdBy") + private String createdBy; + + /** + * When private cloud was created. + */ + @JsonProperty(value = "properties.createdOn") + private DateTime createdOn; + + /** + * Array of DNS servers. + */ + @JsonProperty(value = "properties.dnsServers") + private List dnsServers; + + /** + * Expiration date of PC. + */ + @JsonProperty(value = "properties.expires") + private String expires; + + /** + * Nsx Type, e.g. "Advanced". + */ + @JsonProperty(value = "properties.nsxType") + private String nsxType; + + /** + * Placement Group id, e.g. "n1". + */ + @JsonProperty(value = "properties.placementGroupId") + private String placementGroupId; + + /** + * Placement Group name. + */ + @JsonProperty(value = "properties.placementGroupName") + private String placementGroupName; + + /** + * Id of a private cloud. + */ + @JsonProperty(value = "properties.privateCloudId") + private UUID privateCloudId; + + /** + * The list of Resource Pools. + */ + @JsonProperty(value = "properties.resourcePools") + private List resourcePools; + + /** + * Private Cloud state, e.g. "operational". + */ + @JsonProperty(value = "properties.state") + private String state; + + /** + * Number of cores. + */ + @JsonProperty(value = "properties.totalCpuCores") + private Integer totalCpuCores; + + /** + * Number of nodes. + */ + @JsonProperty(value = "properties.totalNodes") + private Integer totalNodes; + + /** + * Memory size. + */ + @JsonProperty(value = "properties.totalRam") + private Integer totalRam; + + /** + * Disk space in TB. + */ + @JsonProperty(value = "properties.totalStorage") + private Double totalStorage; + + /** + * Virtualization type e.g. "vSphere". + */ + @JsonProperty(value = "properties.type") + private String privateCloudPropertiesType; + + /** + * e.g. "6.5u2". + */ + @JsonProperty(value = "properties.vSphereVersion") + private String vSphereVersion; + + /** + * FQDN for vcenter access. + */ + @JsonProperty(value = "properties.vcenterFqdn") + private String vcenterFqdn; + + /** + * Vcenter ip address. + */ + @JsonProperty(value = "properties.vcenterRefid") + private String vcenterRefid; + + /** + * The list of Virtual Machine Templates. + */ + @JsonProperty(value = "properties.virtualMachineTemplates") + private List virtualMachineTemplates; + + /** + * The list of Virtual Networks. + */ + @JsonProperty(value = "properties.virtualNetworks") + private List virtualNetworks; + + /** + * Is Vrops enabled/disabled. + */ + @JsonProperty(value = "properties.vrOpsEnabled") + private Boolean vrOpsEnabled; + + /** + * Azure Resource type. Possible values include: + * 'Microsoft.VMwareCloudSimple/privateClouds'. + */ + @JsonProperty(value = "type") + private PrivateCloudResourceType type; + + /** + * Get azure Id, e.g. "/subscriptions/4da99247-a172-4ed6-8ae9-ebed2d12f839/providers/Microsoft.VMwareCloudSimple/privateClouds/cloud123". + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set azure Id, e.g. "/subscriptions/4da99247-a172-4ed6-8ae9-ebed2d12f839/providers/Microsoft.VMwareCloudSimple/privateClouds/cloud123". + * + * @param id the id value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get location where private cloud created, e.g "westus". + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location where private cloud created, e.g "westus". + * + * @param location the location value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get private cloud name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set private cloud name. + * + * @param name the name value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get availability Zone id, e.g. "az1". + * + * @return the availabilityZoneId value + */ + public String availabilityZoneId() { + return this.availabilityZoneId; + } + + /** + * Set availability Zone id, e.g. "az1". + * + * @param availabilityZoneId the availabilityZoneId value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withAvailabilityZoneId(String availabilityZoneId) { + this.availabilityZoneId = availabilityZoneId; + return this; + } + + /** + * Get availability Zone name, e.g. "Availability Zone 1". + * + * @return the availabilityZoneName value + */ + public String availabilityZoneName() { + return this.availabilityZoneName; + } + + /** + * Set availability Zone name, e.g. "Availability Zone 1". + * + * @param availabilityZoneName the availabilityZoneName value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withAvailabilityZoneName(String availabilityZoneName) { + this.availabilityZoneName = availabilityZoneName; + return this; + } + + /** + * Get number of clusters. + * + * @return the clustersNumber value + */ + public Integer clustersNumber() { + return this.clustersNumber; + } + + /** + * Set number of clusters. + * + * @param clustersNumber the clustersNumber value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withClustersNumber(Integer clustersNumber) { + this.clustersNumber = clustersNumber; + return this; + } + + /** + * Get user's emails who created cloud. + * + * @return the createdBy value + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set user's emails who created cloud. + * + * @param createdBy the createdBy value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get when private cloud was created. + * + * @return the createdOn value + */ + public DateTime createdOn() { + return this.createdOn; + } + + /** + * Set when private cloud was created. + * + * @param createdOn the createdOn value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withCreatedOn(DateTime createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get array of DNS servers. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set array of DNS servers. + * + * @param dnsServers the dnsServers value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get expiration date of PC. + * + * @return the expires value + */ + public String expires() { + return this.expires; + } + + /** + * Set expiration date of PC. + * + * @param expires the expires value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withExpires(String expires) { + this.expires = expires; + return this; + } + + /** + * Get nsx Type, e.g. "Advanced". + * + * @return the nsxType value + */ + public String nsxType() { + return this.nsxType; + } + + /** + * Set nsx Type, e.g. "Advanced". + * + * @param nsxType the nsxType value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withNsxType(String nsxType) { + this.nsxType = nsxType; + return this; + } + + /** + * Get placement Group id, e.g. "n1". + * + * @return the placementGroupId value + */ + public String placementGroupId() { + return this.placementGroupId; + } + + /** + * Set placement Group id, e.g. "n1". + * + * @param placementGroupId the placementGroupId value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withPlacementGroupId(String placementGroupId) { + this.placementGroupId = placementGroupId; + return this; + } + + /** + * Get placement Group name. + * + * @return the placementGroupName value + */ + public String placementGroupName() { + return this.placementGroupName; + } + + /** + * Set placement Group name. + * + * @param placementGroupName the placementGroupName value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withPlacementGroupName(String placementGroupName) { + this.placementGroupName = placementGroupName; + return this; + } + + /** + * Get id of a private cloud. + * + * @return the privateCloudId value + */ + public UUID privateCloudId() { + return this.privateCloudId; + } + + /** + * Set id of a private cloud. + * + * @param privateCloudId the privateCloudId value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withPrivateCloudId(UUID privateCloudId) { + this.privateCloudId = privateCloudId; + return this; + } + + /** + * Get the list of Resource Pools. + * + * @return the resourcePools value + */ + public List resourcePools() { + return this.resourcePools; + } + + /** + * Set the list of Resource Pools. + * + * @param resourcePools the resourcePools value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withResourcePools(List resourcePools) { + this.resourcePools = resourcePools; + return this; + } + + /** + * Get private Cloud state, e.g. "operational". + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set private Cloud state, e.g. "operational". + * + * @param state the state value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withState(String state) { + this.state = state; + return this; + } + + /** + * Get number of cores. + * + * @return the totalCpuCores value + */ + public Integer totalCpuCores() { + return this.totalCpuCores; + } + + /** + * Set number of cores. + * + * @param totalCpuCores the totalCpuCores value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withTotalCpuCores(Integer totalCpuCores) { + this.totalCpuCores = totalCpuCores; + return this; + } + + /** + * Get number of nodes. + * + * @return the totalNodes value + */ + public Integer totalNodes() { + return this.totalNodes; + } + + /** + * Set number of nodes. + * + * @param totalNodes the totalNodes value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withTotalNodes(Integer totalNodes) { + this.totalNodes = totalNodes; + return this; + } + + /** + * Get memory size. + * + * @return the totalRam value + */ + public Integer totalRam() { + return this.totalRam; + } + + /** + * Set memory size. + * + * @param totalRam the totalRam value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withTotalRam(Integer totalRam) { + this.totalRam = totalRam; + return this; + } + + /** + * Get disk space in TB. + * + * @return the totalStorage value + */ + public Double totalStorage() { + return this.totalStorage; + } + + /** + * Set disk space in TB. + * + * @param totalStorage the totalStorage value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withTotalStorage(Double totalStorage) { + this.totalStorage = totalStorage; + return this; + } + + /** + * Get virtualization type e.g. "vSphere". + * + * @return the privateCloudPropertiesType value + */ + public String privateCloudPropertiesType() { + return this.privateCloudPropertiesType; + } + + /** + * Set virtualization type e.g. "vSphere". + * + * @param privateCloudPropertiesType the privateCloudPropertiesType value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withPrivateCloudPropertiesType(String privateCloudPropertiesType) { + this.privateCloudPropertiesType = privateCloudPropertiesType; + return this; + } + + /** + * Get e.g. "6.5u2". + * + * @return the vSphereVersion value + */ + public String vSphereVersion() { + return this.vSphereVersion; + } + + /** + * Set e.g. "6.5u2". + * + * @param vSphereVersion the vSphereVersion value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVSphereVersion(String vSphereVersion) { + this.vSphereVersion = vSphereVersion; + return this; + } + + /** + * Get fQDN for vcenter access. + * + * @return the vcenterFqdn value + */ + public String vcenterFqdn() { + return this.vcenterFqdn; + } + + /** + * Set fQDN for vcenter access. + * + * @param vcenterFqdn the vcenterFqdn value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVcenterFqdn(String vcenterFqdn) { + this.vcenterFqdn = vcenterFqdn; + return this; + } + + /** + * Get vcenter ip address. + * + * @return the vcenterRefid value + */ + public String vcenterRefid() { + return this.vcenterRefid; + } + + /** + * Set vcenter ip address. + * + * @param vcenterRefid the vcenterRefid value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVcenterRefid(String vcenterRefid) { + this.vcenterRefid = vcenterRefid; + return this; + } + + /** + * Get the list of Virtual Machine Templates. + * + * @return the virtualMachineTemplates value + */ + public List virtualMachineTemplates() { + return this.virtualMachineTemplates; + } + + /** + * Set the list of Virtual Machine Templates. + * + * @param virtualMachineTemplates the virtualMachineTemplates value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVirtualMachineTemplates(List virtualMachineTemplates) { + this.virtualMachineTemplates = virtualMachineTemplates; + return this; + } + + /** + * Get the list of Virtual Networks. + * + * @return the virtualNetworks value + */ + public List virtualNetworks() { + return this.virtualNetworks; + } + + /** + * Set the list of Virtual Networks. + * + * @param virtualNetworks the virtualNetworks value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVirtualNetworks(List virtualNetworks) { + this.virtualNetworks = virtualNetworks; + return this; + } + + /** + * Get is Vrops enabled/disabled. + * + * @return the vrOpsEnabled value + */ + public Boolean vrOpsEnabled() { + return this.vrOpsEnabled; + } + + /** + * Set is Vrops enabled/disabled. + * + * @param vrOpsEnabled the vrOpsEnabled value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVrOpsEnabled(Boolean vrOpsEnabled) { + this.vrOpsEnabled = vrOpsEnabled; + return this; + } + + /** + * Get azure Resource type. Possible values include: 'Microsoft.VMwareCloudSimple/privateClouds'. + * + * @return the type value + */ + public PrivateCloudResourceType type() { + return this.type; + } + + /** + * Set azure Resource type. Possible values include: 'Microsoft.VMwareCloudSimple/privateClouds'. + * + * @param type the type value to set + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withType(PrivateCloudResourceType type) { + this.type = type; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationResourcePoolImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationResourcePoolImpl.java new file mode 100644 index 0000000000000..eed68a66f7669 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationResourcePoolImpl.java @@ -0,0 +1,60 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationResourcePool; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class PrivateCloudLocationResourcePoolImpl extends WrapperImpl implements PrivateCloudLocationResourcePool { + private final VMwareCloudSimpleManager manager; + + PrivateCloudLocationResourcePoolImpl(ResourcePoolInner inner, VMwareCloudSimpleManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + + + @Override + public String fullName() { + return this.inner().fullName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationResourcePoolModelImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationResourcePoolModelImpl.java new file mode 100644 index 0000000000000..cd18608b428cc --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationResourcePoolModelImpl.java @@ -0,0 +1,71 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationResourcePoolModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class PrivateCloudLocationResourcePoolModelImpl extends IndexableRefreshableWrapperImpl implements PrivateCloudLocationResourcePoolModel { + private final VMwareCloudSimpleManager manager; + private String pcName; + private String resourcePoolName; + + PrivateCloudLocationResourcePoolModelImpl(ResourcePoolInner inner, VMwareCloudSimpleManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.pcName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.resourcePoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcePools"); + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ResourcePoolByPCsInner client = this.manager().inner().resourcePoolByPCs(); + return client.getAsync(this.pcName, this.resourcePoolName); + } + + + + @Override + public String fullName() { + return this.inner().fullName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualMachineTemplateImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualMachineTemplateImpl.java new file mode 100644 index 0000000000000..0d78940b1a503 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualMachineTemplateImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualMachineTemplate; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDiskController; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDisk; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNic; + +class PrivateCloudLocationVirtualMachineTemplateImpl extends WrapperImpl implements PrivateCloudLocationVirtualMachineTemplate { + private final VMwareCloudSimpleManager manager; + + PrivateCloudLocationVirtualMachineTemplateImpl(VirtualMachineTemplateInner inner, VMwareCloudSimpleManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + + + @Override + public Integer amountOfRam() { + return this.inner().amountOfRam(); + } + + @Override + public List controllers() { + return this.inner().controllers(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public List disks() { + return this.inner().disks(); + } + + @Override + public Boolean exposeToGuestVM() { + return this.inner().exposeToGuestVM(); + } + + @Override + public String guestOS() { + return this.inner().guestOS(); + } + + @Override + public String guestOSType() { + return this.inner().guestOSType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List nics() { + return this.inner().nics(); + } + + @Override + public Integer numberOfCores() { + return this.inner().numberOfCores(); + } + + @Override + public String path() { + return this.inner().path(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String vmwaretools() { + return this.inner().vmwaretools(); + } + + @Override + public List vSphereNetworks() { + return this.inner().vSphereNetworks(); + } + + @Override + public List vSphereTags() { + return this.inner().vSphereTags(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualMachineTemplateModelImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualMachineTemplateModelImpl.java new file mode 100644 index 0000000000000..109a82a539c76 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualMachineTemplateModelImpl.java @@ -0,0 +1,135 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualMachineTemplateModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDiskController; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDisk; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNic; + +class PrivateCloudLocationVirtualMachineTemplateModelImpl extends IndexableRefreshableWrapperImpl implements PrivateCloudLocationVirtualMachineTemplateModel { + private final VMwareCloudSimpleManager manager; + private String pcName; + private String virtualMachineTemplateName; + + PrivateCloudLocationVirtualMachineTemplateModelImpl(VirtualMachineTemplateInner inner, VMwareCloudSimpleManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.pcName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.virtualMachineTemplateName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualMachineTemplates"); + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + VirtualMachineTemplateByPCsInner client = this.manager().inner().virtualMachineTemplateByPCs(); + return client.getAsync(this.pcName, this.virtualMachineTemplateName); + } + + + + @Override + public Integer amountOfRam() { + return this.inner().amountOfRam(); + } + + @Override + public List controllers() { + return this.inner().controllers(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public List disks() { + return this.inner().disks(); + } + + @Override + public Boolean exposeToGuestVM() { + return this.inner().exposeToGuestVM(); + } + + @Override + public String guestOS() { + return this.inner().guestOS(); + } + + @Override + public String guestOSType() { + return this.inner().guestOSType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List nics() { + return this.inner().nics(); + } + + @Override + public Integer numberOfCores() { + return this.inner().numberOfCores(); + } + + @Override + public String path() { + return this.inner().path(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String vmwaretools() { + return this.inner().vmwaretools(); + } + + @Override + public List vSphereNetworks() { + return this.inner().vSphereNetworks(); + } + + @Override + public List vSphereTags() { + return this.inner().vSphereTags(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualNetworkImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualNetworkImpl.java new file mode 100644 index 0000000000000..a988bd757c3f6 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualNetworkImpl.java @@ -0,0 +1,60 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualNetwork; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class PrivateCloudLocationVirtualNetworkImpl extends WrapperImpl implements PrivateCloudLocationVirtualNetwork { + private final VMwareCloudSimpleManager manager; + + PrivateCloudLocationVirtualNetworkImpl(VirtualNetworkInner inner, VMwareCloudSimpleManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + + + @Override + public Boolean assignable() { + return this.inner().assignable(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualNetworkModelImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualNetworkModelImpl.java new file mode 100644 index 0000000000000..84c9beafdfac2 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/PrivateCloudLocationVirtualNetworkModelImpl.java @@ -0,0 +1,71 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualNetworkModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class PrivateCloudLocationVirtualNetworkModelImpl extends IndexableRefreshableWrapperImpl implements PrivateCloudLocationVirtualNetworkModel { + private final VMwareCloudSimpleManager manager; + private String pcName; + private String virtualNetworkName; + + PrivateCloudLocationVirtualNetworkModelImpl(VirtualNetworkInner inner, VMwareCloudSimpleManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.pcName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateClouds"); + this.virtualNetworkName = IdParsingUtils.getValueFromIdByName(inner.id(), "virtualNetworks"); + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + VirtualNetworkByPCsInner client = this.manager().inner().virtualNetworkByPCs(); + return client.getAsync(this.pcName, this.virtualNetworkName); + } + + + + @Override + public Boolean assignable() { + return this.inner().assignable(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolByPCsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolByPCsImpl.java new file mode 100644 index 0000000000000..495dfcf5ea47d --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolByPCsImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.ResourcePoolByPCs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationResourcePoolModel; + +class ResourcePoolByPCsImpl extends WrapperImpl implements ResourcePoolByPCs { + private final VMwareCloudSimpleManager manager; + + ResourcePoolByPCsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().resourcePoolByPCs()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private PrivateCloudLocationResourcePoolModelImpl wrapModel(ResourcePoolInner inner) { + return new PrivateCloudLocationResourcePoolModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String pcName, String resourcePoolName) { + ResourcePoolByPCsInner client = this.inner(); + return client.getAsync(pcName, resourcePoolName) + .map(new Func1() { + @Override + public PrivateCloudLocationResourcePoolModel call(ResourcePoolInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolByPCsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolByPCsInner.java new file mode 100644 index 0000000000000..f75ee19099f84 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolByPCsInner.java @@ -0,0 +1,153 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 ResourcePoolByPCs. + */ +public class ResourcePoolByPCsInner { + /** The Retrofit service to perform REST calls. */ + private ResourcePoolByPCsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of ResourcePoolByPCsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ResourcePoolByPCsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(ResourcePoolByPCsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ResourcePoolByPCs to be + * used by Retrofit to perform actually REST calls. + */ + interface ResourcePoolByPCsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.ResourcePoolByPCs get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools/{resourcePoolName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Path("pcName") String pcName, @Path("resourcePoolName") String resourcePoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements get of resource pool. + * Returns resource pool templates by its name. + * + * @param pcName The private cloud name + * @param resourcePoolName resource pool id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourcePoolInner object if successful. + */ + public ResourcePoolInner get(String pcName, String resourcePoolName) { + return getWithServiceResponseAsync(pcName, resourcePoolName).toBlocking().single().body(); + } + + /** + * Implements get of resource pool. + * Returns resource pool templates by its name. + * + * @param pcName The private cloud name + * @param resourcePoolName resource pool id (vsphereId) + * @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 pcName, String resourcePoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(pcName, resourcePoolName), serviceCallback); + } + + /** + * Implements get of resource pool. + * Returns resource pool templates by its name. + * + * @param pcName The private cloud name + * @param resourcePoolName resource pool id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourcePoolInner object + */ + public Observable getAsync(String pcName, String resourcePoolName) { + return getWithServiceResponseAsync(pcName, resourcePoolName).map(new Func1, ResourcePoolInner>() { + @Override + public ResourcePoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements get of resource pool. + * Returns resource pool templates by its name. + * + * @param pcName The private cloud name + * @param resourcePoolName resource pool id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourcePoolInner object + */ + public Observable> getWithServiceResponseAsync(String pcName, String resourcePoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() is required and cannot be null."); + } + if (pcName == null) { + throw new IllegalArgumentException("Parameter pcName is required and cannot be null."); + } + if (resourcePoolName == null) { + throw new IllegalArgumentException("Parameter resourcePoolName 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(), this.client.regionId(), pcName, resourcePoolName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolInner.java new file mode 100644 index 0000000000000..7c4776bccb914 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolInner.java @@ -0,0 +1,131 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Resource pool model. + */ +@JsonFlatten +public class ResourcePoolInner { + /** + * resource pool id (privateCloudId:vsphereId). + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Azure region. + */ + @JsonProperty(value = "location") + private String location; + + /** + * {ResourcePoolName}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The Private Cloud Id. + */ + @JsonProperty(value = "privateCloudId", access = JsonProperty.Access.WRITE_ONLY) + private String privateCloudId; + + /** + * Hierarchical resource pool name. + */ + @JsonProperty(value = "properties.fullName", access = JsonProperty.Access.WRITE_ONLY) + private String fullName; + + /** + * {resourceProviderNamespace}/{resourceType}. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get resource pool id (privateCloudId:vsphereId). + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource pool id (privateCloudId:vsphereId). + * + * @param id the id value to set + * @return the ResourcePoolInner object itself. + */ + public ResourcePoolInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get azure region. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure region. + * + * @param location the location value to set + * @return the ResourcePoolInner object itself. + */ + public ResourcePoolInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get {ResourcePoolName}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the Private Cloud Id. + * + * @return the privateCloudId value + */ + public String privateCloudId() { + return this.privateCloudId; + } + + /** + * Get hierarchical resource pool name. + * + * @return the fullName value + */ + public String fullName() { + return this.fullName; + } + + /** + * Get {resourceProviderNamespace}/{resourceType}. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolsByPCsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolsByPCsImpl.java new file mode 100644 index 0000000000000..febe83f8a38d2 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolsByPCsImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.ResourcePoolsByPCs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationResourcePool; + +class ResourcePoolsByPCsImpl extends WrapperImpl implements ResourcePoolsByPCs { + private final VMwareCloudSimpleManager manager; + + ResourcePoolsByPCsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().resourcePoolsByPCs()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private PrivateCloudLocationResourcePoolImpl wrapModel(ResourcePoolInner inner) { + return new PrivateCloudLocationResourcePoolImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String pcName) { + ResourcePoolsByPCsInner client = this.inner(); + return client.listAsync(pcName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateCloudLocationResourcePool call(ResourcePoolInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolsByPCsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolsByPCsInner.java new file mode 100644 index 0000000000000..dd2bffd3da4f9 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/ResourcePoolsByPCsInner.java @@ -0,0 +1,308 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.Path; +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 ResourcePoolsByPCs. + */ +public class ResourcePoolsByPCsInner { + /** The Retrofit service to perform REST calls. */ + private ResourcePoolsByPCsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of ResourcePoolsByPCsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ResourcePoolsByPCsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(ResourcePoolsByPCsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ResourcePoolsByPCs to be + * used by Retrofit to perform actually REST calls. + */ + interface ResourcePoolsByPCsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.ResourcePoolsByPCs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Path("pcName") String pcName, @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.vmwarecloudsimple.v2019_04_01.ResourcePoolsByPCs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for private cloud. + * + * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<ResourcePoolInner> object if successful. + */ + public PagedList list(final String pcName) { + ServiceResponse> response = listSinglePageAsync(pcName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for private cloud. + * + * @param pcName The private cloud 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> listAsync(final String pcName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(pcName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for private cloud. + * + * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourcePoolInner> object + */ + public Observable> listAsync(final String pcName) { + return listWithServiceResponseAsync(pcName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for private cloud. + * + * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourcePoolInner> object + */ + public Observable>> listWithServiceResponseAsync(final String pcName) { + return listSinglePageAsync(pcName) + .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)); + } + }); + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for private cloud. + * + ServiceResponse> * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourcePoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String pcName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() is required and cannot be null."); + } + if (pcName == null) { + throw new IllegalArgumentException("Parameter pcName 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.regionId(), pcName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<ResourcePoolInner> 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(); + } + }; + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for 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); + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for 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<ResourcePoolInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for 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<ResourcePoolInner> 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)); + } + }); + } + + /** + * Implements get of resource pools list. + * Returns list of resource pools in region for 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<ResourcePoolInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkuAvailabilityImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkuAvailabilityImpl.java new file mode 100644 index 0000000000000..2b6c5292ef03c --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkuAvailabilityImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.SkuAvailability; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class SkuAvailabilityImpl extends WrapperImpl implements SkuAvailability { + private final VMwareCloudSimpleManager manager; + + SkuAvailabilityImpl(SkuAvailabilityInner inner, VMwareCloudSimpleManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + + + @Override + public String dedicatedAvailabilityZoneId() { + return this.inner().dedicatedAvailabilityZoneId(); + } + + @Override + public String dedicatedAvailabilityZoneName() { + return this.inner().dedicatedAvailabilityZoneName(); + } + + @Override + public String dedicatedPlacementGroupId() { + return this.inner().dedicatedPlacementGroupId(); + } + + @Override + public String dedicatedPlacementGroupName() { + return this.inner().dedicatedPlacementGroupName(); + } + + @Override + public int limit() { + return this.inner().limit(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public String skuId() { + return this.inner().skuId(); + } + + @Override + public String skuName() { + return this.inner().skuName(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkuAvailabilityInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkuAvailabilityInner.java new file mode 100644 index 0000000000000..198e035fef200 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkuAvailabilityInner.java @@ -0,0 +1,225 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU availability model. + */ +public class SkuAvailabilityInner { + /** + * CloudSimple Availability Zone id. + */ + @JsonProperty(value = "dedicatedAvailabilityZoneId") + private String dedicatedAvailabilityZoneId; + + /** + * CloudSimple Availability Zone Name. + */ + @JsonProperty(value = "dedicatedAvailabilityZoneName") + private String dedicatedAvailabilityZoneName; + + /** + * CloudSimple Placement Group Id. + */ + @JsonProperty(value = "dedicatedPlacementGroupId") + private String dedicatedPlacementGroupId; + + /** + * CloudSimple Placement Group name. + */ + @JsonProperty(value = "dedicatedPlacementGroupName") + private String dedicatedPlacementGroupName; + + /** + * indicates how many resources of a given SKU is available in a AZ->PG. + */ + @JsonProperty(value = "limit", required = true) + private int limit; + + /** + * resource type e.g. DedicatedCloudNodes. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * sku id. + */ + @JsonProperty(value = "skuId") + private String skuId; + + /** + * sku name. + */ + @JsonProperty(value = "skuName") + private String skuName; + + /** + * Get cloudSimple Availability Zone id. + * + * @return the dedicatedAvailabilityZoneId value + */ + public String dedicatedAvailabilityZoneId() { + return this.dedicatedAvailabilityZoneId; + } + + /** + * Set cloudSimple Availability Zone id. + * + * @param dedicatedAvailabilityZoneId the dedicatedAvailabilityZoneId value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withDedicatedAvailabilityZoneId(String dedicatedAvailabilityZoneId) { + this.dedicatedAvailabilityZoneId = dedicatedAvailabilityZoneId; + return this; + } + + /** + * Get cloudSimple Availability Zone Name. + * + * @return the dedicatedAvailabilityZoneName value + */ + public String dedicatedAvailabilityZoneName() { + return this.dedicatedAvailabilityZoneName; + } + + /** + * Set cloudSimple Availability Zone Name. + * + * @param dedicatedAvailabilityZoneName the dedicatedAvailabilityZoneName value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withDedicatedAvailabilityZoneName(String dedicatedAvailabilityZoneName) { + this.dedicatedAvailabilityZoneName = dedicatedAvailabilityZoneName; + return this; + } + + /** + * Get cloudSimple Placement Group Id. + * + * @return the dedicatedPlacementGroupId value + */ + public String dedicatedPlacementGroupId() { + return this.dedicatedPlacementGroupId; + } + + /** + * Set cloudSimple Placement Group Id. + * + * @param dedicatedPlacementGroupId the dedicatedPlacementGroupId value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withDedicatedPlacementGroupId(String dedicatedPlacementGroupId) { + this.dedicatedPlacementGroupId = dedicatedPlacementGroupId; + return this; + } + + /** + * Get cloudSimple Placement Group name. + * + * @return the dedicatedPlacementGroupName value + */ + public String dedicatedPlacementGroupName() { + return this.dedicatedPlacementGroupName; + } + + /** + * Set cloudSimple Placement Group name. + * + * @param dedicatedPlacementGroupName the dedicatedPlacementGroupName value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withDedicatedPlacementGroupName(String dedicatedPlacementGroupName) { + this.dedicatedPlacementGroupName = dedicatedPlacementGroupName; + return this; + } + + /** + * Get indicates how many resources of a given SKU is available in a AZ->PG. + * + * @return the limit value + */ + public int limit() { + return this.limit; + } + + /** + * Set indicates how many resources of a given SKU is available in a AZ->PG. + * + * @param limit the limit value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withLimit(int limit) { + this.limit = limit; + return this; + } + + /** + * Get resource type e.g. DedicatedCloudNodes. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set resource type e.g. DedicatedCloudNodes. + * + * @param resourceType the resourceType value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get sku id. + * + * @return the skuId value + */ + public String skuId() { + return this.skuId; + } + + /** + * Set sku id. + * + * @param skuId the skuId value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withSkuId(String skuId) { + this.skuId = skuId; + return this; + } + + /** + * Get sku name. + * + * @return the skuName value + */ + public String skuName() { + return this.skuName; + } + + /** + * Set sku name. + * + * @param skuName the skuName value to set + * @return the SkuAvailabilityInner object itself. + */ + public SkuAvailabilityInner withSkuName(String skuName) { + this.skuName = skuName; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkusAvailabilityWithinRegionsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkusAvailabilityWithinRegionsImpl.java new file mode 100644 index 0000000000000..fe13f852ced3f --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkusAvailabilityWithinRegionsImpl.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. + * abc + */ + +package com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.SkusAvailabilityWithinRegions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.SkuAvailability; + +class SkusAvailabilityWithinRegionsImpl extends WrapperImpl implements SkusAvailabilityWithinRegions { + private final VMwareCloudSimpleManager manager; + + SkusAvailabilityWithinRegionsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().skusAvailabilityWithinRegions()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private SkuAvailabilityImpl wrapSkuAvailabilityModel(SkuAvailabilityInner inner) { + return new SkuAvailabilityImpl(inner, manager()); + } + + @Override + public Observable listAsync() { + SkusAvailabilityWithinRegionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SkuAvailability call(SkuAvailabilityInner inner) { + return wrapSkuAvailabilityModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkusAvailabilityWithinRegionsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkusAvailabilityWithinRegionsInner.java new file mode 100644 index 0000000000000..05b796950e6ff --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/SkusAvailabilityWithinRegionsInner.java @@ -0,0 +1,414 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.Path; +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 SkusAvailabilityWithinRegions. + */ +public class SkusAvailabilityWithinRegionsInner { + /** The Retrofit service to perform REST calls. */ + private SkusAvailabilityWithinRegionsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of SkusAvailabilityWithinRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkusAvailabilityWithinRegionsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(SkusAvailabilityWithinRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SkusAvailabilityWithinRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface SkusAvailabilityWithinRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.SkusAvailabilityWithinRegions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/availabilities") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Query("skuId") String skuId, @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.vmwarecloudsimple.v2019_04_01.SkusAvailabilityWithinRegions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<SkuAvailabilityInner> 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(); + } + }; + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in 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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SkuAvailabilityInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SkuAvailabilityInner> 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)); + } + }); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SkuAvailabilityInner> 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.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skuId = null; + return service.list(this.client.subscriptionId(), this.client.regionId(), skuId, 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); + } + } + }); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @param skuId sku id, if no sku is passed availability for all skus will be returned + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<SkuAvailabilityInner> object if successful. + */ + public PagedList list(final String skuId) { + ServiceResponse> response = listSinglePageAsync(skuId).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @param skuId sku id, if no sku is passed availability for all skus will be returned + * @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 skuId, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(skuId), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @param skuId sku id, if no sku is passed availability for all skus will be returned + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SkuAvailabilityInner> object + */ + public Observable> listAsync(final String skuId) { + return listWithServiceResponseAsync(skuId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @param skuId sku id, if no sku is passed availability for all skus will be returned + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SkuAvailabilityInner> object + */ + public Observable>> listWithServiceResponseAsync(final String skuId) { + return listSinglePageAsync(skuId) + .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)); + } + }); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + ServiceResponse> * @param skuId sku id, if no sku is passed availability for all skus will be returned + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SkuAvailabilityInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String skuId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() 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.regionId(), skuId, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<SkuAvailabilityInner> 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(); + } + }; + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @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); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @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<SkuAvailabilityInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + * @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<SkuAvailabilityInner> 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)); + } + }); + } + + /** + * Implements SkuAvailability List method. + * Returns list of available resources in region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SkuAvailabilityInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsageImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsageImpl.java new file mode 100644 index 0000000000000..de4afae5aa4ee --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsageImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.UsageName; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.UsageCount; + +class UsageImpl extends WrapperImpl implements Usage { + private final VMwareCloudSimpleManager manager; + + UsageImpl(UsageInner inner, VMwareCloudSimpleManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + + + @Override + public int currentValue() { + return this.inner().currentValue(); + } + + @Override + public int limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public UsageCount unit() { + return this.inner().unit(); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsageInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsageInner.java new file mode 100644 index 0000000000000..473febdb8b5e8 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsageInner.java @@ -0,0 +1,126 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.UsageName; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.UsageCount; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Usage model. + */ +public class UsageInner { + /** + * The current usage value. + */ + @JsonProperty(value = "currentValue", required = true) + private int currentValue; + + /** + * limit of a given sku in a region for a subscription. The maximum + * permitted value for the usage quota. If there is no limit, this value + * will be -1. + */ + @JsonProperty(value = "limit", required = true) + private int limit; + + /** + * Usage name value and localized name. + */ + @JsonProperty(value = "name") + private UsageName name; + + /** + * The usages' unit. Possible values include: 'Count', 'Bytes', 'Seconds', + * 'Percent', 'CountPerSecond', 'BytesPerSecond'. + */ + @JsonProperty(value = "unit") + private UsageCount unit; + + /** + * Get the current usage value. + * + * @return the currentValue value + */ + public int currentValue() { + return this.currentValue; + } + + /** + * Set the current usage value. + * + * @param currentValue the currentValue value to set + * @return the UsageInner object itself. + */ + public UsageInner withCurrentValue(int currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get limit of a given sku in a region for a subscription. The maximum permitted value for the usage quota. If there is no limit, this value will be -1. + * + * @return the limit value + */ + public int limit() { + return this.limit; + } + + /** + * Set limit of a given sku in a region for a subscription. The maximum permitted value for the usage quota. If there is no limit, this value will be -1. + * + * @param limit the limit value to set + * @return the UsageInner object itself. + */ + public UsageInner withLimit(int limit) { + this.limit = limit; + return this; + } + + /** + * Get usage name value and localized name. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + + /** + * Set usage name value and localized name. + * + * @param name the name value to set + * @return the UsageInner object itself. + */ + public UsageInner withName(UsageName name) { + this.name = name; + return this; + } + + /** + * Get the usages' unit. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond'. + * + * @return the unit value + */ + public UsageCount unit() { + return this.unit; + } + + /** + * Set the usages' unit. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond'. + * + * @param unit the unit value to set + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UsageCount unit) { + this.unit = unit; + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsagesWithinRegionsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsagesWithinRegionsImpl.java new file mode 100644 index 0000000000000..753fa8724b82f --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsagesWithinRegionsImpl.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. + * abc + */ + +package com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.UsagesWithinRegions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.Usage; + +class UsagesWithinRegionsImpl extends WrapperImpl implements UsagesWithinRegions { + private final VMwareCloudSimpleManager manager; + + UsagesWithinRegionsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().usagesWithinRegions()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private UsageImpl wrapUsageModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + @Override + public Observable listAsync() { + UsagesWithinRegionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapUsageModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsagesWithinRegionsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsagesWithinRegionsInner.java new file mode 100644 index 0000000000000..24f9fd62f7682 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/UsagesWithinRegionsInner.java @@ -0,0 +1,414 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.Path; +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 UsagesWithinRegions. + */ +public class UsagesWithinRegionsInner { + /** The Retrofit service to perform REST calls. */ + private UsagesWithinRegionsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of UsagesWithinRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesWithinRegionsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(UsagesWithinRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for UsagesWithinRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesWithinRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.UsagesWithinRegions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/usages") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Query("$filter") String filter, @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.vmwarecloudsimple.v2019_04_01.UsagesWithinRegions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<UsageInner> 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(); + } + }; + } + + /** + * Implements Usages List method. + * Returns list of usage in 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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> 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)); + } + }); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> 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.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.list(this.client.subscriptionId(), this.client.regionId(), filter, 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); + } + } + }); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @param filter The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<UsageInner> object if successful. + */ + public PagedList list(final String filter) { + ServiceResponse> response = listSinglePageAsync(filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @param filter The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' + * @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 filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @param filter The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> listAsync(final String filter) { + return listWithServiceResponseAsync(filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @param filter The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter) { + return listSinglePageAsync(filter) + .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)); + } + }); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + ServiceResponse> * @param filter The filter to apply on the list operation. only name.value is allowed here as a filter e.g. $filter=name.value eq 'xxxx' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() 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.regionId(), filter, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<UsageInner> 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(); + } + }; + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @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); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @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<UsageInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + * @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<UsageInner> 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)); + } + }); + } + + /** + * Implements Usages List method. + * Returns list of usage in region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UsageInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VMwareCloudSimpleClientImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VMwareCloudSimpleClientImpl.java new file mode 100644 index 0000000000000..05f41e814300c --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VMwareCloudSimpleClientImpl.java @@ -0,0 +1,627 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.GetOperationResultByRegionHeaders; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the VMwareCloudSimpleClientImpl class. + */ +public class VMwareCloudSimpleClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private VMwareCloudSimpleClientService service; + /** 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; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** referer url. */ + private String referer; + + /** + * Gets referer url. + * + * @return the referer value. + */ + public String referer() { + return this.referer; + } + + /** + * Sets referer url. + * + * @param referer the referer value. + * @return the service client itself + */ + public VMwareCloudSimpleClientImpl withReferer(String referer) { + this.referer = referer; + return this; + } + + /** The region Id (westus, eastus). */ + private String regionId; + + /** + * Gets The region Id (westus, eastus). + * + * @return the regionId value. + */ + public String regionId() { + return this.regionId; + } + + /** + * Sets The region Id (westus, eastus). + * + * @param regionId the regionId value. + * @return the service client itself + */ + public VMwareCloudSimpleClientImpl withRegionId(String regionId) { + this.regionId = regionId; + return this; + } + + /** The subscription ID. */ + private String subscriptionId; + + /** + * Gets The subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public VMwareCloudSimpleClientImpl 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 VMwareCloudSimpleClientImpl 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 VMwareCloudSimpleClientImpl 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 VMwareCloudSimpleClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The AvailableOperationsInner object to access its operations. + */ + private AvailableOperationsInner availableOperations; + + /** + * Gets the AvailableOperationsInner object to access its operations. + * @return the AvailableOperationsInner object. + */ + public AvailableOperationsInner availableOperations() { + return this.availableOperations; + } + + /** + * The DedicatedCloudNodesInner object to access its operations. + */ + private DedicatedCloudNodesInner dedicatedCloudNodes; + + /** + * Gets the DedicatedCloudNodesInner object to access its operations. + * @return the DedicatedCloudNodesInner object. + */ + public DedicatedCloudNodesInner dedicatedCloudNodes() { + return this.dedicatedCloudNodes; + } + + /** + * The DedicatedCloudServicesInner object to access its operations. + */ + private DedicatedCloudServicesInner dedicatedCloudServices; + + /** + * Gets the DedicatedCloudServicesInner object to access its operations. + * @return the DedicatedCloudServicesInner object. + */ + public DedicatedCloudServicesInner dedicatedCloudServices() { + return this.dedicatedCloudServices; + } + + /** + * The SkusAvailabilityWithinRegionsInner object to access its operations. + */ + private SkusAvailabilityWithinRegionsInner skusAvailabilityWithinRegions; + + /** + * Gets the SkusAvailabilityWithinRegionsInner object to access its operations. + * @return the SkusAvailabilityWithinRegionsInner object. + */ + public SkusAvailabilityWithinRegionsInner skusAvailabilityWithinRegions() { + return this.skusAvailabilityWithinRegions; + } + + /** + * The PrivateCloudByRegionsInner object to access its operations. + */ + private PrivateCloudByRegionsInner privateCloudByRegions; + + /** + * Gets the PrivateCloudByRegionsInner object to access its operations. + * @return the PrivateCloudByRegionsInner object. + */ + public PrivateCloudByRegionsInner privateCloudByRegions() { + return this.privateCloudByRegions; + } + + /** + * The ResourcePoolsByPCsInner object to access its operations. + */ + private ResourcePoolsByPCsInner resourcePoolsByPCs; + + /** + * Gets the ResourcePoolsByPCsInner object to access its operations. + * @return the ResourcePoolsByPCsInner object. + */ + public ResourcePoolsByPCsInner resourcePoolsByPCs() { + return this.resourcePoolsByPCs; + } + + /** + * The ResourcePoolByPCsInner object to access its operations. + */ + private ResourcePoolByPCsInner resourcePoolByPCs; + + /** + * Gets the ResourcePoolByPCsInner object to access its operations. + * @return the ResourcePoolByPCsInner object. + */ + public ResourcePoolByPCsInner resourcePoolByPCs() { + return this.resourcePoolByPCs; + } + + /** + * The VirtualMachineTemplatesByPCsInner object to access its operations. + */ + private VirtualMachineTemplatesByPCsInner virtualMachineTemplatesByPCs; + + /** + * Gets the VirtualMachineTemplatesByPCsInner object to access its operations. + * @return the VirtualMachineTemplatesByPCsInner object. + */ + public VirtualMachineTemplatesByPCsInner virtualMachineTemplatesByPCs() { + return this.virtualMachineTemplatesByPCs; + } + + /** + * The VirtualMachineTemplateByPCsInner object to access its operations. + */ + private VirtualMachineTemplateByPCsInner virtualMachineTemplateByPCs; + + /** + * Gets the VirtualMachineTemplateByPCsInner object to access its operations. + * @return the VirtualMachineTemplateByPCsInner object. + */ + public VirtualMachineTemplateByPCsInner virtualMachineTemplateByPCs() { + return this.virtualMachineTemplateByPCs; + } + + /** + * The VirtualNetworksByPCsInner object to access its operations. + */ + private VirtualNetworksByPCsInner virtualNetworksByPCs; + + /** + * Gets the VirtualNetworksByPCsInner object to access its operations. + * @return the VirtualNetworksByPCsInner object. + */ + public VirtualNetworksByPCsInner virtualNetworksByPCs() { + return this.virtualNetworksByPCs; + } + + /** + * The VirtualNetworkByPCsInner object to access its operations. + */ + private VirtualNetworkByPCsInner virtualNetworkByPCs; + + /** + * Gets the VirtualNetworkByPCsInner object to access its operations. + * @return the VirtualNetworkByPCsInner object. + */ + public VirtualNetworkByPCsInner virtualNetworkByPCs() { + return this.virtualNetworkByPCs; + } + + /** + * The UsagesWithinRegionsInner object to access its operations. + */ + private UsagesWithinRegionsInner usagesWithinRegions; + + /** + * Gets the UsagesWithinRegionsInner object to access its operations. + * @return the UsagesWithinRegionsInner object. + */ + public UsagesWithinRegionsInner usagesWithinRegions() { + return this.usagesWithinRegions; + } + + /** + * The VirtualMachinesInner object to access its operations. + */ + private VirtualMachinesInner virtualMachines; + + /** + * Gets the VirtualMachinesInner object to access its operations. + * @return the VirtualMachinesInner object. + */ + public VirtualMachinesInner virtualMachines() { + return this.virtualMachines; + } + + /** + * Initializes an instance of VMwareCloudSimpleClient client. + * + * @param credentials the management credentials for Azure + */ + public VMwareCloudSimpleClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of VMwareCloudSimpleClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public VMwareCloudSimpleClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of VMwareCloudSimpleClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public VMwareCloudSimpleClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-04-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.availableOperations = new AvailableOperationsInner(restClient().retrofit(), this); + this.dedicatedCloudNodes = new DedicatedCloudNodesInner(restClient().retrofit(), this); + this.dedicatedCloudServices = new DedicatedCloudServicesInner(restClient().retrofit(), this); + this.skusAvailabilityWithinRegions = new SkusAvailabilityWithinRegionsInner(restClient().retrofit(), this); + this.privateCloudByRegions = new PrivateCloudByRegionsInner(restClient().retrofit(), this); + this.resourcePoolsByPCs = new ResourcePoolsByPCsInner(restClient().retrofit(), this); + this.resourcePoolByPCs = new ResourcePoolByPCsInner(restClient().retrofit(), this); + this.virtualMachineTemplatesByPCs = new VirtualMachineTemplatesByPCsInner(restClient().retrofit(), this); + this.virtualMachineTemplateByPCs = new VirtualMachineTemplateByPCsInner(restClient().retrofit(), this); + this.virtualNetworksByPCs = new VirtualNetworksByPCsInner(restClient().retrofit(), this); + this.virtualNetworkByPCs = new VirtualNetworkByPCsInner(restClient().retrofit(), this); + this.usagesWithinRegions = new UsagesWithinRegionsInner(restClient().retrofit(), this); + this.virtualMachines = new VirtualMachinesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * 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(), "VMwareCloudSimpleClient", "2019-04-01"); + } + + private void initializeService() { + service = restClient().retrofit().create(VMwareCloudSimpleClientService.class); + } + + /** + * The interface defining all the services for VMwareCloudSimpleClient to be + * used by Retrofit to perform actually REST calls. + */ + interface VMwareCloudSimpleClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VMwareCloudSimpleClient getOperationResultByRegion" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/operationResults/{operationId}") + Observable> getOperationResultByRegion(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("Referer") String referer, @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.vmwarecloudsimple.v2019_04_01.VMwareCloudSimpleClient getPrivateCloud" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}") + Observable> getPrivateCloud(@Path("subscriptionId") String subscriptionId, @Path("pcName") String pcName, @Path("regionId") String regionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements get of async operation. + * Return an async operation. + * + * @param operationId operation id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationResourceInner object if successful. + */ + public OperationResourceInner getOperationResultByRegion(String operationId) { + return getOperationResultByRegionWithServiceResponseAsync(operationId).toBlocking().single().body(); + } + + /** + * Implements get of async operation. + * Return an async operation. + * + * @param operationId operation id + * @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 getOperationResultByRegionAsync(String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getOperationResultByRegionWithServiceResponseAsync(operationId), serviceCallback); + } + + /** + * Implements get of async operation. + * Return an async operation. + * + * @param operationId operation id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationResourceInner object + */ + public Observable getOperationResultByRegionAsync(String operationId) { + return getOperationResultByRegionWithServiceResponseAsync(operationId).map(new Func1, OperationResourceInner>() { + @Override + public OperationResourceInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements get of async operation. + * Return an async operation. + * + * @param operationId operation id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationResourceInner object + */ + public Observable> getOperationResultByRegionWithServiceResponseAsync(String operationId) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (this.regionId() == null) { + throw new IllegalArgumentException("Parameter this.regionId() is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + if (this.referer() == null) { + throw new IllegalArgumentException("Parameter this.referer() is required and cannot be null."); + } + return service.getOperationResultByRegion(this.subscriptionId(), this.regionId(), operationId, this.apiVersion(), this.referer(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getOperationResultByRegionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getOperationResultByRegionDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, GetOperationResultByRegionHeaders.class); + } + + /** + * Implements private cloud GET method. + * Returns private cloud by its name. + * + * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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 getPrivateCloud(String pcName) { + return getPrivateCloudWithServiceResponseAsync(pcName).toBlocking().single().body(); + } + + /** + * Implements private cloud GET method. + * Returns private cloud by its name. + * + * @param pcName The private cloud 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 getPrivateCloudAsync(String pcName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPrivateCloudWithServiceResponseAsync(pcName), serviceCallback); + } + + /** + * Implements private cloud GET method. + * Returns private cloud by its name. + * + * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateCloudInner object + */ + public Observable getPrivateCloudAsync(String pcName) { + return getPrivateCloudWithServiceResponseAsync(pcName).map(new Func1, PrivateCloudInner>() { + @Override + public PrivateCloudInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements private cloud GET method. + * Returns private cloud by its name. + * + * @param pcName The private cloud name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateCloudInner object + */ + public Observable> getPrivateCloudWithServiceResponseAsync(String pcName) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (pcName == null) { + throw new IllegalArgumentException("Parameter pcName is required and cannot be null."); + } + if (this.regionId() == null) { + throw new IllegalArgumentException("Parameter this.regionId() is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.getPrivateCloud(this.subscriptionId(), pcName, this.regionId(), this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPrivateCloudDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPrivateCloudDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VMwareCloudSimpleManager.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VMwareCloudSimpleManager.java new file mode 100644 index 0000000000000..cb03c9a831da4 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VMwareCloudSimpleManager.java @@ -0,0 +1,243 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.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.vmwarecloudsimple.v2019_04_01.AvailableOperations; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudNodes; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.DedicatedCloudServices; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.SkusAvailabilityWithinRegions; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudByRegions; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.ResourcePoolsByPCs; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.ResourcePoolByPCs; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineTemplatesByPCs; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineTemplateByPCs; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNetworksByPCs; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNetworkByPCs; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.UsagesWithinRegions; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachines; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure VMwareCloudSimple resource management. + */ +public final class VMwareCloudSimpleManager extends ManagerCore { + private AvailableOperations availableOperations; + private DedicatedCloudNodes dedicatedCloudNodes; + private DedicatedCloudServices dedicatedCloudServices; + private SkusAvailabilityWithinRegions skusAvailabilityWithinRegions; + private PrivateCloudByRegions privateCloudByRegions; + private ResourcePoolsByPCs resourcePoolsByPCs; + private ResourcePoolByPCs resourcePoolByPCs; + private VirtualMachineTemplatesByPCs virtualMachineTemplatesByPCs; + private VirtualMachineTemplateByPCs virtualMachineTemplateByPCs; + private VirtualNetworksByPCs virtualNetworksByPCs; + private VirtualNetworkByPCs virtualNetworkByPCs; + private UsagesWithinRegions usagesWithinRegions; + private VirtualMachines virtualMachines; + /** + * Get a Configurable instance that can be used to create VMwareCloudSimpleManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new VMwareCloudSimpleManager.ConfigurableImpl(); + } + /** + * Creates an instance of VMwareCloudSimpleManager that exposes VMwareCloudSimple resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the VMwareCloudSimpleManager + */ + public static VMwareCloudSimpleManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new VMwareCloudSimpleManager(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 VMwareCloudSimpleManager that exposes VMwareCloudSimple resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the VMwareCloudSimpleManager + */ + public static VMwareCloudSimpleManager authenticate(RestClient restClient, String subscriptionId) { + return new VMwareCloudSimpleManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of VMwareCloudSimpleManager that exposes VMwareCloudSimple management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing VMwareCloudSimple management API entry points that work across subscriptions + */ + VMwareCloudSimpleManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage AvailableOperations. + */ + public AvailableOperations availableOperations() { + if (this.availableOperations == null) { + this.availableOperations = new AvailableOperationsImpl(this); + } + return this.availableOperations; + } + + /** + * @return Entry point to manage DedicatedCloudNodes. + */ + public DedicatedCloudNodes dedicatedCloudNodes() { + if (this.dedicatedCloudNodes == null) { + this.dedicatedCloudNodes = new DedicatedCloudNodesImpl(this); + } + return this.dedicatedCloudNodes; + } + + /** + * @return Entry point to manage DedicatedCloudServices. + */ + public DedicatedCloudServices dedicatedCloudServices() { + if (this.dedicatedCloudServices == null) { + this.dedicatedCloudServices = new DedicatedCloudServicesImpl(this); + } + return this.dedicatedCloudServices; + } + + /** + * @return Entry point to manage SkusAvailabilityWithinRegions. + */ + public SkusAvailabilityWithinRegions skusAvailabilityWithinRegions() { + if (this.skusAvailabilityWithinRegions == null) { + this.skusAvailabilityWithinRegions = new SkusAvailabilityWithinRegionsImpl(this); + } + return this.skusAvailabilityWithinRegions; + } + + /** + * @return Entry point to manage PrivateCloudByRegions. + */ + public PrivateCloudByRegions privateCloudByRegions() { + if (this.privateCloudByRegions == null) { + this.privateCloudByRegions = new PrivateCloudByRegionsImpl(this); + } + return this.privateCloudByRegions; + } + + /** + * @return Entry point to manage ResourcePoolsByPCs. + */ + public ResourcePoolsByPCs resourcePoolsByPCs() { + if (this.resourcePoolsByPCs == null) { + this.resourcePoolsByPCs = new ResourcePoolsByPCsImpl(this); + } + return this.resourcePoolsByPCs; + } + + /** + * @return Entry point to manage ResourcePoolByPCs. + */ + public ResourcePoolByPCs resourcePoolByPCs() { + if (this.resourcePoolByPCs == null) { + this.resourcePoolByPCs = new ResourcePoolByPCsImpl(this); + } + return this.resourcePoolByPCs; + } + + /** + * @return Entry point to manage VirtualMachineTemplatesByPCs. + */ + public VirtualMachineTemplatesByPCs virtualMachineTemplatesByPCs() { + if (this.virtualMachineTemplatesByPCs == null) { + this.virtualMachineTemplatesByPCs = new VirtualMachineTemplatesByPCsImpl(this); + } + return this.virtualMachineTemplatesByPCs; + } + + /** + * @return Entry point to manage VirtualMachineTemplateByPCs. + */ + public VirtualMachineTemplateByPCs virtualMachineTemplateByPCs() { + if (this.virtualMachineTemplateByPCs == null) { + this.virtualMachineTemplateByPCs = new VirtualMachineTemplateByPCsImpl(this); + } + return this.virtualMachineTemplateByPCs; + } + + /** + * @return Entry point to manage VirtualNetworksByPCs. + */ + public VirtualNetworksByPCs virtualNetworksByPCs() { + if (this.virtualNetworksByPCs == null) { + this.virtualNetworksByPCs = new VirtualNetworksByPCsImpl(this); + } + return this.virtualNetworksByPCs; + } + + /** + * @return Entry point to manage VirtualNetworkByPCs. + */ + public VirtualNetworkByPCs virtualNetworkByPCs() { + if (this.virtualNetworkByPCs == null) { + this.virtualNetworkByPCs = new VirtualNetworkByPCsImpl(this); + } + return this.virtualNetworkByPCs; + } + + /** + * @return Entry point to manage UsagesWithinRegions. + */ + public UsagesWithinRegions usagesWithinRegions() { + if (this.usagesWithinRegions == null) { + this.usagesWithinRegions = new UsagesWithinRegionsImpl(this); + } + return this.usagesWithinRegions; + } + + /** + * @return Entry point to manage VirtualMachines. + */ + public VirtualMachines virtualMachines() { + if (this.virtualMachines == null) { + this.virtualMachines = new VirtualMachinesImpl(this); + } + return this.virtualMachines; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public VMwareCloudSimpleManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return VMwareCloudSimpleManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private VMwareCloudSimpleManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new VMwareCloudSimpleClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineImpl.java new file mode 100644 index 0000000000000..3b15cc7a3d166 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineImpl.java @@ -0,0 +1,241 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachine; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDiskController; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDisk; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.GuestOSType; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNic; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineStatus; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationResourcePool; + +class VirtualMachineImpl extends GroupableResourceCoreImpl implements VirtualMachine, VirtualMachine.Definition, VirtualMachine.Update { + VirtualMachineImpl(String name, VirtualMachineInner inner, VMwareCloudSimpleManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + VirtualMachinesInner client = this.manager().inner().virtualMachines(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VirtualMachinesInner client = this.manager().inner().virtualMachines(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VirtualMachinesInner client = this.manager().inner().virtualMachines(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public int amountOfRam() { + return this.inner().amountOfRam(); + } + + @Override + public List controllers() { + return this.inner().controllers(); + } + + @Override + public List disks() { + return this.inner().disks(); + } + + @Override + public String dnsname() { + return this.inner().dnsname(); + } + + @Override + public Boolean exposeToGuestVM() { + return this.inner().exposeToGuestVM(); + } + + @Override + public String folder() { + return this.inner().folder(); + } + + @Override + public String guestOS() { + return this.inner().guestOS(); + } + + @Override + public GuestOSType guestOSType() { + return this.inner().guestOSType(); + } + + @Override + public List nics() { + return this.inner().nics(); + } + + @Override + public int numberOfCores() { + return this.inner().numberOfCores(); + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String privateCloudId() { + return this.inner().privateCloudId(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publicIP() { + return this.inner().publicIP(); + } + + @Override + public PrivateCloudLocationResourcePool resourcePool() { + ResourcePoolInner inner = this.inner().resourcePool(); + if (inner != null) { + return new PrivateCloudLocationResourcePoolImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public VirtualMachineStatus status() { + return this.inner().status(); + } + + @Override + public String templateId() { + return this.inner().templateId(); + } + + @Override + public String username() { + return this.inner().username(); + } + + @Override + public String vmId() { + return this.inner().vmId(); + } + + @Override + public String vmwaretools() { + return this.inner().vmwaretools(); + } + + @Override + public List vSphereNetworks() { + return this.inner().vSphereNetworks(); + } + + @Override + public VirtualMachineImpl withAmountOfRam(int amountOfRam) { + this.inner().withAmountOfRam(amountOfRam); + return this; + } + + @Override + public VirtualMachineImpl withGuestOS(String guestOS) { + this.inner().withGuestOS(guestOS); + return this; + } + + @Override + public VirtualMachineImpl withGuestOSType(GuestOSType guestOSType) { + this.inner().withGuestOSType(guestOSType); + return this; + } + + @Override + public VirtualMachineImpl withNumberOfCores(int numberOfCores) { + this.inner().withNumberOfCores(numberOfCores); + return this; + } + + @Override + public VirtualMachineImpl withPrivateCloudId(String privateCloudId) { + this.inner().withPrivateCloudId(privateCloudId); + return this; + } + + @Override + public VirtualMachineImpl withDisks(List disks) { + this.inner().withDisks(disks); + return this; + } + + @Override + public VirtualMachineImpl withExposeToGuestVM(Boolean exposeToGuestVM) { + this.inner().withExposeToGuestVM(exposeToGuestVM); + return this; + } + + @Override + public VirtualMachineImpl withNics(List nics) { + this.inner().withNics(nics); + return this; + } + + @Override + public VirtualMachineImpl withPassword(String password) { + this.inner().withPassword(password); + return this; + } + + @Override + public VirtualMachineImpl withResourcePool(ResourcePoolInner resourcePool) { + this.inner().withResourcePool(resourcePool); + return this; + } + + @Override + public VirtualMachineImpl withTemplateId(String templateId) { + this.inner().withTemplateId(templateId); + return this; + } + + @Override + public VirtualMachineImpl withUsername(String username) { + this.inner().withUsername(username); + return this; + } + + @Override + public VirtualMachineImpl withVSphereNetworks(List vSphereNetworks) { + this.inner().withVSphereNetworks(vSphereNetworks); + return this; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineInner.java new file mode 100644 index 0000000000000..556e1ff762e27 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineInner.java @@ -0,0 +1,485 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDiskController; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDisk; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.GuestOSType; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNic; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Virtual machine model. + */ +@JsonFlatten +public class VirtualMachineInner extends Resource { + /** + * The amount of memory. + */ + @JsonProperty(value = "properties.amountOfRam", required = true) + private int amountOfRam; + + /** + * The list of Virtual Disks' Controllers. + */ + @JsonProperty(value = "properties.controllers", access = JsonProperty.Access.WRITE_ONLY) + private List controllers; + + /** + * The list of Virtual Disks. + */ + @JsonProperty(value = "properties.disks") + private List disks; + + /** + * The DNS name of Virtual Machine in VCenter. + */ + @JsonProperty(value = "properties.dnsname", access = JsonProperty.Access.WRITE_ONLY) + private String dnsname; + + /** + * Expose Guest OS or not. + */ + @JsonProperty(value = "properties.exposeToGuestVM") + private Boolean exposeToGuestVM; + + /** + * The path to virtual machine folder in VCenter. + */ + @JsonProperty(value = "properties.folder", access = JsonProperty.Access.WRITE_ONLY) + private String folder; + + /** + * The name of Guest OS. + */ + @JsonProperty(value = "properties.guestOS", required = true) + private String guestOS; + + /** + * The Guest OS type. Possible values include: 'linux', 'windows', 'other'. + */ + @JsonProperty(value = "properties.guestOSType", required = true) + private GuestOSType guestOSType; + + /** + * The list of Virtual NICs. + */ + @JsonProperty(value = "properties.nics") + private List nics; + + /** + * The number of CPU cores. + */ + @JsonProperty(value = "properties.numberOfCores", required = true) + private int numberOfCores; + + /** + * Password for login. + */ + @JsonProperty(value = "properties.password") + private String password; + + /** + * Private Cloud Id. + */ + @JsonProperty(value = "properties.privateCloudId", required = true) + private String privateCloudId; + + /** + * The provisioning status of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The public ip of Virtual Machine. + */ + @JsonProperty(value = "properties.publicIP", access = JsonProperty.Access.WRITE_ONLY) + private String publicIP; + + /** + * Virtual Machines Resource Pool. + */ + @JsonProperty(value = "properties.resourcePool") + private ResourcePoolInner resourcePool; + + /** + * The status of Virtual machine. Possible values include: 'running', + * 'suspended', 'poweredoff', 'updating', 'deallocating', 'deleting'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineStatus status; + + /** + * Virtual Machine Template Id. + */ + @JsonProperty(value = "properties.templateId") + private String templateId; + + /** + * Username for login. + */ + @JsonProperty(value = "properties.username") + private String username; + + /** + * The list of Virtual VSphere Networks. + */ + @JsonProperty(value = "properties.vSphereNetworks") + private List vSphereNetworks; + + /** + * The internal id of Virtual Machine in VCenter. + */ + @JsonProperty(value = "properties.vmId", access = JsonProperty.Access.WRITE_ONLY) + private String vmId; + + /** + * VMware tools version. + */ + @JsonProperty(value = "properties.vmwaretools", access = JsonProperty.Access.WRITE_ONLY) + private String vmwaretools; + + /** + * Get the amount of memory. + * + * @return the amountOfRam value + */ + public int amountOfRam() { + return this.amountOfRam; + } + + /** + * Set the amount of memory. + * + * @param amountOfRam the amountOfRam value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withAmountOfRam(int amountOfRam) { + this.amountOfRam = amountOfRam; + return this; + } + + /** + * Get the list of Virtual Disks' Controllers. + * + * @return the controllers value + */ + public List controllers() { + return this.controllers; + } + + /** + * Get the list of Virtual Disks. + * + * @return the disks value + */ + public List disks() { + return this.disks; + } + + /** + * Set the list of Virtual Disks. + * + * @param disks the disks value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get the DNS name of Virtual Machine in VCenter. + * + * @return the dnsname value + */ + public String dnsname() { + return this.dnsname; + } + + /** + * Get expose Guest OS or not. + * + * @return the exposeToGuestVM value + */ + public Boolean exposeToGuestVM() { + return this.exposeToGuestVM; + } + + /** + * Set expose Guest OS or not. + * + * @param exposeToGuestVM the exposeToGuestVM value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withExposeToGuestVM(Boolean exposeToGuestVM) { + this.exposeToGuestVM = exposeToGuestVM; + return this; + } + + /** + * Get the path to virtual machine folder in VCenter. + * + * @return the folder value + */ + public String folder() { + return this.folder; + } + + /** + * Get the name of Guest OS. + * + * @return the guestOS value + */ + public String guestOS() { + return this.guestOS; + } + + /** + * Set the name of Guest OS. + * + * @param guestOS the guestOS value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withGuestOS(String guestOS) { + this.guestOS = guestOS; + return this; + } + + /** + * Get the Guest OS type. Possible values include: 'linux', 'windows', 'other'. + * + * @return the guestOSType value + */ + public GuestOSType guestOSType() { + return this.guestOSType; + } + + /** + * Set the Guest OS type. Possible values include: 'linux', 'windows', 'other'. + * + * @param guestOSType the guestOSType value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withGuestOSType(GuestOSType guestOSType) { + this.guestOSType = guestOSType; + return this; + } + + /** + * Get the list of Virtual NICs. + * + * @return the nics value + */ + public List nics() { + return this.nics; + } + + /** + * Set the list of Virtual NICs. + * + * @param nics the nics value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withNics(List nics) { + this.nics = nics; + return this; + } + + /** + * Get the number of CPU cores. + * + * @return the numberOfCores value + */ + public int numberOfCores() { + return this.numberOfCores; + } + + /** + * Set the number of CPU cores. + * + * @param numberOfCores the numberOfCores value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withNumberOfCores(int numberOfCores) { + this.numberOfCores = numberOfCores; + return this; + } + + /** + * Get password for login. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set password for login. + * + * @param password the password value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get private Cloud Id. + * + * @return the privateCloudId value + */ + public String privateCloudId() { + return this.privateCloudId; + } + + /** + * Set private Cloud Id. + * + * @param privateCloudId the privateCloudId value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPrivateCloudId(String privateCloudId) { + this.privateCloudId = privateCloudId; + return this; + } + + /** + * Get the provisioning status of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the public ip of Virtual Machine. + * + * @return the publicIP value + */ + public String publicIP() { + return this.publicIP; + } + + /** + * Get virtual Machines Resource Pool. + * + * @return the resourcePool value + */ + public ResourcePoolInner resourcePool() { + return this.resourcePool; + } + + /** + * Set virtual Machines Resource Pool. + * + * @param resourcePool the resourcePool value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withResourcePool(ResourcePoolInner resourcePool) { + this.resourcePool = resourcePool; + return this; + } + + /** + * Get the status of Virtual machine. Possible values include: 'running', 'suspended', 'poweredoff', 'updating', 'deallocating', 'deleting'. + * + * @return the status value + */ + public VirtualMachineStatus status() { + return this.status; + } + + /** + * Get virtual Machine Template Id. + * + * @return the templateId value + */ + public String templateId() { + return this.templateId; + } + + /** + * Set virtual Machine Template Id. + * + * @param templateId the templateId value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withTemplateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * Get username for login. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set username for login. + * + * @param username the username value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of Virtual VSphere Networks. + * + * @return the vSphereNetworks value + */ + public List vSphereNetworks() { + return this.vSphereNetworks; + } + + /** + * Set the list of Virtual VSphere Networks. + * + * @param vSphereNetworks the vSphereNetworks value to set + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withVSphereNetworks(List vSphereNetworks) { + this.vSphereNetworks = vSphereNetworks; + return this; + } + + /** + * Get the internal id of Virtual Machine in VCenter. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Get vMware tools version. + * + * @return the vmwaretools value + */ + public String vmwaretools() { + return this.vmwaretools; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateByPCsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateByPCsImpl.java new file mode 100644 index 0000000000000..d33514bd86965 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateByPCsImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineTemplateByPCs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualMachineTemplateModel; + +class VirtualMachineTemplateByPCsImpl extends WrapperImpl implements VirtualMachineTemplateByPCs { + private final VMwareCloudSimpleManager manager; + + VirtualMachineTemplateByPCsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().virtualMachineTemplateByPCs()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private PrivateCloudLocationVirtualMachineTemplateModelImpl wrapModel(VirtualMachineTemplateInner inner) { + return new PrivateCloudLocationVirtualMachineTemplateModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String pcName, String virtualMachineTemplateName) { + VirtualMachineTemplateByPCsInner client = this.inner(); + return client.getAsync(pcName, virtualMachineTemplateName) + .map(new Func1() { + @Override + public PrivateCloudLocationVirtualMachineTemplateModel call(VirtualMachineTemplateInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateByPCsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateByPCsInner.java new file mode 100644 index 0000000000000..b01222b38afcd --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateByPCsInner.java @@ -0,0 +1,153 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 VirtualMachineTemplateByPCs. + */ +public class VirtualMachineTemplateByPCsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualMachineTemplateByPCsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of VirtualMachineTemplateByPCsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualMachineTemplateByPCsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(VirtualMachineTemplateByPCsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualMachineTemplateByPCs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualMachineTemplateByPCsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineTemplateByPCs get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates/{virtualMachineTemplateName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Path("pcName") String pcName, @Path("virtualMachineTemplateName") String virtualMachineTemplateName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements virtual machine template GET method. + * Returns virtual machine templates by its name. + * + * @param pcName The private cloud name + * @param virtualMachineTemplateName virtual machine template id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineTemplateInner object if successful. + */ + public VirtualMachineTemplateInner get(String pcName, String virtualMachineTemplateName) { + return getWithServiceResponseAsync(pcName, virtualMachineTemplateName).toBlocking().single().body(); + } + + /** + * Implements virtual machine template GET method. + * Returns virtual machine templates by its name. + * + * @param pcName The private cloud name + * @param virtualMachineTemplateName virtual machine template id (vsphereId) + * @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 pcName, String virtualMachineTemplateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(pcName, virtualMachineTemplateName), serviceCallback); + } + + /** + * Implements virtual machine template GET method. + * Returns virtual machine templates by its name. + * + * @param pcName The private cloud name + * @param virtualMachineTemplateName virtual machine template id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineTemplateInner object + */ + public Observable getAsync(String pcName, String virtualMachineTemplateName) { + return getWithServiceResponseAsync(pcName, virtualMachineTemplateName).map(new Func1, VirtualMachineTemplateInner>() { + @Override + public VirtualMachineTemplateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine template GET method. + * Returns virtual machine templates by its name. + * + * @param pcName The private cloud name + * @param virtualMachineTemplateName virtual machine template id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineTemplateInner object + */ + public Observable> getWithServiceResponseAsync(String pcName, String virtualMachineTemplateName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() is required and cannot be null."); + } + if (pcName == null) { + throw new IllegalArgumentException("Parameter pcName is required and cannot be null."); + } + if (virtualMachineTemplateName == null) { + throw new IllegalArgumentException("Parameter virtualMachineTemplateName 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(), this.client.regionId(), pcName, virtualMachineTemplateName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateInner.java new file mode 100644 index 0000000000000..de8475f332f4f --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplateInner.java @@ -0,0 +1,447 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDiskController; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualDisk; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNic; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Virtual machine template model. + */ +@JsonFlatten +public class VirtualMachineTemplateInner { + /** + * virtual machine template id (privateCloudId:vsphereId). + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Azure region. + */ + @JsonProperty(value = "location") + private String location; + + /** + * {virtualMachineTemplateName}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The amount of memory. + */ + @JsonProperty(value = "properties.amountOfRam") + private Integer amountOfRam; + + /** + * The list of Virtual Disk Controllers. + */ + @JsonProperty(value = "properties.controllers") + private List controllers; + + /** + * The description of Virtual Machine Template. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The list of Virtual Disks. + */ + @JsonProperty(value = "properties.disks") + private List disks; + + /** + * Expose Guest OS or not. + */ + @JsonProperty(value = "properties.exposeToGuestVM") + private Boolean exposeToGuestVM; + + /** + * The Guest OS. + */ + @JsonProperty(value = "properties.guestOS", required = true) + private String guestOS; + + /** + * The Guest OS types. + */ + @JsonProperty(value = "properties.guestOSType", required = true) + private String guestOSType; + + /** + * The list of Virtual NICs. + */ + @JsonProperty(value = "properties.nics") + private List nics; + + /** + * The number of CPU cores. + */ + @JsonProperty(value = "properties.numberOfCores") + private Integer numberOfCores; + + /** + * path to folder. + */ + @JsonProperty(value = "properties.path") + private String path; + + /** + * The Private Cloud Id. + */ + @JsonProperty(value = "properties.privateCloudId", required = true) + private String privateCloudId; + + /** + * The list of VSphere networks. + */ + @JsonProperty(value = "properties.vSphereNetworks") + private List vSphereNetworks; + + /** + * The tags from VSphere. + */ + @JsonProperty(value = "properties.vSphereTags") + private List vSphereTags; + + /** + * The VMware tools version. + */ + @JsonProperty(value = "properties.vmwaretools", access = JsonProperty.Access.WRITE_ONLY) + private String vmwaretools; + + /** + * {resourceProviderNamespace}/{resourceType}. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get virtual machine template id (privateCloudId:vsphereId). + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get azure region. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure region. + * + * @param location the location value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get {virtualMachineTemplateName}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the amount of memory. + * + * @return the amountOfRam value + */ + public Integer amountOfRam() { + return this.amountOfRam; + } + + /** + * Set the amount of memory. + * + * @param amountOfRam the amountOfRam value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withAmountOfRam(Integer amountOfRam) { + this.amountOfRam = amountOfRam; + return this; + } + + /** + * Get the list of Virtual Disk Controllers. + * + * @return the controllers value + */ + public List controllers() { + return this.controllers; + } + + /** + * Set the list of Virtual Disk Controllers. + * + * @param controllers the controllers value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withControllers(List controllers) { + this.controllers = controllers; + return this; + } + + /** + * Get the description of Virtual Machine Template. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of Virtual Machine Template. + * + * @param description the description value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the list of Virtual Disks. + * + * @return the disks value + */ + public List disks() { + return this.disks; + } + + /** + * Set the list of Virtual Disks. + * + * @param disks the disks value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get expose Guest OS or not. + * + * @return the exposeToGuestVM value + */ + public Boolean exposeToGuestVM() { + return this.exposeToGuestVM; + } + + /** + * Set expose Guest OS or not. + * + * @param exposeToGuestVM the exposeToGuestVM value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withExposeToGuestVM(Boolean exposeToGuestVM) { + this.exposeToGuestVM = exposeToGuestVM; + return this; + } + + /** + * Get the Guest OS. + * + * @return the guestOS value + */ + public String guestOS() { + return this.guestOS; + } + + /** + * Set the Guest OS. + * + * @param guestOS the guestOS value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withGuestOS(String guestOS) { + this.guestOS = guestOS; + return this; + } + + /** + * Get the Guest OS types. + * + * @return the guestOSType value + */ + public String guestOSType() { + return this.guestOSType; + } + + /** + * Set the Guest OS types. + * + * @param guestOSType the guestOSType value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withGuestOSType(String guestOSType) { + this.guestOSType = guestOSType; + return this; + } + + /** + * Get the list of Virtual NICs. + * + * @return the nics value + */ + public List nics() { + return this.nics; + } + + /** + * Set the list of Virtual NICs. + * + * @param nics the nics value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withNics(List nics) { + this.nics = nics; + return this; + } + + /** + * Get the number of CPU cores. + * + * @return the numberOfCores value + */ + public Integer numberOfCores() { + return this.numberOfCores; + } + + /** + * Set the number of CPU cores. + * + * @param numberOfCores the numberOfCores value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withNumberOfCores(Integer numberOfCores) { + this.numberOfCores = numberOfCores; + return this; + } + + /** + * Get path to folder. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set path to folder. + * + * @param path the path value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the Private Cloud Id. + * + * @return the privateCloudId value + */ + public String privateCloudId() { + return this.privateCloudId; + } + + /** + * Set the Private Cloud Id. + * + * @param privateCloudId the privateCloudId value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withPrivateCloudId(String privateCloudId) { + this.privateCloudId = privateCloudId; + return this; + } + + /** + * Get the list of VSphere networks. + * + * @return the vSphereNetworks value + */ + public List vSphereNetworks() { + return this.vSphereNetworks; + } + + /** + * Set the list of VSphere networks. + * + * @param vSphereNetworks the vSphereNetworks value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withVSphereNetworks(List vSphereNetworks) { + this.vSphereNetworks = vSphereNetworks; + return this; + } + + /** + * Get the tags from VSphere. + * + * @return the vSphereTags value + */ + public List vSphereTags() { + return this.vSphereTags; + } + + /** + * Set the tags from VSphere. + * + * @param vSphereTags the vSphereTags value to set + * @return the VirtualMachineTemplateInner object itself. + */ + public VirtualMachineTemplateInner withVSphereTags(List vSphereTags) { + this.vSphereTags = vSphereTags; + return this; + } + + /** + * Get the VMware tools version. + * + * @return the vmwaretools value + */ + public String vmwaretools() { + return this.vmwaretools; + } + + /** + * Get {resourceProviderNamespace}/{resourceType}. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplatesByPCsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplatesByPCsImpl.java new file mode 100644 index 0000000000000..c17c991da8ae6 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplatesByPCsImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineTemplatesByPCs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualMachineTemplate; + +class VirtualMachineTemplatesByPCsImpl extends WrapperImpl implements VirtualMachineTemplatesByPCs { + private final VMwareCloudSimpleManager manager; + + VirtualMachineTemplatesByPCsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().virtualMachineTemplatesByPCs()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private PrivateCloudLocationVirtualMachineTemplateImpl wrapModel(VirtualMachineTemplateInner inner) { + return new PrivateCloudLocationVirtualMachineTemplateImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String pcName, final String resourcePoolName) { + VirtualMachineTemplatesByPCsInner client = this.inner(); + return client.listAsync(pcName, resourcePoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateCloudLocationVirtualMachineTemplate call(VirtualMachineTemplateInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplatesByPCsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplatesByPCsInner.java new file mode 100644 index 0000000000000..5b7f42604be90 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachineTemplatesByPCsInner.java @@ -0,0 +1,316 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.Path; +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 VirtualMachineTemplatesByPCs. + */ +public class VirtualMachineTemplatesByPCsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualMachineTemplatesByPCsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of VirtualMachineTemplatesByPCsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualMachineTemplatesByPCsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(VirtualMachineTemplatesByPCsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualMachineTemplatesByPCs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualMachineTemplatesByPCsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineTemplatesByPCs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("pcName") String pcName, @Path("regionId") String regionId, @Query("api-version") String apiVersion, @Query("resourcePoolName") String resourcePoolName, @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.vmwarecloudsimple.v2019_04_01.VirtualMachineTemplatesByPCs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineTemplateInner> object if successful. + */ + public PagedList list(final String pcName, final String resourcePoolName) { + ServiceResponse> response = listSinglePageAsync(pcName, resourcePoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @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 pcName, final String resourcePoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(pcName, resourcePoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineTemplateInner> object + */ + public Observable> listAsync(final String pcName, final String resourcePoolName) { + return listWithServiceResponseAsync(pcName, resourcePoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineTemplateInner> object + */ + public Observable>> listWithServiceResponseAsync(final String pcName, final String resourcePoolName) { + return listSinglePageAsync(pcName, resourcePoolName) + .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)); + } + }); + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for private cloud. + * + ServiceResponse> * @param pcName The private cloud name + ServiceResponse> * @param resourcePoolName Resource pool used to derive vSphere cluster which contains VM templates + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineTemplateInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String pcName, final String resourcePoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (pcName == null) { + throw new IllegalArgumentException("Parameter pcName is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() 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 (resourcePoolName == null) { + throw new IllegalArgumentException("Parameter resourcePoolName is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), pcName, this.client.regionId(), this.client.apiVersion(), resourcePoolName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineTemplateInner> 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(); + } + }; + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for 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); + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for 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<VirtualMachineTemplateInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for 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<VirtualMachineTemplateInner> 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)); + } + }); + } + + /** + * Implements list of available VM templates. + * Returns list of virtual machine templates in region for 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<VirtualMachineTemplateInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachinesImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachinesImpl.java new file mode 100644 index 0000000000000..d224f1443d93b --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachinesImpl.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. + * def + */ + +package com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachines; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachine; +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; + +class VirtualMachinesImpl extends GroupableResourcesCoreImpl implements VirtualMachines { + protected VirtualMachinesImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().virtualMachines(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + VirtualMachinesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + VirtualMachinesInner 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) { + VirtualMachinesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + VirtualMachinesInner 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 VirtualMachine call(VirtualMachineInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + VirtualMachinesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + VirtualMachinesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VirtualMachine call(VirtualMachineInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public VirtualMachineImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable startAsync(String resourceGroupName, String virtualMachineName) { + VirtualMachinesInner client = this.inner(); + return client.startAsync(resourceGroupName, virtualMachineName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String virtualMachineName) { + VirtualMachinesInner client = this.inner(); + return client.stopAsync(resourceGroupName, virtualMachineName).toCompletable(); + } + + @Override + protected VirtualMachineImpl wrapModel(VirtualMachineInner inner) { + return new VirtualMachineImpl(inner.name(), inner, manager()); + } + + @Override + protected VirtualMachineImpl wrapModel(String name) { + return new VirtualMachineImpl(name, new VirtualMachineInner(), this.manager()); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachinesInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachinesInner.java new file mode 100644 index 0000000000000..e89246186e46d --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualMachinesInner.java @@ -0,0 +1,2169 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.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.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PatchPayload; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.StopMode; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineCreateOrUpdateHeaders; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineDeleteHeaders; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineStartHeaders; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineStopHeaders; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachineStopMode; +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.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +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 VirtualMachines. + */ +public class VirtualMachinesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VirtualMachinesService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of VirtualMachinesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualMachinesInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(VirtualMachinesService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualMachines to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualMachinesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachines list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/virtualMachines") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skipToken") String skipToken, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @Query("$skipToken") String skipToken, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @Body VirtualMachineInner virtualMachineRequest, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @Body VirtualMachineInner virtualMachineRequest, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PatchPayload virtualMachineRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachines beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body PatchPayload virtualMachineRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachines start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @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.vmwarecloudsimple.v2019_04_01.VirtualMachines stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @Query("mode") StopMode mode, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VirtualMachineStopMode m, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachines beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("virtualMachineName") String virtualMachineName, @Header("Referer") String referer, @Query("mode") StopMode mode, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VirtualMachineStopMode m, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualMachines listNext" }) + @GET + Observable> listNext(@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.vmwarecloudsimple.v2019_04_01.VirtualMachines listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineInner> 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(); + } + }; + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within 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); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> 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)); + } + }); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineInner> 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."); + } + final String filter = null; + final Integer top = null; + final String skipToken = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), filter, top, skipToken, 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); + } + } + }); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineInner> object if successful. + */ + public PagedList list(final String filter, final Integer top, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(filter, top, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @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 filter, final Integer top, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(filter, top, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable> listAsync(final String filter, final Integer top, final String skipToken) { + return listWithServiceResponseAsync(filter, top, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top, final String skipToken) { + return listSinglePageAsync(filter, top, skipToken) + .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)); + } + }); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + ServiceResponse> * @param filter The filter to apply on the list operation + ServiceResponse> * @param top The maximum number of record sets to return + ServiceResponse> * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String filter, final Integer top, final String skipToken) { + 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(), filter, top, skipToken, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineInner> 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(); + } + }; + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource 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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> 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)); + } + }); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineInner> 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."); + } + final String filter = null; + final Integer top = null; + final String skipToken = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), filter, top, skipToken, 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); + } + } + }); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @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 String filter, final Integer top, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, filter, top, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param resourceGroupName The name of the resource group + * @param filter The filter to apply on the list operation + * @param top The maximum number of record sets to return + * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + return listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skipToken) + .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)); + } + }); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group + ServiceResponse> * @param filter The filter to apply on the list operation + ServiceResponse> * @param top The maximum number of record sets to return + ServiceResponse> * @param skipToken to be used by nextLink implementation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String filter, final Integer top, final String skipToken) { + 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(), filter, top, skipToken, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements virtual machine GET method. + * Get virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineInner object if successful. + */ + public VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().single().body(); + } + + /** + * Implements virtual machine GET method. + * Get virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 getByResourceGroupAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements virtual machine GET method. + * Get virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String virtualMachineName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine GET method. + * Get virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName 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, virtualMachineName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineInner object if successful. + */ + public VirtualMachineInner createOrUpdate(String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineRequest) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, virtualMachineRequest).toBlocking().last().body(); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @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 virtualMachineName, VirtualMachineInner virtualMachineRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, virtualMachineRequest), serviceCallback); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineRequest) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, virtualMachineRequest).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineRequest) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (virtualMachineRequest == null) { + throw new IllegalArgumentException("Parameter virtualMachineRequest 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(virtualMachineRequest); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), virtualMachineRequest, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), VirtualMachineCreateOrUpdateHeaders.class); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineInner object if successful. + */ + public VirtualMachineInner beginCreateOrUpdate(String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineRequest) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, virtualMachineRequest).toBlocking().single().body(); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @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 virtualMachineName, VirtualMachineInner virtualMachineRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, virtualMachineRequest), serviceCallback); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineRequest) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, virtualMachineRequest).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine PUT method. + * Create Or Update Virtual Machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param virtualMachineRequest Create or Update Virtual Machine request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineRequest) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (virtualMachineRequest == null) { + throw new IllegalArgumentException("Parameter virtualMachineRequest 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(virtualMachineRequest); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), virtualMachineRequest, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateOrUpdateDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, VirtualMachineCreateOrUpdateHeaders.class); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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 virtualMachineName) { + deleteWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().last().body(); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 deleteAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualMachineName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() 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, virtualMachineName, this.client.referer(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), VirtualMachineDeleteHeaders.class); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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 virtualMachineName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().single().body(); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 beginDeleteAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualMachineName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine DELETE method. + * Delete virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() 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, virtualMachineName, this.client.referer(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, VirtualMachineDeleteHeaders.class); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineInner object if successful. + */ + public VirtualMachineInner update(String resourceGroupName, String virtualMachineName) { + return updateWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().last().body(); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 updateAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String virtualMachineName) { + return updateWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + PatchPayload virtualMachineRequest = new PatchPayload(); + virtualMachineRequest.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.apiVersion(), this.client.acceptLanguage(), virtualMachineRequest, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineInner object if successful. + */ + public VirtualMachineInner update(String resourceGroupName, String virtualMachineName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, virtualMachineName, tags).toBlocking().last().body(); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @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 virtualMachineName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, virtualMachineName, tags), serviceCallback); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String virtualMachineName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, virtualMachineName, tags).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String virtualMachineName, Map tags) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName 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(tags); + PatchPayload virtualMachineRequest = new PatchPayload(); + virtualMachineRequest.withTags(tags); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.apiVersion(), this.client.acceptLanguage(), virtualMachineRequest, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineInner object if successful. + */ + public VirtualMachineInner beginUpdate(String resourceGroupName, String virtualMachineName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().single().body(); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 beginUpdateAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String virtualMachineName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + PatchPayload virtualMachineRequest = new PatchPayload(); + virtualMachineRequest.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.apiVersion(), this.client.acceptLanguage(), virtualMachineRequest, 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); + } + } + }); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualMachineInner object if successful. + */ + public VirtualMachineInner beginUpdate(String resourceGroupName, String virtualMachineName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, tags).toBlocking().single().body(); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @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 virtualMachineName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, tags), serviceCallback); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String virtualMachineName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, virtualMachineName, tags).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements virtual machine PATCH method. + * Patch virtual machine properties. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param tags The tags key:value pairs + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualMachineInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String virtualMachineName, Map tags) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName 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(tags); + PatchPayload virtualMachineRequest = new PatchPayload(); + virtualMachineRequest.withTags(tags); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.apiVersion(), this.client.acceptLanguage(), virtualMachineRequest, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String virtualMachineName) { + startWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().last().body(); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 startAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(startWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String virtualMachineName) { + return startWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() 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.start(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), VirtualMachineStartHeaders.class); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String virtualMachineName) { + beginStartWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().single().body(); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 beginStartAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginStartWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String virtualMachineName) { + return beginStartWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements a start method for a virtual machine. + * Power on virtual machine. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() 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.beginStart(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginStartDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, VirtualMachineStartHeaders.class); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String virtualMachineName) { + stopWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().last().body(); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 stopAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(stopWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String virtualMachineName) { + return stopWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final StopMode mode = null; + final StopMode mode1 = null; + VirtualMachineStopMode m = new VirtualMachineStopMode(); + m.withMode(null); + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), mode, this.client.apiVersion(), this.client.acceptLanguage(), m, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), VirtualMachineStopHeaders.class); + } + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1) { + stopWithServiceResponseAsync(resourceGroupName, virtualMachineName, mode, mode1).toBlocking().last().body(); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @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 stopAsync(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(stopWithServiceResponseAsync(resourceGroupName, virtualMachineName, mode, mode1), serviceCallback); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1) { + return stopWithServiceResponseAsync(resourceGroupName, virtualMachineName, mode, mode1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + VirtualMachineStopMode m = null; + if (mode1 != null) { + m = new VirtualMachineStopMode(); + m.withMode(mode1); + } + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), mode, this.client.apiVersion(), this.client.acceptLanguage(), m, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), VirtualMachineStopHeaders.class); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String virtualMachineName) { + beginStopWithServiceResponseAsync(resourceGroupName, virtualMachineName).toBlocking().single().body(); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine 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 beginStopAsync(String resourceGroupName, String virtualMachineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginStopWithServiceResponseAsync(resourceGroupName, virtualMachineName), serviceCallback); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String virtualMachineName) { + return beginStopWithServiceResponseAsync(resourceGroupName, virtualMachineName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final StopMode mode = null; + final StopMode mode1 = null; + VirtualMachineStopMode m = new VirtualMachineStopMode(); + m.withMode(null); + return service.beginStop(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), mode, this.client.apiVersion(), this.client.acceptLanguage(), m, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1) { + beginStopWithServiceResponseAsync(resourceGroupName, virtualMachineName, mode, mode1).toBlocking().single().body(); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @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 beginStopAsync(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginStopWithServiceResponseAsync(resourceGroupName, virtualMachineName, mode, mode1), serviceCallback); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1) { + return beginStopWithServiceResponseAsync(resourceGroupName, virtualMachineName, mode, mode1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Implements shutdown, poweroff, and suspend method for a virtual machine. + * Power off virtual machine, options: shutdown, poweroff, and suspend. + * + * @param resourceGroupName The name of the resource group + * @param virtualMachineName virtual machine name + * @param mode query stop mode parameter (reboot, shutdown, etc...). Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @param mode1 mode indicates a type of stop operation - reboot, suspend, shutdown or power-off. Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String virtualMachineName, StopMode mode, StopMode mode1) { + 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 (virtualMachineName == null) { + throw new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null."); + } + if (this.client.referer() == null) { + throw new IllegalArgumentException("Parameter this.client.referer() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + VirtualMachineStopMode m = null; + if (mode1 != null) { + m = new VirtualMachineStopMode(); + m.withMode(mode1); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, virtualMachineName, this.client.referer(), mode, this.client.apiVersion(), this.client.acceptLanguage(), m, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginStopDelegate(Response response) throws CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .buildWithHeaders(response, VirtualMachineStopHeaders.class); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineInner> 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(); + } + }; + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within 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); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within 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<VirtualMachineInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within 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<VirtualMachineInner> 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)); + } + }); + } + + /** + * Implements list virtual machine within subscription method. + * Returns list virtual machine within 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<VirtualMachineInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualMachineInner> 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(); + } + }; + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within 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); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within 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<VirtualMachineInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within 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<VirtualMachineInner> 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)); + } + }); + } + + /** + * Implements list virtual machine within RG method. + * Returns list of virtual machine within 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<VirtualMachineInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkByPCsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkByPCsImpl.java new file mode 100644 index 0000000000000..fa30dda830a4e --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkByPCsImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNetworkByPCs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualNetworkModel; + +class VirtualNetworkByPCsImpl extends WrapperImpl implements VirtualNetworkByPCs { + private final VMwareCloudSimpleManager manager; + + VirtualNetworkByPCsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().virtualNetworkByPCs()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private PrivateCloudLocationVirtualNetworkModelImpl wrapModel(VirtualNetworkInner inner) { + return new PrivateCloudLocationVirtualNetworkModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String pcName, String virtualNetworkName) { + VirtualNetworkByPCsInner client = this.inner(); + return client.getAsync(pcName, virtualNetworkName) + .map(new Func1() { + @Override + public PrivateCloudLocationVirtualNetworkModel call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkByPCsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkByPCsInner.java new file mode 100644 index 0000000000000..dd392c5503798 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkByPCsInner.java @@ -0,0 +1,153 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 VirtualNetworkByPCs. + */ +public class VirtualNetworkByPCsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworkByPCsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of VirtualNetworkByPCsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworkByPCsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(VirtualNetworkByPCsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworkByPCs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworkByPCsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNetworkByPCs get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks/{virtualNetworkName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Path("pcName") String pcName, @Path("virtualNetworkName") String virtualNetworkName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements virtual network GET method. + * Return virtual network by its name. + * + * @param pcName The private cloud name + * @param virtualNetworkName virtual network id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VirtualNetworkInner object if successful. + */ + public VirtualNetworkInner get(String pcName, String virtualNetworkName) { + return getWithServiceResponseAsync(pcName, virtualNetworkName).toBlocking().single().body(); + } + + /** + * Implements virtual network GET method. + * Return virtual network by its name. + * + * @param pcName The private cloud name + * @param virtualNetworkName virtual network id (vsphereId) + * @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 pcName, String virtualNetworkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(pcName, virtualNetworkName), serviceCallback); + } + + /** + * Implements virtual network GET method. + * Return virtual network by its name. + * + * @param pcName The private cloud name + * @param virtualNetworkName virtual network id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable getAsync(String pcName, String virtualNetworkName) { + return getWithServiceResponseAsync(pcName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Implements virtual network GET method. + * Return virtual network by its name. + * + * @param pcName The private cloud name + * @param virtualNetworkName virtual network id (vsphereId) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getWithServiceResponseAsync(String pcName, String virtualNetworkName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() is required and cannot be null."); + } + if (pcName == null) { + throw new IllegalArgumentException("Parameter pcName is required and cannot be null."); + } + if (virtualNetworkName == null) { + throw new IllegalArgumentException("Parameter virtualNetworkName 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(), this.client.regionId(), pcName, virtualNetworkName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkInner.java new file mode 100644 index 0000000000000..ac8a673c484fe --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworkInner.java @@ -0,0 +1,131 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Virtual network model. + */ +@JsonFlatten +public class VirtualNetworkInner { + /** + * can be used in vm creation/deletion. + */ + @JsonProperty(value = "assignable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean assignable; + + /** + * virtual network id (privateCloudId:vsphereId). + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Azure region. + */ + @JsonProperty(value = "location") + private String location; + + /** + * {VirtualNetworkName}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The Private Cloud id. + */ + @JsonProperty(value = "properties.privateCloudId", access = JsonProperty.Access.WRITE_ONLY) + private String privateCloudId; + + /** + * {resourceProviderNamespace}/{resourceType}. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get can be used in vm creation/deletion. + * + * @return the assignable value + */ + public Boolean assignable() { + return this.assignable; + } + + /** + * Get virtual network id (privateCloudId:vsphereId). + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set virtual network id (privateCloudId:vsphereId). + * + * @param id the id value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get azure region. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure region. + * + * @param location the location value to set + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get {VirtualNetworkName}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the Private Cloud id. + * + * @return the privateCloudId value + */ + public String privateCloudId() { + return this.privateCloudId; + } + + /** + * Get {resourceProviderNamespace}/{resourceType}. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworksByPCsImpl.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworksByPCsImpl.java new file mode 100644 index 0000000000000..f11d6e2178f4b --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworksByPCsImpl.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.vmwarecloudsimple.v2019_04_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNetworksByPCs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.PrivateCloudLocationVirtualNetwork; + +class VirtualNetworksByPCsImpl extends WrapperImpl implements VirtualNetworksByPCs { + private final VMwareCloudSimpleManager manager; + + VirtualNetworksByPCsImpl(VMwareCloudSimpleManager manager) { + super(manager.inner().virtualNetworksByPCs()); + this.manager = manager; + } + + public VMwareCloudSimpleManager manager() { + return this.manager; + } + + private PrivateCloudLocationVirtualNetworkImpl wrapModel(VirtualNetworkInner inner) { + return new PrivateCloudLocationVirtualNetworkImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String pcName, final String resourcePoolName) { + VirtualNetworksByPCsInner client = this.inner(); + return client.listAsync(pcName, resourcePoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateCloudLocationVirtualNetwork call(VirtualNetworkInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworksByPCsInner.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworksByPCsInner.java new file mode 100644 index 0000000000000..8e068784b2de1 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/VirtualNetworksByPCsInner.java @@ -0,0 +1,316 @@ +/** + * 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.vmwarecloudsimple.v2019_04_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.CSRPErrorException; +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.Path; +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 VirtualNetworksByPCs. + */ +public class VirtualNetworksByPCsInner { + /** The Retrofit service to perform REST calls. */ + private VirtualNetworksByPCsService service; + /** The service client containing this operation class. */ + private VMwareCloudSimpleClientImpl client; + + /** + * Initializes an instance of VirtualNetworksByPCsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VirtualNetworksByPCsInner(Retrofit retrofit, VMwareCloudSimpleClientImpl client) { + this.service = retrofit.create(VirtualNetworksByPCsService.class); + this.client = client; + } + + /** + * The interface defining all the services for VirtualNetworksByPCs to be + * used by Retrofit to perform actually REST calls. + */ + interface VirtualNetworksByPCsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.VirtualNetworksByPCs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("regionId") String regionId, @Path("pcName") String pcName, @Query("api-version") String apiVersion, @Query("resourcePoolName") String resourcePoolName, @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.vmwarecloudsimple.v2019_04_01.VirtualNetworksByPCs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualNetworkInner> object if successful. + */ + public PagedList list(final String pcName, final String resourcePoolName) { + ServiceResponse> response = listSinglePageAsync(pcName, resourcePoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @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 pcName, final String resourcePoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(pcName, resourcePoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable> listAsync(final String pcName, final String resourcePoolName) { + return listWithServiceResponseAsync(pcName, resourcePoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for private cloud. + * + * @param pcName The private cloud name + * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listWithServiceResponseAsync(final String pcName, final String resourcePoolName) { + return listSinglePageAsync(pcName, resourcePoolName) + .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)); + } + }); + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for private cloud. + * + ServiceResponse> * @param pcName The private cloud name + ServiceResponse> * @param resourcePoolName Resource pool used to derive vSphere cluster which contains virtual networks + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String pcName, final String resourcePoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.regionId() == null) { + throw new IllegalArgumentException("Parameter this.client.regionId() is required and cannot be null."); + } + if (pcName == null) { + throw new IllegalArgumentException("Parameter pcName 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 (resourcePoolName == null) { + throw new IllegalArgumentException("Parameter resourcePoolName is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.regionId(), pcName, this.client.apiVersion(), resourcePoolName, 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for private cloud. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CSRPErrorException 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<VirtualNetworkInner> 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(); + } + }; + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for 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); + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for 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<VirtualNetworkInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for 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<VirtualNetworkInner> 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)); + } + }); + } + + /** + * Implements list available virtual networks within a subscription method. + * Return list of virtual networks in location for 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<VirtualNetworkInner> 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 CSRPErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CSRPErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CSRPErrorException.class) + .build(response); + } + +} diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/package-info.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/implementation/package-info.java new file mode 100644 index 0000000000000..79fdff9238118 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/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 VMwareCloudSimpleClient. + * Description of the new service. + */ +package com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01.implementation; diff --git a/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/package-info.java b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/package-info.java new file mode 100644 index 0000000000000..5e77944bf77d2 --- /dev/null +++ b/vmwarecloudsimple/resource-manager/v2019_04_01/src/main/java/com/microsoft/azure/management/vmwarecloudsimple/v2019_04_01/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 VMwareCloudSimpleClient. + * Description of the new service. + */ +package com.microsoft.azure.management.vmwarecloudsimple.v2019_04_01;