From 17b7887104d608c83efa456f0403d43c05724d71 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 22 Jan 2020 02:55:12 +0000 Subject: [PATCH] Generated from 87808a66e4afc0b39c2320b0e2d270f88660d336 fix examples --- sdk/hybridcompute/mgmt-v2019_12_12/pom.xml | 135 ++ .../v2019_12_12/AzureEntityResource.java | 34 + .../v2019_12_12/ErrorAdditionalInfo.java | 47 + .../v2019_12_12/ErrorDetail.java | 122 ++ .../v2019_12_12/ErrorResponse.java | 93 ++ .../v2019_12_12/ErrorResponseException.java | 44 + .../hybridcompute/v2019_12_12/Identity.java | 73 ++ .../v2019_12_12/InstanceViewTypes.java | 38 + .../v2019_12_12/LocationData.java | 121 ++ .../hybridcompute/v2019_12_12/Machine.java | 229 ++++ .../v2019_12_12/MachineExtension.java | 360 ++++++ .../MachineExtensionInstanceView.java | 122 ++ .../MachineExtensionInstanceViewStatus.java | 148 +++ ...achineExtensionPropertiesInstanceView.java | 16 + .../MachineExtensionPropertiesModel.java | 246 ++++ .../v2019_12_12/MachineExtensionUpdate.java | 207 ++++ ...MachineExtensionUpdatePropertiesModel.java | 205 +++ .../v2019_12_12/MachineExtensions.java | 53 + .../v2019_12_12/MachineIdentity.java | 16 + .../v2019_12_12/MachineProperties.java | 286 +++++ .../MachinePropertiesOsProfile.java | 16 + .../v2019_12_12/MachineReconnect.java | 72 ++ .../MachineReconnectProperties.java | 70 ++ .../v2019_12_12/MachineUpdate.java | 101 ++ .../v2019_12_12/MachineUpdateProperties.java | 43 + .../hybridcompute/v2019_12_12/Machines.java | 36 + .../hybridcompute/v2019_12_12/OSProfile.java | 32 + .../v2019_12_12/OperationValue.java | 50 + .../OperationValueDisplayModel.java | 77 ++ .../hybridcompute/v2019_12_12/Operations.java | 27 + .../hybridcompute/v2019_12_12/Plan.java | 151 +++ .../v2019_12_12/ResourceIdentityType.java | 50 + .../ResourceModelWithAllowedPropertySet.java | 177 +++ ...ceModelWithAllowedPropertySetIdentity.java | 16 + ...sourceModelWithAllowedPropertySetPlan.java | 16 + ...esourceModelWithAllowedPropertySetSku.java | 16 + .../hybridcompute/v2019_12_12/Sku.java | 153 +++ .../hybridcompute/v2019_12_12/SkuTier.java | 59 + .../v2019_12_12/StatusLevelTypes.java | 44 + .../v2019_12_12/StatusTypes.java | 44 + .../v2019_12_12/UpdateResource.java | 44 + .../HybridComputeManagementClientImpl.java | 224 ++++ .../implementation/HybridComputeManager.java | 123 ++ .../implementation/IdParsingUtils.java | 57 + .../implementation/MachineExtensionImpl.java | 267 ++++ .../implementation/MachineExtensionInner.java | 250 ++++ .../implementation/MachineExtensionsImpl.java | 85 ++ .../MachineExtensionsInner.java | 1094 +++++++++++++++++ .../implementation/MachineImpl.java | 190 +++ .../implementation/MachineInner.java | 321 +++++ .../implementation/MachinesImpl.java | 151 +++ .../implementation/MachinesInner.java | 1092 ++++++++++++++++ .../implementation/OperationValueImpl.java | 56 + .../implementation/OperationValueInner.java | 109 ++ .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 134 ++ .../v2019_12_12/implementation/PageImpl.java | 75 ++ .../v2019_12_12/implementation/PageImpl1.java | 75 ++ .../implementation/package-info.java | 11 + .../v2019_12_12/package-info.java | 11 + 60 files changed, 8263 insertions(+) create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/pom.xml create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/AzureEntityResource.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorAdditionalInfo.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorDetail.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponse.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponseException.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Identity.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/InstanceViewTypes.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/LocationData.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machine.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtension.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceView.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceViewStatus.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesInstanceView.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesModel.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdate.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdatePropertiesModel.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensions.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineIdentity.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineProperties.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachinePropertiesOsProfile.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnect.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnectProperties.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdate.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdateProperties.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machines.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OSProfile.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValue.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValueDisplayModel.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Operations.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Plan.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceIdentityType.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySet.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetIdentity.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetPlan.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetSku.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Sku.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/SkuTier.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusLevelTypes.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusTypes.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/UpdateResource.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManagementClientImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManager.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/IdParsingUtils.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionInner.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsInner.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineInner.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesInner.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueInner.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsInner.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl1.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/package-info.java create mode 100644 sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/package-info.java diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/pom.xml b/sdk/hybridcompute/mgmt-v2019_12_12/pom.xml new file mode 100644 index 000000000000..7b8df9f8a854 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.hybridcompute.v2019_12_12 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-hybridcompute + 1.0.0-beta + jar + Microsoft Azure SDK for HybridCompute Management + This package contains Microsoft HybridCompute Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/AzureEntityResource.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/AzureEntityResource.java new file mode 100644 index 000000000000..5feb29ec9b9f --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorAdditionalInfo.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..c5662a1187fd --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorAdditionalInfo.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorDetail.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorDetail.java new file mode 100644 index 000000000000..4883fe7d3e37 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorDetail.java @@ -0,0 +1,122 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + */ +public class ErrorDetail { + /** + * The error's code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A human readable error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Indicates which property in the request is responsible for the error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Additional error details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the error's code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error's code. + * + * @param code the code value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a human readable error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a human readable error message. + * + * @param message the message value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get indicates which property in the request is responsible for the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set indicates which property in the request is responsible for the error. + * + * @param target the target value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get additional error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set additional error details. + * + * @param details the details value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponse.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponse.java new file mode 100644 index 000000000000..d9b626a533e7 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponse.java @@ -0,0 +1,93 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error response. + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponseException.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponseException.java new file mode 100644 index 000000000000..234287d3b06b --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ErrorResponseException.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.hybridcompute.v2019_12_12; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Identity.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Identity.java new file mode 100644 index 000000000000..da9ccc93d4a3 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Identity.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/InstanceViewTypes.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/InstanceViewTypes.java new file mode 100644 index 000000000000..841d0596ca94 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/InstanceViewTypes.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InstanceViewTypes. + */ +public final class InstanceViewTypes extends ExpandableStringEnum { + /** Static value instanceView for InstanceViewTypes. */ + public static final InstanceViewTypes INSTANCE_VIEW = fromString("instanceView"); + + /** + * Creates or finds a InstanceViewTypes from its string representation. + * @param name a name to look for + * @return the corresponding InstanceViewTypes + */ + @JsonCreator + public static InstanceViewTypes fromString(String name) { + return fromString(name, InstanceViewTypes.class); + } + + /** + * @return known InstanceViewTypes values + */ + public static Collection values() { + return values(InstanceViewTypes.class); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/LocationData.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/LocationData.java new file mode 100644 index 000000000000..a09ea421fc3e --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/LocationData.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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata pertaining to the geographic location of the resource. + */ +public class LocationData { + /** + * A canonical name for the geographic or physical location. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The city or locality where the resource is located. + */ + @JsonProperty(value = "city") + private String city; + + /** + * The district, state, or province where the resource is located. + */ + @JsonProperty(value = "district") + private String district; + + /** + * The country or region where the resource is located. + */ + @JsonProperty(value = "countryOrRegion") + private String countryOrRegion; + + /** + * Get a canonical name for the geographic or physical location. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set a canonical name for the geographic or physical location. + * + * @param name the name value to set + * @return the LocationData object itself. + */ + public LocationData withName(String name) { + this.name = name; + return this; + } + + /** + * Get the city or locality where the resource is located. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the city or locality where the resource is located. + * + * @param city the city value to set + * @return the LocationData object itself. + */ + public LocationData withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the district, state, or province where the resource is located. + * + * @return the district value + */ + public String district() { + return this.district; + } + + /** + * Set the district, state, or province where the resource is located. + * + * @param district the district value to set + * @return the LocationData object itself. + */ + public LocationData withDistrict(String district) { + this.district = district; + return this; + } + + /** + * Get the country or region where the resource is located. + * + * @return the countryOrRegion value + */ + public String countryOrRegion() { + return this.countryOrRegion; + } + + /** + * Set the country or region where the resource is located. + * + * @param countryOrRegion the countryOrRegion value to set + * @return the LocationData object itself. + */ + public LocationData withCountryOrRegion(String countryOrRegion) { + this.countryOrRegion = countryOrRegion; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machine.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machine.java new file mode 100644 index 000000000000..d6cdd74951cf --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machine.java @@ -0,0 +1,229 @@ +/** + * 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.hybridcompute.v2019_12_12; + +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.hybridcompute.v2019_12_12.implementation.HybridComputeManager; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.MachineInner; + +/** + * Type representing Machine. + */ +public interface Machine extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * @return the clientPublicKey value. + */ + String clientPublicKey(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the errorDetails value. + */ + List errorDetails(); + + /** + * @return the extensions value. + */ + List extensions(); + + /** + * @return the identity value. + */ + MachineIdentity identity(); + + /** + * @return the lastStatusChange value. + */ + DateTime lastStatusChange(); + + /** + * @return the locationData value. + */ + LocationData locationData(); + + /** + * @return the machineFqdn value. + */ + String machineFqdn(); + + /** + * @return the osName value. + */ + String osName(); + + /** + * @return the osProfile value. + */ + MachinePropertiesOsProfile osProfile(); + + /** + * @return the osVersion value. + */ + String osVersion(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the status value. + */ + StatusTypes status(); + + /** + * @return the vmId value. + */ + String vmId(); + + /** + * The entirety of the Machine definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Machine definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Machine definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Machine definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the machine definition allowing to specify ClientPublicKey. + */ + interface WithClientPublicKey { + /** + * Specifies clientPublicKey. + * @param clientPublicKey Public Key that the client provides to be used during initial resource onboarding + * @return the next definition stage + */ + WithCreate withClientPublicKey(String clientPublicKey); + } + + /** + * The stage of the machine definition allowing to specify Extensions. + */ + interface WithExtensions { + /** + * Specifies extensions. + * @param extensions Machine Extensions information + * @return the next definition stage + */ + WithCreate withExtensions(List extensions); + } + + /** + * The stage of the machine definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity the identity parameter value + * @return the next definition stage + */ + WithCreate withIdentity(MachineIdentity identity); + } + + /** + * The stage of the machine definition allowing to specify LocationData. + */ + interface WithLocationData { + /** + * Specifies locationData. + * @param locationData the locationData parameter value + * @return the next definition stage + */ + WithCreate withLocationData(LocationData locationData); + } + + /** + * The stage of the machine definition allowing to specify OsProfile. + */ + interface WithOsProfile { + /** + * Specifies osProfile. + * @param osProfile Specifies the operating system settings for the hybrid machine + * @return the next definition stage + */ + WithCreate withOsProfile(MachinePropertiesOsProfile osProfile); + } + + /** + * The stage of the machine definition allowing to specify VmId. + */ + interface WithVmId { + /** + * Specifies vmId. + * @param vmId Specifies the hybrid machine unique ID + * @return the next definition stage + */ + WithCreate withVmId(String vmId); + } + + /** + * 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.WithClientPublicKey, DefinitionStages.WithExtensions, DefinitionStages.WithIdentity, DefinitionStages.WithLocationData, DefinitionStages.WithOsProfile, DefinitionStages.WithVmId { + } + } + /** + * The template for a Machine update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithLocationData { + } + + /** + * Grouping of Machine update stages. + */ + interface UpdateStages { + /** + * The stage of the machine update allowing to specify LocationData. + */ + interface WithLocationData { + /** + * Specifies locationData. + * @param locationData the locationData parameter value + * @return the next update stage + */ + Update withLocationData(LocationData locationData); + } + + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtension.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtension.java new file mode 100644 index 000000000000..b0fc0843ef7e --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtension.java @@ -0,0 +1,360 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.MachineExtensionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.HybridComputeManager; +import java.util.Map; + +/** + * Type representing MachineExtension. + */ +public interface MachineExtension extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the instanceView value. + */ + MachineExtensionPropertiesInstanceView instanceView(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the machineExtensionType value. + */ + String machineExtensionType(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the protectedSettings value. + */ + Object protectedSettings(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the publisher value. + */ + String publisher(); + + /** + * @return the settings value. + */ + Object settings(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * The entirety of the MachineExtension definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithMachine, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of MachineExtension definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MachineExtension definition. + */ + interface Blank extends WithMachine { + } + + /** + * The stage of the machineextension definition allowing to specify Machine. + */ + interface WithMachine { + /** + * Specifies resourceGroupName, name. + * @param resourceGroupName The name of the resource group + * @param name The name of the machine where the extension should be created or updated + * @return the next definition stage + */ + WithLocation withExistingMachine(String resourceGroupName, String name); + } + + /** + * The stage of the machineextension definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The geo-location where the resource lives + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the machineextension definition allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next definition stage + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the machineextension definition allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next definition stage + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the machineextension definition allowing to specify InstanceView. + */ + interface WithInstanceView { + /** + * Specifies instanceView. + * @param instanceView The machine extension instance view + * @return the next definition stage + */ + WithCreate withInstanceView(MachineExtensionPropertiesInstanceView instanceView); + } + + /** + * The stage of the machineextension definition allowing to specify MachineExtensionType. + */ + interface WithMachineExtensionType { + /** + * Specifies machineExtensionType. + * @param machineExtensionType Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next definition stage + */ + WithCreate withMachineExtensionType(String machineExtensionType); + } + + /** + * The stage of the machineextension definition allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next definition stage + */ + WithCreate withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the machineextension definition allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next definition stage + */ + WithCreate withPublisher(String publisher); + } + + /** + * The stage of the machineextension definition allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next definition stage + */ + WithCreate withSettings(Object settings); + } + + /** + * The stage of the machineextension definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the machineextension definition allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next definition stage + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithForceUpdateTag, DefinitionStages.WithInstanceView, DefinitionStages.WithMachineExtensionType, DefinitionStages.WithProtectedSettings, DefinitionStages.WithPublisher, DefinitionStages.WithSettings, DefinitionStages.WithTags, DefinitionStages.WithTypeHandlerVersion { + } + } + /** + * The template for a MachineExtension update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoUpgradeMinorVersion, UpdateStages.WithForceUpdateTag, UpdateStages.WithProtectedSettings, UpdateStages.WithPublisher, UpdateStages.WithSettings, UpdateStages.WithTags, UpdateStages.WithType, UpdateStages.WithTypeHandlerVersion { + } + + /** + * Grouping of MachineExtension update stages. + */ + interface UpdateStages { + /** + * The stage of the machineextension update allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true + * @return the next update stage + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the machineextension update allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension configuration has not changed + * @return the next update stage + */ + Update withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the machineextension update allowing to specify ProtectedSettings. + */ + interface WithProtectedSettings { + /** + * Specifies protectedSettings. + * @param protectedSettings The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all + * @return the next update stage + */ + Update withProtectedSettings(Object protectedSettings); + } + + /** + * The stage of the machineextension update allowing to specify Publisher. + */ + interface WithPublisher { + /** + * Specifies publisher. + * @param publisher The name of the extension handler publisher + * @return the next update stage + */ + Update withPublisher(String publisher); + } + + /** + * The stage of the machineextension update allowing to specify Settings. + */ + interface WithSettings { + /** + * Specifies settings. + * @param settings Json formatted public settings for the extension + * @return the next update stage + */ + Update withSettings(Object settings); + } + + /** + * The stage of the machineextension update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the machineextension update allowing to specify Type. + */ + interface WithType { + /** + * Specifies type. + * @param type Specifies the type of the extension; an example is "CustomScriptExtension" + * @return the next update stage + */ + Update withType(String type); + } + + /** + * The stage of the machineextension update allowing to specify TypeHandlerVersion. + */ + interface WithTypeHandlerVersion { + /** + * Specifies typeHandlerVersion. + * @param typeHandlerVersion Specifies the version of the script handler + * @return the next update stage + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceView.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceView.java new file mode 100644 index 000000000000..3460b1941ece --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceView.java @@ -0,0 +1,122 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the Machine Extension Instance View. + */ +public class MachineExtensionInstanceView { + /** + * The machine extension name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Instance view status. + */ + @JsonProperty(value = "status") + private MachineExtensionInstanceViewStatus status; + + /** + * Get the machine extension name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the machine extension name. + * + * @param name the name value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get instance view status. + * + * @return the status value + */ + public MachineExtensionInstanceViewStatus status() { + return this.status; + } + + /** + * Set instance view status. + * + * @param status the status value to set + * @return the MachineExtensionInstanceView object itself. + */ + public MachineExtensionInstanceView withStatus(MachineExtensionInstanceViewStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceViewStatus.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceViewStatus.java new file mode 100644 index 000000000000..84170e7f592d --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionInstanceViewStatus.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.hybridcompute.v2019_12_12; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Instance view status. + */ +public class MachineExtensionInstanceViewStatus { + /** + * The status code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The level code. Possible values include: 'Info', 'Warning', 'Error'. + */ + @JsonProperty(value = "level") + private StatusLevelTypes level; + + /** + * The short localizable label for the status. + */ + @JsonProperty(value = "displayStatus") + private String displayStatus; + + /** + * The detailed status message, including for alerts and error messages. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The time of the status. + */ + @JsonProperty(value = "time") + private DateTime time; + + /** + * Get the status code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the status code. + * + * @param code the code value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the level code. Possible values include: 'Info', 'Warning', 'Error'. + * + * @return the level value + */ + public StatusLevelTypes level() { + return this.level; + } + + /** + * Set the level code. Possible values include: 'Info', 'Warning', 'Error'. + * + * @param level the level value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withLevel(StatusLevelTypes level) { + this.level = level; + return this; + } + + /** + * Get the short localizable label for the status. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set the short localizable label for the status. + * + * @param displayStatus the displayStatus value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get the detailed status message, including for alerts and error messages. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the detailed status message, including for alerts and error messages. + * + * @param message the message value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the time of the status. + * + * @return the time value + */ + public DateTime time() { + return this.time; + } + + /** + * Set the time of the status. + * + * @param time the time value to set + * @return the MachineExtensionInstanceViewStatus object itself. + */ + public MachineExtensionInstanceViewStatus withTime(DateTime time) { + this.time = time; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesInstanceView.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesInstanceView.java new file mode 100644 index 000000000000..202d762e5ad5 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesInstanceView.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The machine extension instance view. + */ +public class MachineExtensionPropertiesInstanceView extends MachineExtensionInstanceView { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesModel.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesModel.java new file mode 100644 index 000000000000..f0df0fe697f8 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionPropertiesModel.java @@ -0,0 +1,246 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a Machine Extension. + */ +public class MachineExtensionPropertiesModel { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The machine extension instance view. + */ + @JsonProperty(value = "instanceView") + private MachineExtensionPropertiesInstanceView instanceView; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the machine extension instance view. + * + * @return the instanceView value + */ + public MachineExtensionPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the machine extension instance view. + * + * @param instanceView the instanceView value to set + * @return the MachineExtensionPropertiesModel object itself. + */ + public MachineExtensionPropertiesModel withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdate.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdate.java new file mode 100644 index 000000000000..c8a49b9c60a0 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdate.java @@ -0,0 +1,207 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a Machine Extension Update. + */ +@JsonFlatten +public class MachineExtensionUpdate extends UpdateResource { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdatePropertiesModel.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdatePropertiesModel.java new file mode 100644 index 000000000000..de2da370a7c3 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensionUpdatePropertiesModel.java @@ -0,0 +1,205 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a Machine Extension. + */ +public class MachineExtensionUpdatePropertiesModel { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "type") + private String type; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "protectedSettings") + private Object protectedSettings; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withType(String type) { + this.type = type; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionUpdatePropertiesModel object itself. + */ + public MachineExtensionUpdatePropertiesModel withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensions.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensions.java new file mode 100644 index 000000000000..75638745605a --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineExtensions.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.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.MachineExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing MachineExtensions. + */ +public interface MachineExtensions extends SupportsCreating, HasInner { + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String name, String extensionName); + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String name); + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name, String extensionName); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineIdentity.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineIdentity.java new file mode 100644 index 000000000000..df3a34c71338 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineIdentity.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The MachineIdentity model. + */ +public class MachineIdentity extends Identity { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineProperties.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineProperties.java new file mode 100644 index 000000000000..520febc028b6 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineProperties.java @@ -0,0 +1,286 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a hybrid machine. + */ +public class MachineProperties { + /** + * The locationData property. + */ + @JsonProperty(value = "locationData") + private LocationData locationData; + + /** + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "osProfile") + private MachinePropertiesOsProfile osProfile; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The status of the hybrid machine agent. Possible values include: + * 'Connected', 'Disconnected', 'Error'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private StatusTypes status; + + /** + * The time of the last status change. + */ + @JsonProperty(value = "lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastStatusChange; + + /** + * Details about the error state. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** + * The hybrid machine agent full version. + */ + @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentVersion; + + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /** + * Specifies the hybrid machine display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Specifies the hybrid machine FQDN. + */ + @JsonProperty(value = "machineFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String machineFqdn; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "clientPublicKey") + private String clientPublicKey; + + /** + * The Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /** + * The version of Operating System running on the hybrid machine. + */ + @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + + /** + * Machine Extensions information. + */ + @JsonProperty(value = "extensions") + private List extensions; + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + + /** + * Get specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value + */ + public MachinePropertiesOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withOsProfile(MachinePropertiesOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the hybrid machine agent. Possible values include: 'Connected', 'Disconnected', 'Error'. + * + * @return the status value + */ + public StatusTypes status() { + return this.status; + } + + /** + * Get the time of the last status change. + * + * @return the lastStatusChange value + */ + public DateTime lastStatusChange() { + return this.lastStatusChange; + } + + /** + * Get details about the error state. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the hybrid machine agent full version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get specifies the hybrid machine display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get specifies the hybrid machine FQDN. + * + * @return the machineFqdn value + */ + public String machineFqdn() { + return this.machineFqdn; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + + /** + * Get the Operating System running on the hybrid machine. + * + * @return the osName value + */ + public String osName() { + return this.osName; + } + + /** + * Get the version of Operating System running on the hybrid machine. + * + * @return the osVersion value + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Get machine Extensions information. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set machine Extensions information. + * + * @param extensions the extensions value to set + * @return the MachineProperties object itself. + */ + public MachineProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachinePropertiesOsProfile.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachinePropertiesOsProfile.java new file mode 100644 index 000000000000..92669e789ab0 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachinePropertiesOsProfile.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * Specifies the operating system settings for the hybrid machine. + */ +public class MachinePropertiesOsProfile extends OSProfile { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnect.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnect.java new file mode 100644 index 000000000000..a306652ba98e --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnect.java @@ -0,0 +1,72 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a hybrid machine reconnect. + */ +@JsonFlatten +public class MachineReconnect { + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "properties.vmId") + private String vmId; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "properties.clientPublicKey") + private String clientPublicKey; + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineReconnect object itself. + */ + public MachineReconnect withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineReconnect object itself. + */ + public MachineReconnect withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnectProperties.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnectProperties.java new file mode 100644 index 000000000000..c6e00b190d43 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineReconnectProperties.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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties required to reconnect a hybrid machine. + */ +public class MachineReconnectProperties { + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "vmId") + private String vmId; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "clientPublicKey") + private String clientPublicKey; + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineReconnectProperties object itself. + */ + public MachineReconnectProperties withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineReconnectProperties object itself. + */ + public MachineReconnectProperties withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdate.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdate.java new file mode 100644 index 000000000000..d332ae997fe5 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdate.java @@ -0,0 +1,101 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes a hybrid machine Update. + */ +@JsonFlatten +public class MachineUpdate extends UpdateResource { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "identity.principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "identity.tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "identity.type") + private ResourceIdentityType type; + + /** + * The locationData property. + */ + @JsonProperty(value = "properties.locationData") + private LocationData locationData; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the MachineUpdate object itself. + */ + public MachineUpdate withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineUpdate object itself. + */ + public MachineUpdate withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdateProperties.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdateProperties.java new file mode 100644 index 000000000000..f64d484ad33d --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/MachineUpdateProperties.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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the ARM updatable properties of a hybrid machine. + */ +public class MachineUpdateProperties { + /** + * The locationData property. + */ + @JsonProperty(value = "locationData") + private LocationData locationData; + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machines.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machines.java new file mode 100644 index 000000000000..c91e8ea1fe7e --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Machines.java @@ -0,0 +1,36 @@ +/** + * 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.hybridcompute.v2019_12_12; + +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.hybridcompute.v2019_12_12.implementation.MachinesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Machines. + */ +public interface Machines extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OSProfile.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OSProfile.java new file mode 100644 index 000000000000..5d206052040a --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OSProfile.java @@ -0,0 +1,32 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the operating system settings for the hybrid machine. + */ +public class OSProfile { + /** + * Specifies the host OS name of the hybrid machine. + */ + @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY) + private String computerName; + + /** + * Get specifies the host OS name of the hybrid machine. + * + * @return the computerName value + */ + public String computerName() { + return this.computerName; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValue.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValue.java new file mode 100644 index 000000000000..c51b6533aac5 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValue.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.hybridcompute.v2019_12_12; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.HybridComputeManager; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.OperationValueInner; + +/** + * Type representing OperationValue. + */ +public interface OperationValue extends HasInner, HasManager { + /** + * @return the description value. + */ + String description(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the provider value. + */ + String provider(); + + /** + * @return the resource value. + */ + String resource(); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValueDisplayModel.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValueDisplayModel.java new file mode 100644 index 000000000000..c5e3357a4df9 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/OperationValueDisplayModel.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a Hybrid Compute Operation Value Display. + */ +public class OperationValueDisplayModel { + /** + * The display name of the compute operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The resource provider for the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Get the display name of the compute operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the display name of the resource the operation applies to. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the resource provider for the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Operations.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Operations.java new file mode 100644 index 000000000000..8a011551e7fa --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Gets a list of hybrid compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Plan.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Plan.java new file mode 100644 index 000000000000..94166bfd55e8 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Plan.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Plan for the resource. + */ +public class Plan { + /** + * A user defined name of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The publisher of the 3rd Party Artifact that is being bought. E.g. + * NewRelic. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /** + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product + * maps to the OfferID specified for the artifact at the time of Data + * Market onboarding. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /** + * A publisher provided promotion code as provisioned in Data Market for + * the said product/artifact. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /** + * The version of the desired product/artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get a user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set a user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value + */ + public String product() { + return this.product; + } + + /** + * Set the 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get a publisher provided promotion code as provisioned in Data Market for the said product/artifact. + * + * @return the promotionCode value + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set a publisher provided promotion code as provisioned in Data Market for the said product/artifact. + * + * @param promotionCode the promotionCode value to set + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version of the desired product/artifact. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the desired product/artifact. + * + * @param version the version value to set + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceIdentityType.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceIdentityType.java new file mode 100644 index 000000000000..1cc632ddad61 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceIdentityType.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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySet.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySet.java new file mode 100644 index 000000000000..39518f24ed6f --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySet.java @@ -0,0 +1,177 @@ +/** + * 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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * The resource model definition containing the full set of allowed properties + * for a resource. Except properties bag, there cannot be a top level property + * outside of this set. + */ +public class ResourceModelWithAllowedPropertySet extends Resource { + /** + * The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another azure + * resource. If this is present, complete mode deployment will not delete + * the resource if it is removed from the template since it is managed by + * another resource. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + + /** + * Metadata used by portal/tooling/etc to render different UX experiences + * for resources of the same type; e.g. ApiApps are a kind of + * Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The etag field is *not* required. If it is provided in the response + * body, it must also be provided as a header per the normal etag + * convention. Entity tags are used for comparing two or more entities + * from the same requested resource. HTTP/1.1 uses entity tags in the etag + * (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private ResourceModelWithAllowedPropertySetIdentity identity; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private ResourceModelWithAllowedPropertySetSku sku; + + /** + * The plan property. + */ + @JsonProperty(value = "plan") + private ResourceModelWithAllowedPropertySetPlan plan; + + /** + * Get the fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + * + * @return the managedBy value + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + * + * @param managedBy the managedBy value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + + /** + * Get metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + * + * @param kind the kind value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public ResourceModelWithAllowedPropertySetIdentity identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public ResourceModelWithAllowedPropertySetSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withSku(ResourceModelWithAllowedPropertySetSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the plan value. + * + * @return the plan value + */ + public ResourceModelWithAllowedPropertySetPlan plan() { + return this.plan; + } + + /** + * Set the plan value. + * + * @param plan the plan value to set + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + public ResourceModelWithAllowedPropertySet withPlan(ResourceModelWithAllowedPropertySetPlan plan) { + this.plan = plan; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetIdentity.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetIdentity.java new file mode 100644 index 000000000000..5b30a6e5d26c --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetIdentity.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The ResourceModelWithAllowedPropertySetIdentity model. + */ +public class ResourceModelWithAllowedPropertySetIdentity extends Identity { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetPlan.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetPlan.java new file mode 100644 index 000000000000..e4936379b9bc --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetPlan.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The ResourceModelWithAllowedPropertySetPlan model. + */ +public class ResourceModelWithAllowedPropertySetPlan extends Plan { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetSku.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetSku.java new file mode 100644 index 000000000000..849de36614b0 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/ResourceModelWithAllowedPropertySetSku.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12; + + +/** + * The ResourceModelWithAllowedPropertySetSku model. + */ +public class ResourceModelWithAllowedPropertySetSku extends Sku { +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Sku.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Sku.java new file mode 100644 index 000000000000..fc927a4e3d86 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/Sku.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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource model definition representing SKU. + */ +public class Sku { + /** + * The name of the SKU. Ex - P3. It is typically a letter+number code. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * This field is required to be implemented by the Resource Provider if the + * service has more than one tier, but is not required on a PUT. Possible + * values include: 'Free', 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * The SKU size. When the name field is the combination of tier and some + * other value, this would be the standalone code. + */ + @JsonProperty(value = "size") + private String size; + + /** + * If the service has different generations of hardware, for the same SKU, + * then that can be captured here. + */ + @JsonProperty(value = "family") + private String family; + + /** + * If the SKU supports scale out/in then the capacity integer should be + * included. If scale out/in is not possible for the resource this may be + * omitted. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the SKU. Ex - P3. It is typically a letter+number code. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set this field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + * + * @return the size value + */ + public String size() { + return this.size; + } + + /** + * Set the SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + * + * @param size the size value to set + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + 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 if the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set if the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/SkuTier.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/SkuTier.java new file mode 100644 index 000000000000..24dc908c381e --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/SkuTier.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.hybridcompute.v2019_12_12; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuTier. + */ +public enum SkuTier { + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Basic. */ + BASIC("Basic"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusLevelTypes.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusLevelTypes.java new file mode 100644 index 000000000000..ea63eea1e8de --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusLevelTypes.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.hybridcompute.v2019_12_12; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StatusLevelTypes. + */ +public final class StatusLevelTypes extends ExpandableStringEnum { + /** Static value Info for StatusLevelTypes. */ + public static final StatusLevelTypes INFO = fromString("Info"); + + /** Static value Warning for StatusLevelTypes. */ + public static final StatusLevelTypes WARNING = fromString("Warning"); + + /** Static value Error for StatusLevelTypes. */ + public static final StatusLevelTypes ERROR = fromString("Error"); + + /** + * Creates or finds a StatusLevelTypes from its string representation. + * @param name a name to look for + * @return the corresponding StatusLevelTypes + */ + @JsonCreator + public static StatusLevelTypes fromString(String name) { + return fromString(name, StatusLevelTypes.class); + } + + /** + * @return known StatusLevelTypes values + */ + public static Collection values() { + return values(StatusLevelTypes.class); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusTypes.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusTypes.java new file mode 100644 index 000000000000..d9bad79b09e2 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/StatusTypes.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.hybridcompute.v2019_12_12; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StatusTypes. + */ +public final class StatusTypes extends ExpandableStringEnum { + /** Static value Connected for StatusTypes. */ + public static final StatusTypes CONNECTED = fromString("Connected"); + + /** Static value Disconnected for StatusTypes. */ + public static final StatusTypes DISCONNECTED = fromString("Disconnected"); + + /** Static value Error for StatusTypes. */ + public static final StatusTypes ERROR = fromString("Error"); + + /** + * Creates or finds a StatusTypes from its string representation. + * @param name a name to look for + * @return the corresponding StatusTypes + */ + @JsonCreator + public static StatusTypes fromString(String name) { + return fromString(name, StatusTypes.class); + } + + /** + * @return known StatusTypes values + */ + public static Collection values() { + return values(StatusTypes.class); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/UpdateResource.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/UpdateResource.java new file mode 100644 index 000000000000..a5ea4461fcf4 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/UpdateResource.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.hybridcompute.v2019_12_12; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Update Resource model definition. + */ +public class UpdateResource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the UpdateResource object itself. + */ + public UpdateResource withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManagementClientImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManagementClientImpl.java new file mode 100644 index 000000000000..ad088802f6c1 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the HybridComputeManagementClientImpl class. + */ +public class HybridComputeManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HybridComputeManagementClientImpl 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 HybridComputeManagementClientImpl 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 HybridComputeManagementClientImpl 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 HybridComputeManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The MachinesInner object to access its operations. + */ + private MachinesInner machines; + + /** + * Gets the MachinesInner object to access its operations. + * @return the MachinesInner object. + */ + public MachinesInner machines() { + return this.machines; + } + + /** + * The MachineExtensionsInner object to access its operations. + */ + private MachineExtensionsInner machineExtensions; + + /** + * Gets the MachineExtensionsInner object to access its operations. + * @return the MachineExtensionsInner object. + */ + public MachineExtensionsInner machineExtensions() { + return this.machineExtensions; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of HybridComputeManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HybridComputeManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HybridComputeManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HybridComputeManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HybridComputeManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HybridComputeManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-12-12"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.machines = new MachinesInner(restClient().retrofit(), this); + this.machineExtensions = new MachineExtensionsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "HybridComputeManagementClient", "2019-12-12"); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManager.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManager.java new file mode 100644 index 000000000000..79dd4a05fee5 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/HybridComputeManager.java @@ -0,0 +1,123 @@ +/** + * 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.hybridcompute.v2019_12_12.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.hybridcompute.v2019_12_12.Machines; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HybridCompute resource management. + */ +public final class HybridComputeManager extends ManagerCore { + private Machines machines; + private MachineExtensions machineExtensions; + private Operations operations; + /** + * Get a Configurable instance that can be used to create HybridComputeManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HybridComputeManager.ConfigurableImpl(); + } + /** + * Creates an instance of HybridComputeManager that exposes HybridCompute resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HybridComputeManager + */ + public static HybridComputeManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HybridComputeManager(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 HybridComputeManager that exposes HybridCompute resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HybridComputeManager + */ + public static HybridComputeManager authenticate(RestClient restClient, String subscriptionId) { + return new HybridComputeManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HybridComputeManager that exposes HybridCompute management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HybridCompute management API entry points that work across subscriptions + */ + HybridComputeManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Machines. + */ + public Machines machines() { + if (this.machines == null) { + this.machines = new MachinesImpl(this); + } + return this.machines; + } + + /** + * @return Entry point to manage MachineExtensions. + */ + public MachineExtensions machineExtensions() { + if (this.machineExtensions == null) { + this.machineExtensions = new MachineExtensionsImpl(this); + } + return this.machineExtensions; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HybridComputeManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HybridComputeManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HybridComputeManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HybridComputeManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/IdParsingUtils.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..07c115c43e54 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/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.hybridcompute.v2019_12_12.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionImpl.java new file mode 100644 index 000000000000..3311c1d22be9 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionImpl.java @@ -0,0 +1,267 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtension; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionUpdate; +import java.util.Map; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionPropertiesInstanceView; +import rx.functions.Func1; + +class MachineExtensionImpl extends CreatableUpdatableImpl implements MachineExtension, MachineExtension.Definition, MachineExtension.Update { + private final HybridComputeManager manager; + private String resourceGroupName; + private String name; + private String extensionName; + private MachineExtensionUpdate updateParameter; + + MachineExtensionImpl(String name, HybridComputeManager manager) { + super(name, new MachineExtensionInner()); + this.manager = manager; + // Set resource name + this.extensionName = name; + // + this.updateParameter = new MachineExtensionUpdate(); + } + + MachineExtensionImpl(MachineExtensionInner inner, HybridComputeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.extensionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "machines"); + this.extensionName = IdParsingUtils.getValueFromIdByName(inner.id(), "extensions"); + // + this.updateParameter = new MachineExtensionUpdate(); + } + + @Override + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + MachineExtensionsInner client = this.manager().inner().machineExtensions(); + return client.createOrUpdateAsync(this.resourceGroupName, this.name, this.extensionName, this.inner()) + .map(new Func1() { + @Override + public MachineExtensionInner call(MachineExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MachineExtensionsInner client = this.manager().inner().machineExtensions(); + return client.updateAsync(this.resourceGroupName, this.name, this.extensionName, this.updateParameter) + .map(new Func1() { + @Override + public MachineExtensionInner call(MachineExtensionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MachineExtensionsInner client = this.manager().inner().machineExtensions(); + return client.getAsync(this.resourceGroupName, this.name, this.extensionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new MachineExtensionUpdate(); + } + + @Override + public Boolean autoUpgradeMinorVersion() { + return this.inner().autoUpgradeMinorVersion(); + } + + @Override + public String forceUpdateTag() { + return this.inner().forceUpdateTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public MachineExtensionPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String machineExtensionType() { + return this.inner().machineExtensionType(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object protectedSettings() { + return this.inner().protectedSettings(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String publisher() { + return this.inner().publisher(); + } + + @Override + public Object settings() { + return this.inner().settings(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String typeHandlerVersion() { + return this.inner().typeHandlerVersion(); + } + + @Override + public MachineExtensionImpl withExistingMachine(String resourceGroupName, String name) { + this.resourceGroupName = resourceGroupName; + this.name = name; + return this; + } + + @Override + public MachineExtensionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public MachineExtensionImpl withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { + this.inner().withInstanceView(instanceView); + return this; + } + + @Override + public MachineExtensionImpl withMachineExtensionType(String machineExtensionType) { + this.inner().withMachineExtensionType(machineExtensionType); + return this; + } + + @Override + public MachineExtensionImpl withType(String type) { + this.updateParameter.withType(type); + return this; + } + + @Override + public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.inner().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } else { + this.updateParameter.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } + return this; + } + + @Override + public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.inner().withForceUpdateTag(forceUpdateTag); + } else { + this.updateParameter.withForceUpdateTag(forceUpdateTag); + } + return this; + } + + @Override + public MachineExtensionImpl withProtectedSettings(Object protectedSettings) { + if (isInCreateMode()) { + this.inner().withProtectedSettings(protectedSettings); + } else { + this.updateParameter.withProtectedSettings(protectedSettings); + } + return this; + } + + @Override + public MachineExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.inner().withPublisher(publisher); + } else { + this.updateParameter.withPublisher(publisher); + } + return this; + } + + @Override + public MachineExtensionImpl withSettings(Object settings) { + if (isInCreateMode()) { + this.inner().withSettings(settings); + } else { + this.updateParameter.withSettings(settings); + } + return this; + } + + @Override + public MachineExtensionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.inner().withTypeHandlerVersion(typeHandlerVersion); + } else { + this.updateParameter.withTypeHandlerVersion(typeHandlerVersion); + } + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionInner.java new file mode 100644 index 000000000000..4744319e168d --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionInner.java @@ -0,0 +1,250 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionPropertiesInstanceView; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Describes a Machine Extension. + */ +@JsonFlatten +public class MachineExtensionInner extends Resource { + /** + * How the extension handler should be forced to update even if the + * extension configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher") + private String publisher; + + /** + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type") + private String machineExtensionType; + + /** + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion") + private String typeHandlerVersion; + + /** + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /** + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The machine extension instance view. + */ + @JsonProperty(value = "properties.instanceView") + private MachineExtensionPropertiesInstanceView instanceView; + + /** + * Get how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the extension handler should be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the name of the extension handler publisher. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the name of the extension handler publisher. + * + * @param publisher the publisher value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the machineExtensionType value + */ + public String machineExtensionType() { + return this.machineExtensionType; + } + + /** + * Set specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param machineExtensionType the machineExtensionType value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withMachineExtensionType(String machineExtensionType) { + this.machineExtensionType = machineExtensionType; + return this; + } + + /** + * Get specifies the version of the script handler. + * + * @return the typeHandlerVersion value + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get json formatted public settings for the extension. + * + * @return the settings value + */ + public Object settings() { + return this.settings; + } + + /** + * Set json formatted public settings for the extension. + * + * @param settings the settings value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the machine extension instance view. + * + * @return the instanceView value + */ + public MachineExtensionPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Set the machine extension instance view. + * + * @param instanceView the instanceView value to set + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withInstanceView(MachineExtensionPropertiesInstanceView instanceView) { + this.instanceView = instanceView; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsImpl.java new file mode 100644 index 000000000000..c6850c20f334 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsImpl.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.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtension; + +class MachineExtensionsImpl extends WrapperImpl implements MachineExtensions { + private final HybridComputeManager manager; + + MachineExtensionsImpl(HybridComputeManager manager) { + super(manager.inner().machineExtensions()); + this.manager = manager; + } + + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public MachineExtensionImpl define(String name) { + return wrapModel(name); + } + + private MachineExtensionImpl wrapModel(MachineExtensionInner inner) { + return new MachineExtensionImpl(inner, manager()); + } + + private MachineExtensionImpl wrapModel(String name) { + return new MachineExtensionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String name) { + MachineExtensionsInner client = this.inner(); + return client.listAsync(resourceGroupName, name) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public MachineExtension call(MachineExtensionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String name, String extensionName) { + MachineExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, name, extensionName) + .flatMap(new Func1>() { + @Override + public Observable call(MachineExtensionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((MachineExtension)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name, String extensionName) { + MachineExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name, extensionName).toCompletable(); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsInner.java new file mode 100644 index 000000000000..7e670515bf17 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineExtensionsInner.java @@ -0,0 +1,1094 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MachineExtensions. + */ +public class MachineExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private MachineExtensionsService service; + /** The service client containing this operation class. */ + private HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of MachineExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MachineExtensionsInner(Retrofit retrofit, HybridComputeManagementClientImpl client) { + this.service = retrofit.create(MachineExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MachineExtensions to be + * used by Retrofit to perform actually REST calls. + */ + interface MachineExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionInner extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionInner extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionUpdate extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Body MachineExtensionUpdate extensionParameters, @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.hybridcompute.v2019_12_12.MachineExtensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("extensionName") String extensionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensions list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @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.hybridcompute.v2019_12_12.MachineExtensions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner createOrUpdate(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().last().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @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 name, String extensionName, MachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters 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(extensionParameters); + Observable> observable = service.createOrUpdate(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner beginCreateOrUpdate(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().single().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @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 name, String extensionName, MachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionInner extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters 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(extensionParameters); + return service.beginCreateOrUpdate(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner update(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().last().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @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 name, String extensionName, MachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters 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(extensionParameters); + Observable> observable = service.update(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner beginUpdate(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).toBlocking().single().body(); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @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 name, String extensionName, MachineExtensionUpdate extensionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, name, extensionName, extensionParameters).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be created or updated. + * @param extensionName The name of the machine extension. + * @param extensionParameters Parameters supplied to the Create Machine Extension operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String name, String extensionName, MachineExtensionUpdate extensionParameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (extensionParameters == null) { + throw new IllegalArgumentException("Parameter extensionParameters 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(extensionParameters); + return service.beginUpdate(resourceGroupName, name, extensionName, this.client.subscriptionId(), extensionParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String name, String extensionName) { + deleteWithServiceResponseAsync(resourceGroupName, name, extensionName).toBlocking().last().body(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @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 name, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name, extensionName), serviceCallback); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String name, String extensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, name, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name, String extensionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, name, extensionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String name, String extensionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, name, extensionName).toBlocking().single().body(); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @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 name, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, name, extensionName), serviceCallback); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String name, String extensionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, name, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine where the extension should be deleted. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String name, String extensionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, name, extensionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineExtensionInner object if successful. + */ + public MachineExtensionInner get(String resourceGroupName, String name, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, name, extensionName).toBlocking().single().body(); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String name, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, name, extensionName), serviceCallback); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String name, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, name, extensionName).map(new Func1, MachineExtensionInner>() { + @Override + public MachineExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param extensionName The name of the machine extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineExtensionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String name, String extensionName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + 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.get(resourceGroupName, name, extensionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MachineExtensionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String name) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, name).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String name, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, name), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String name) { + return listWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String name) { + return listSinglePageAsync(resourceGroupName, name) + .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)); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineExtensionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + 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 expand = null; + return service.list(resourceGroupName, name, this.client.subscriptionId(), expand, 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); + } + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MachineExtensionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String name, final String expand) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, name, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String name, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, name, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String name, final String expand) { + return listWithServiceResponseAsync(resourceGroupName, name, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the machine containing the extension. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineExtensionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String name, final String expand) { + return listSinglePageAsync(resourceGroupName, name, expand) + .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)); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param name The name of the machine containing the extension. + ServiceResponse> * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineExtensionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String name, final String expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + 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(resourceGroupName, name, this.client.subscriptionId(), expand, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<MachineExtensionInner> 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(); + } + }; + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @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); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @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<MachineExtensionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + * @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<MachineExtensionInner> 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)); + } + }); + } + + /** + * The operation to get all extensions of a non-Azure machine. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineExtensionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineImpl.java new file mode 100644 index 000000000000..215b933dc483 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineImpl.java @@ -0,0 +1,190 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Machine; +import rx.Observable; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineUpdate; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.LocationData; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachinePropertiesOsProfile; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.StatusTypes; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.ErrorDetail; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionInstanceView; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineIdentity; +import rx.functions.Func1; + +class MachineImpl extends GroupableResourceCoreImpl implements Machine, Machine.Definition, Machine.Update { + private MachineUpdate updateParameter; + MachineImpl(String name, MachineInner inner, HybridComputeManager manager) { + super(name, inner, manager); + this.updateParameter = new MachineUpdate(); + } + + @Override + public Observable createResourceAsync() { + MachinesInner client = this.manager().inner().machines(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public MachineInner call(MachineInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + MachinesInner client = this.manager().inner().machines(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public MachineInner call(MachineInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + MachinesInner client = this.manager().inner().machines(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new MachineUpdate(); + } + + @Override + public String agentVersion() { + return this.inner().agentVersion(); + } + + @Override + public String clientPublicKey() { + return this.inner().clientPublicKey(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public List errorDetails() { + return this.inner().errorDetails(); + } + + @Override + public List extensions() { + return this.inner().extensions(); + } + + @Override + public MachineIdentity identity() { + return this.inner().identity(); + } + + @Override + public DateTime lastStatusChange() { + return this.inner().lastStatusChange(); + } + + @Override + public LocationData locationData() { + return this.inner().locationData(); + } + + @Override + public String machineFqdn() { + return this.inner().machineFqdn(); + } + + @Override + public String osName() { + return this.inner().osName(); + } + + @Override + public MachinePropertiesOsProfile osProfile() { + return this.inner().osProfile(); + } + + @Override + public String osVersion() { + return this.inner().osVersion(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public StatusTypes status() { + return this.inner().status(); + } + + @Override + public String vmId() { + return this.inner().vmId(); + } + + @Override + public MachineImpl withClientPublicKey(String clientPublicKey) { + this.inner().withClientPublicKey(clientPublicKey); + return this; + } + + @Override + public MachineImpl withExtensions(List extensions) { + this.inner().withExtensions(extensions); + return this; + } + + @Override + public MachineImpl withIdentity(MachineIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public MachineImpl withOsProfile(MachinePropertiesOsProfile osProfile) { + this.inner().withOsProfile(osProfile); + return this; + } + + @Override + public MachineImpl withVmId(String vmId) { + this.inner().withVmId(vmId); + return this; + } + + @Override + public MachineImpl withLocationData(LocationData locationData) { + if (isInCreateMode()) { + this.inner().withLocationData(locationData); + } else { + this.updateParameter.withLocationData(locationData); + } + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineInner.java new file mode 100644 index 000000000000..87eb4c6ca3a9 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachineInner.java @@ -0,0 +1,321 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.LocationData; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachinePropertiesOsProfile; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.StatusTypes; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.ErrorDetail; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineExtensionInstanceView; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Describes a hybrid machine. + */ +@JsonFlatten +public class MachineInner extends Resource { + /** + * The locationData property. + */ + @JsonProperty(value = "properties.locationData") + private LocationData locationData; + + /** + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "properties.osProfile") + private MachinePropertiesOsProfile osProfile; + + /** + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The status of the hybrid machine agent. Possible values include: + * 'Connected', 'Disconnected', 'Error'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private StatusTypes status; + + /** + * The time of the last status change. + */ + @JsonProperty(value = "properties.lastStatusChange", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastStatusChange; + + /** + * Details about the error state. + */ + @JsonProperty(value = "properties.errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** + * The hybrid machine agent full version. + */ + @JsonProperty(value = "properties.agentVersion", access = JsonProperty.Access.WRITE_ONLY) + private String agentVersion; + + /** + * Specifies the hybrid machine unique ID. + */ + @JsonProperty(value = "properties.vmId") + private String vmId; + + /** + * Specifies the hybrid machine display name. + */ + @JsonProperty(value = "properties.displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Specifies the hybrid machine FQDN. + */ + @JsonProperty(value = "properties.machineFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String machineFqdn; + + /** + * Public Key that the client provides to be used during initial resource + * onboarding. + */ + @JsonProperty(value = "properties.clientPublicKey") + private String clientPublicKey; + + /** + * The Operating System running on the hybrid machine. + */ + @JsonProperty(value = "properties.osName", access = JsonProperty.Access.WRITE_ONLY) + private String osName; + + /** + * The version of Operating System running on the hybrid machine. + */ + @JsonProperty(value = "properties.osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + + /** + * Machine Extensions information. + */ + @JsonProperty(value = "properties.extensions") + private List extensions; + + /** + * The identity property. + */ + @JsonProperty(value = "identity") + private MachineIdentity identity; + + /** + * Get the locationData value. + * + * @return the locationData value + */ + public LocationData locationData() { + return this.locationData; + } + + /** + * Set the locationData value. + * + * @param locationData the locationData value to set + * @return the MachineInner object itself. + */ + public MachineInner withLocationData(LocationData locationData) { + this.locationData = locationData; + return this; + } + + /** + * Get specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value + */ + public MachinePropertiesOsProfile osProfile() { + return this.osProfile; + } + + /** + * Set specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set + * @return the MachineInner object itself. + */ + public MachineInner withOsProfile(MachinePropertiesOsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the hybrid machine agent. Possible values include: 'Connected', 'Disconnected', 'Error'. + * + * @return the status value + */ + public StatusTypes status() { + return this.status; + } + + /** + * Get the time of the last status change. + * + * @return the lastStatusChange value + */ + public DateTime lastStatusChange() { + return this.lastStatusChange; + } + + /** + * Get details about the error state. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the hybrid machine agent full version. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Get specifies the hybrid machine unique ID. + * + * @return the vmId value + */ + public String vmId() { + return this.vmId; + } + + /** + * Set specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set + * @return the MachineInner object itself. + */ + public MachineInner withVmId(String vmId) { + this.vmId = vmId; + return this; + } + + /** + * Get specifies the hybrid machine display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get specifies the hybrid machine FQDN. + * + * @return the machineFqdn value + */ + public String machineFqdn() { + return this.machineFqdn; + } + + /** + * Get public Key that the client provides to be used during initial resource onboarding. + * + * @return the clientPublicKey value + */ + public String clientPublicKey() { + return this.clientPublicKey; + } + + /** + * Set public Key that the client provides to be used during initial resource onboarding. + * + * @param clientPublicKey the clientPublicKey value to set + * @return the MachineInner object itself. + */ + public MachineInner withClientPublicKey(String clientPublicKey) { + this.clientPublicKey = clientPublicKey; + return this; + } + + /** + * Get the Operating System running on the hybrid machine. + * + * @return the osName value + */ + public String osName() { + return this.osName; + } + + /** + * Get the version of Operating System running on the hybrid machine. + * + * @return the osVersion value + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Get machine Extensions information. + * + * @return the extensions value + */ + public List extensions() { + return this.extensions; + } + + /** + * Set machine Extensions information. + * + * @param extensions the extensions value to set + * @return the MachineInner object itself. + */ + public MachineInner withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the identity value. + * + * @return the identity value + */ + public MachineIdentity identity() { + return this.identity; + } + + /** + * Set the identity value. + * + * @param identity the identity value to set + * @return the MachineInner object itself. + */ + public MachineInner withIdentity(MachineIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesImpl.java new file mode 100644 index 000000000000..55886f8f42a3 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Machine; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineReconnect; + +class MachinesImpl extends GroupableResourcesCoreImpl implements Machines { + protected MachinesImpl(HybridComputeManager manager) { + super(manager.inner().machines(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + MachinesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + MachinesInner 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) { + MachinesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + MachinesInner 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 Machine call(MachineInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + MachinesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + MachinesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Machine call(MachineInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public MachineImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters) { + MachinesInner client = this.inner(); + return client.reconnectAsync(resourceGroupName, name, parameters) + .map(new Func1() { + @Override + public Machine call(MachineInner inner) { + return new MachineImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + protected MachineImpl wrapModel(MachineInner inner) { + return new MachineImpl(inner.name(), inner, manager()); + } + + @Override + protected MachineImpl wrapModel(String name) { + return new MachineImpl(name, new MachineInner(), this.manager()); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesInner.java new file mode 100644 index 000000000000..50c20c34d948 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/MachinesInner.java @@ -0,0 +1,1092 @@ +/** + * 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.hybridcompute.v2019_12_12.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.hybridcompute.v2019_12_12.ErrorResponseException; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.InstanceViewTypes; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineReconnect; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.MachineUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Machines. + */ +public class MachinesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private MachinesService service; + /** The service client containing this operation class. */ + private HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of MachinesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MachinesInner(Retrofit retrofit, HybridComputeManagementClientImpl client) { + this.service = retrofit.create(MachinesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Machines to be + * used by Retrofit to perform actually REST calls. + */ + interface MachinesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body MachineInner parameters, @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.hybridcompute.v2019_12_12.Machines update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body MachineUpdate parameters, @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.hybridcompute.v2019_12_12.Machines delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @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.hybridcompute.v2019_12_12.Machines getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Query("$expand") InstanceViewTypes expand, @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.hybridcompute.v2019_12_12.Machines reconnect" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/reconnect") + Observable> reconnect(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Query("api-version") String apiVersion, @Body MachineReconnect parameters, @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.hybridcompute.v2019_12_12.Machines listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Machines listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineInner object if successful. + */ + public MachineInner createOrUpdate(String resourceGroupName, String name, MachineInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @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 name, MachineInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String name, MachineInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to create or update a hybrid machine resource identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Create hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, MachineInner parameters) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), parameters, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineInner object if successful. + */ + public MachineInner update(String resourceGroupName, String name, MachineUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @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 name, MachineUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable updateAsync(String resourceGroupName, String name, MachineUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to update a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Update hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, MachineUpdate parameters) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), parameters, this.client.acceptLanguage(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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 name) { + deleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String name) { + return deleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to remove a hybrid machine identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineInner object if successful. + */ + public MachineInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @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 name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String name) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 InstanceViewTypes expand = null; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), expand, 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); + } + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineInner object if successful. + */ + public MachineInner getByResourceGroup(String resourceGroupName, String name, InstanceViewTypes expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name, expand).toBlocking().single().body(); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @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 name, InstanceViewTypes expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, name, expand), serviceCallback); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String name, InstanceViewTypes expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, name, expand).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves information about the model view or the instance view of a hybrid machine. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String name, InstanceViewTypes expand) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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, name, this.client.apiVersion(), expand, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MachineInner object if successful. + */ + public MachineInner reconnect(String resourceGroupName, String name, MachineReconnect parameters) { + return reconnectWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().body(); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @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 reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(reconnectWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable reconnectAsync(String resourceGroupName, String name, MachineReconnect parameters) { + return reconnectWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, MachineInner>() { + @Override + public MachineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The operation to reconnect a hybrid machine resource to its identity in Azure. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the hybrid machine. + * @param parameters Parameters supplied to the Reconnect hybrid machine operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MachineInner object + */ + public Observable> reconnectWithServiceResponseAsync(String resourceGroupName, String name, MachineReconnect parameters) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.reconnect(this.client.subscriptionId(), resourceGroupName, name, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = reconnectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse reconnectDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<MachineInner> 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(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> 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)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<MachineInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<MachineInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<MachineInner> 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(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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<MachineInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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<MachineInner> 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)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<MachineInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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<MachineInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + * @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<MachineInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<MachineInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueImpl.java new file mode 100644 index 000000000000..c226442d6b41 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueImpl.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.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.management.hybridcompute.v2019_12_12.OperationValue; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class OperationValueImpl extends WrapperImpl implements OperationValue { + private final HybridComputeManager manager; + OperationValueImpl(OperationValueInner inner, HybridComputeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public String provider() { + return this.inner().provider(); + } + + @Override + public String resource() { + return this.inner().resource(); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueInner.java new file mode 100644 index 000000000000..232cf5adbfda --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationValueInner.java @@ -0,0 +1,109 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Describes the properties of a Compute Operation value. + */ +@JsonFlatten +public class OperationValueInner { + /** + * The origin of the compute operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * The name of the compute operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The display name of the compute operation. + */ + @JsonProperty(value = "display.operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "display.resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The description of the operation. + */ + @JsonProperty(value = "display.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The resource provider for the operation. + */ + @JsonProperty(value = "display.provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Get the origin of the compute operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Get the name of the compute operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display name of the compute operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the display name of the resource the operation applies to. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the resource provider for the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsImpl.java new file mode 100644 index 000000000000..bbbc10d4ef46 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.OperationValue; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HybridComputeManager manager; + + OperationsImpl(HybridComputeManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HybridComputeManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public OperationValue call(OperationValueInner inner) { + return new OperationValueImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsInner.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsInner.java new file mode 100644 index 000000000000..7a97e47d13c8 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * 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.hybridcompute.v2019_12_12.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hybridcompute.v2019_12_12.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, HybridComputeManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hybridcompute.v2019_12_12.Operations list" }) + @GET("providers/Microsoft.HybridCompute/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of hybrid compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<OperationValueInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets a list of hybrid compute 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 ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets a list of hybrid compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationValueInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of hybrid compute operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationValueInner> object + */ + public Observable>> listWithServiceResponseAsync() { + 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); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl.java new file mode 100644 index 000000000000..391d95e38dd1 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/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.hybridcompute.v2019_12_12.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl1.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl1.java new file mode 100644 index 000000000000..dda24f62e125 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/PageImpl1.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.hybridcompute.v2019_12_12.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 PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + 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 PageImpl1 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 PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/package-info.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/implementation/package-info.java new file mode 100644 index 000000000000..82fb087df13c --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/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 HybridComputeManagementClient. + * The Hybrid Compute Management Client. + */ +package com.microsoft.azure.management.hybridcompute.v2019_12_12.implementation; diff --git a/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/package-info.java b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/package-info.java new file mode 100644 index 000000000000..3dffef448707 --- /dev/null +++ b/sdk/hybridcompute/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/hybridcompute/v2019_12_12/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 HybridComputeManagementClient. + * The Hybrid Compute Management Client. + */ +package com.microsoft.azure.management.hybridcompute.v2019_12_12;