diff --git a/sdk/azurestack/mgmt-v2017_06_01/pom.xml b/sdk/azurestack/mgmt-v2017_06_01/pom.xml index ce92f7b2a5ca..261684d344e2 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/pom.xml +++ b/sdk/azurestack/mgmt-v2017_06_01/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-azurestack @@ -71,6 +71,8 @@ azure-arm-client-runtime test-jar test + + 1.6.5 diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Category.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Category.java new file mode 100644 index 000000000000..ed85d114c70b --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Category.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Category. + */ +public final class Category extends ExpandableStringEnum { + /** Static value AzureAD for Category. */ + public static final Category AZURE_AD = fromString("AzureAD"); + + /** Static value ADFS for Category. */ + public static final Category ADFS = fromString("ADFS"); + + /** + * Creates or finds a Category from its string representation. + * @param name a name to look for + * @return the corresponding Category + */ + @JsonCreator + public static Category fromString(String name) { + return fromString(name, Category.class); + } + + /** + * @return known Category values + */ + public static Collection values() { + return values(Category.class); + } +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileDeploymentData.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileDeploymentData.java new file mode 100644 index 000000000000..9fb923c493eb --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileDeploymentData.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.azurestack.v2017_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Cloud specific manifest data for AzureStack deployment. + */ +@JsonFlatten +public class CloudManifestFileDeploymentData { + /** + * Dsms external certificates. + */ + @JsonProperty(value = "externalDsmsCertificates") + private String externalDsmsCertificates; + + /** + * Signing verification public key. + */ + @JsonProperty(value = "customCloudVerificationKey") + private String customCloudVerificationKey; + + /** + * ARM endpoint. + */ + @JsonProperty(value = "customEnvironmentEndpoints.customCloudArmEndpoint") + private String customCloudArmEndpoint; + + /** + * Dsms endpoint. + */ + @JsonProperty(value = "customEnvironmentEndpoints.externalDsmsEndpoint") + private String externalDsmsEndpoint; + + /** + * Get dsms external certificates. + * + * @return the externalDsmsCertificates value + */ + public String externalDsmsCertificates() { + return this.externalDsmsCertificates; + } + + /** + * Set dsms external certificates. + * + * @param externalDsmsCertificates the externalDsmsCertificates value to set + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withExternalDsmsCertificates(String externalDsmsCertificates) { + this.externalDsmsCertificates = externalDsmsCertificates; + return this; + } + + /** + * Get signing verification public key. + * + * @return the customCloudVerificationKey value + */ + public String customCloudVerificationKey() { + return this.customCloudVerificationKey; + } + + /** + * Set signing verification public key. + * + * @param customCloudVerificationKey the customCloudVerificationKey value to set + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withCustomCloudVerificationKey(String customCloudVerificationKey) { + this.customCloudVerificationKey = customCloudVerificationKey; + return this; + } + + /** + * Get aRM endpoint. + * + * @return the customCloudArmEndpoint value + */ + public String customCloudArmEndpoint() { + return this.customCloudArmEndpoint; + } + + /** + * Set aRM endpoint. + * + * @param customCloudArmEndpoint the customCloudArmEndpoint value to set + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withCustomCloudArmEndpoint(String customCloudArmEndpoint) { + this.customCloudArmEndpoint = customCloudArmEndpoint; + return this; + } + + /** + * Get dsms endpoint. + * + * @return the externalDsmsEndpoint value + */ + public String externalDsmsEndpoint() { + return this.externalDsmsEndpoint; + } + + /** + * Set dsms endpoint. + * + * @param externalDsmsEndpoint the externalDsmsEndpoint value to set + * @return the CloudManifestFileDeploymentData object itself. + */ + public CloudManifestFileDeploymentData withExternalDsmsEndpoint(String externalDsmsEndpoint) { + this.externalDsmsEndpoint = externalDsmsEndpoint; + return this; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileProperties.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileProperties.java new file mode 100644 index 000000000000..61427909f75c --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cloud specific manifest JSON properties. + */ +public class CloudManifestFileProperties { + /** + * Cloud specific manifest data. + */ + @JsonProperty(value = "deploymentData") + private CloudManifestFileDeploymentData deploymentData; + + /** + * Signature of the cloud specific manifest data. + */ + @JsonProperty(value = "signature") + private String signature; + + /** + * Get cloud specific manifest data. + * + * @return the deploymentData value + */ + public CloudManifestFileDeploymentData deploymentData() { + return this.deploymentData; + } + + /** + * Set cloud specific manifest data. + * + * @param deploymentData the deploymentData value to set + * @return the CloudManifestFileProperties object itself. + */ + public CloudManifestFileProperties withDeploymentData(CloudManifestFileDeploymentData deploymentData) { + this.deploymentData = deploymentData; + return this; + } + + /** + * Get signature of the cloud specific manifest data. + * + * @return the signature value + */ + public String signature() { + return this.signature; + } + + /** + * Set signature of the cloud specific manifest data. + * + * @param signature the signature value to set + * @return the CloudManifestFileProperties object itself. + */ + public CloudManifestFileProperties withSignature(String signature) { + this.signature = signature; + return this; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileResponse.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileResponse.java new file mode 100644 index 000000000000..39d9320afe90 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFileResponse.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.AzureStackManager; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.CloudManifestFileResponseInner; + +/** + * Type representing CloudManifestFileResponse. + */ +public interface CloudManifestFileResponse extends HasInner, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + CloudManifestFileProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFiles.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFiles.java new file mode 100644 index 000000000000..f10170c8dc56 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CloudManifestFiles.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.azurestack.v2017_06_01; + +import rx.Observable; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.CloudManifestFilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing CloudManifestFiles. + */ +public interface CloudManifestFiles extends HasInner { + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String verificationVersion); + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Compatibility.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Compatibility.java new file mode 100644 index 000000000000..6cacf44503bf --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Compatibility.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.azurestack.v2017_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Product compatibility. + */ +public class Compatibility { + /** + * Tells if product is compatible with current device. + */ + @JsonProperty(value = "isCompatible") + private Boolean isCompatible; + + /** + * Short error message if any compatibility issues are found. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Full error message if any compatibility issues are found. + */ + @JsonProperty(value = "description") + private String description; + + /** + * List of all issues found. + */ + @JsonProperty(value = "issues") + private List issues; + + /** + * Get tells if product is compatible with current device. + * + * @return the isCompatible value + */ + public Boolean isCompatible() { + return this.isCompatible; + } + + /** + * Set tells if product is compatible with current device. + * + * @param isCompatible the isCompatible value to set + * @return the Compatibility object itself. + */ + public Compatibility withIsCompatible(Boolean isCompatible) { + this.isCompatible = isCompatible; + return this; + } + + /** + * Get short error message if any compatibility issues are found. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set short error message if any compatibility issues are found. + * + * @param message the message value to set + * @return the Compatibility object itself. + */ + public Compatibility withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get full error message if any compatibility issues are found. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set full error message if any compatibility issues are found. + * + * @param description the description value to set + * @return the Compatibility object itself. + */ + public Compatibility withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get list of all issues found. + * + * @return the issues value + */ + public List issues() { + return this.issues; + } + + /** + * Set list of all issues found. + * + * @param issues the issues value to set + * @return the Compatibility object itself. + */ + public Compatibility withIssues(List issues) { + this.issues = issues; + return this; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CompatibilityIssue.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CompatibilityIssue.java new file mode 100644 index 000000000000..377b72011d6e --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/CompatibilityIssue.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CompatibilityIssue. + */ +public final class CompatibilityIssue extends ExpandableStringEnum { + /** Static value HigherDeviceVersionRequired for CompatibilityIssue. */ + public static final CompatibilityIssue HIGHER_DEVICE_VERSION_REQUIRED = fromString("HigherDeviceVersionRequired"); + + /** Static value LowerDeviceVersionRequired for CompatibilityIssue. */ + public static final CompatibilityIssue LOWER_DEVICE_VERSION_REQUIRED = fromString("LowerDeviceVersionRequired"); + + /** Static value CapacityBillingModelRequired for CompatibilityIssue. */ + public static final CompatibilityIssue CAPACITY_BILLING_MODEL_REQUIRED = fromString("CapacityBillingModelRequired"); + + /** Static value PayAsYouGoBillingModelRequired for CompatibilityIssue. */ + public static final CompatibilityIssue PAY_AS_YOU_GO_BILLING_MODEL_REQUIRED = fromString("PayAsYouGoBillingModelRequired"); + + /** Static value DevelopmentBillingModelRequired for CompatibilityIssue. */ + public static final CompatibilityIssue DEVELOPMENT_BILLING_MODEL_REQUIRED = fromString("DevelopmentBillingModelRequired"); + + /** Static value AzureADIdentitySystemRequired for CompatibilityIssue. */ + public static final CompatibilityIssue AZURE_ADIDENTITY_SYSTEM_REQUIRED = fromString("AzureADIdentitySystemRequired"); + + /** Static value ADFSIdentitySystemRequired for CompatibilityIssue. */ + public static final CompatibilityIssue ADFSIDENTITY_SYSTEM_REQUIRED = fromString("ADFSIdentitySystemRequired"); + + /** Static value ConnectionToInternetRequired for CompatibilityIssue. */ + public static final CompatibilityIssue CONNECTION_TO_INTERNET_REQUIRED = fromString("ConnectionToInternetRequired"); + + /** Static value ConnectionToAzureRequired for CompatibilityIssue. */ + public static final CompatibilityIssue CONNECTION_TO_AZURE_REQUIRED = fromString("ConnectionToAzureRequired"); + + /** Static value DisconnectedEnvironmentRequired for CompatibilityIssue. */ + public static final CompatibilityIssue DISCONNECTED_ENVIRONMENT_REQUIRED = fromString("DisconnectedEnvironmentRequired"); + + /** + * Creates or finds a CompatibilityIssue from its string representation. + * @param name a name to look for + * @return the corresponding CompatibilityIssue + */ + @JsonCreator + public static CompatibilityIssue fromString(String name) { + return fromString(name, CompatibilityIssue.class); + } + + /** + * @return known CompatibilityIssue values + */ + public static Collection values() { + return values(CompatibilityIssue.class); + } +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/DeviceConfiguration.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/DeviceConfiguration.java new file mode 100644 index 000000000000..5ef1087fd0a0 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/DeviceConfiguration.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Device Configuration. + */ +public class DeviceConfiguration { + /** + * Version of the device. + */ + @JsonProperty(value = "deviceVersion", access = JsonProperty.Access.WRITE_ONLY) + private String deviceVersion; + + /** + * Identity system of the device. Possible values include: 'AzureAD', + * 'ADFS'. + */ + @JsonProperty(value = "identitySystem", access = JsonProperty.Access.WRITE_ONLY) + private Category identitySystem; + + /** + * Get version of the device. + * + * @return the deviceVersion value + */ + public String deviceVersion() { + return this.deviceVersion; + } + + /** + * Get identity system of the device. Possible values include: 'AzureAD', 'ADFS'. + * + * @return the identitySystem value + */ + public Category identitySystem() { + return this.identitySystem; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/MarketplaceProductLogUpdate.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/MarketplaceProductLogUpdate.java new file mode 100644 index 000000000000..424aba08388e --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/MarketplaceProductLogUpdate.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.azurestack.v2017_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Update details for product log. + */ +public class MarketplaceProductLogUpdate { + /** + * Operation to log. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Operation status to log. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Error related to the operation. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private String error; + + /** + * Error details related to operation. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get operation to log. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get operation status to log. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get error related to the operation. + * + * @return the error value + */ + public String error() { + return this.error; + } + + /** + * Get error details related to operation. + * + * @return the details value + */ + public String details() { + return this.details; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Product.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Product.java index 3d752bc51d47..005d7993963b 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Product.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Product.java @@ -25,6 +25,11 @@ public interface Product extends HasInner, Indexable, Refreshable< */ String billingPartNumber(); + /** + * @return the compatibility value. + */ + Compatibility compatibility(); + /** * @return the description value. */ diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/ProductList.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/ProductList.java new file mode 100644 index 000000000000..9d7dd2eb0c48 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/ProductList.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.azurestack.v2017_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.AzureStackManager; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.ProductListInner; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.ProductInner; +import java.util.List; + +/** + * Type representing ProductList. + */ +public interface ProductList extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/ProductLog.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/ProductLog.java new file mode 100644 index 000000000000..7eb316eeb5e7 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/ProductLog.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.azurestack.v2017_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.AzureStackManager; +import com.microsoft.azure.management.azurestack.v2017_06_01.implementation.ProductLogInner; + +/** + * Type representing ProductLog. + */ +public interface ProductLog extends HasInner, HasManager { + /** + * @return the details value. + */ + String details(); + + /** + * @return the endDate value. + */ + String endDate(); + + /** + * @return the error value. + */ + String error(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the productId value. + */ + String productId(); + + /** + * @return the registrationName value. + */ + String registrationName(); + + /** + * @return the resourceGroupName value. + */ + String resourceGroupName(); + + /** + * @return the startDate value. + */ + String startDate(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the subscriptionId value. + */ + String subscriptionId(); + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Products.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Products.java index 91709129477f..e78651d3f2ce 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Products.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/Products.java @@ -27,6 +27,38 @@ public interface Products extends HasInner { */ Observable listDetailsAsync(String resourceGroup, String registrationName, String productName); + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getProductsAsync(String resourceGroup, String registrationName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getProductAsync(String resourceGroup, String registrationName, String productName); + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable uploadLogAsync(String resourceGroup, String registrationName, String productName); + /** * Returns the specified product. * diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManagementClientImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManagementClientImpl.java index 7bcc9fca010d..99b91654c902 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManagementClientImpl.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManagementClientImpl.java @@ -145,6 +145,19 @@ public OperationsInner operations() { return this.operations; } + /** + * The CloudManifestFilesInner object to access its operations. + */ + private CloudManifestFilesInner cloudManifestFiles; + + /** + * Gets the CloudManifestFilesInner object to access its operations. + * @return the CloudManifestFilesInner object. + */ + public CloudManifestFilesInner cloudManifestFiles() { + return this.cloudManifestFiles; + } + /** * The ProductsInner object to access its operations. */ @@ -220,6 +233,7 @@ protected void initialize() { this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; this.operations = new OperationsInner(restClient().retrofit(), this); + this.cloudManifestFiles = new CloudManifestFilesInner(restClient().retrofit(), this); this.products = new ProductsInner(restClient().retrofit(), this); this.registrations = new RegistrationsInner(restClient().retrofit(), this); this.customerSubscriptions = new CustomerSubscriptionsInner(restClient().retrofit(), this); diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManager.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManager.java index 3c492de474da..e49d5816d998 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManager.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/AzureStackManager.java @@ -17,6 +17,7 @@ import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; import com.microsoft.azure.management.azurestack.v2017_06_01.Operations; +import com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFiles; import com.microsoft.azure.management.azurestack.v2017_06_01.Products; import com.microsoft.azure.management.azurestack.v2017_06_01.Registrations; import com.microsoft.azure.management.azurestack.v2017_06_01.CustomerSubscriptions; @@ -28,6 +29,7 @@ */ public final class AzureStackManager extends ManagerCore { private Operations operations; + private CloudManifestFiles cloudManifestFiles; private Products products; private Registrations registrations; private CustomerSubscriptions customerSubscriptions; @@ -88,6 +90,16 @@ public Operations operations() { return this.operations; } + /** + * @return Entry point to manage CloudManifestFiles. + */ + public CloudManifestFiles cloudManifestFiles() { + if (this.cloudManifestFiles == null) { + this.cloudManifestFiles = new CloudManifestFilesImpl(this); + } + return this.cloudManifestFiles; + } + /** * @return Entry point to manage Products. */ diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFileResponseImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFileResponseImpl.java new file mode 100644 index 000000000000..304de4538248 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFileResponseImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01.implementation; + +import com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFileResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFileProperties; + +class CloudManifestFileResponseImpl extends WrapperImpl implements CloudManifestFileResponse { + private final AzureStackManager manager; + CloudManifestFileResponseImpl(CloudManifestFileResponseInner inner, AzureStackManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AzureStackManager manager() { + return this.manager; + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CloudManifestFileProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFileResponseInner.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFileResponseInner.java new file mode 100644 index 000000000000..d70c9a3bdee9 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFileResponseInner.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.azurestack.v2017_06_01.implementation; + +import com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFileProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Cloud specific manifest GET response. + */ +public class CloudManifestFileResponseInner extends ProxyResource { + /** + * Cloud specific manifest data. + */ + @JsonProperty(value = "properties") + private CloudManifestFileProperties properties; + + /** + * The entity tag used for optimistic concurrency when modifying the + * resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get cloud specific manifest data. + * + * @return the properties value + */ + public CloudManifestFileProperties properties() { + return this.properties; + } + + /** + * Set cloud specific manifest data. + * + * @param properties the properties value to set + * @return the CloudManifestFileResponseInner object itself. + */ + public CloudManifestFileResponseInner withProperties(CloudManifestFileProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the entity tag used for optimistic concurrency when modifying the resource. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the entity tag used for optimistic concurrency when modifying the resource. + * + * @param etag the etag value to set + * @return the CloudManifestFileResponseInner object itself. + */ + public CloudManifestFileResponseInner withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFilesImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFilesImpl.java new file mode 100644 index 000000000000..85635c7ec991 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFilesImpl.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFiles; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFileResponse; + +class CloudManifestFilesImpl extends WrapperImpl implements CloudManifestFiles { + private final AzureStackManager manager; + + CloudManifestFilesImpl(AzureStackManager manager) { + super(manager.inner().cloudManifestFiles()); + this.manager = manager; + } + + public AzureStackManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String verificationVersion) { + CloudManifestFilesInner client = this.inner(); + return client.getAsync(verificationVersion) + .map(new Func1() { + @Override + public CloudManifestFileResponse call(CloudManifestFileResponseInner inner) { + return new CloudManifestFileResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + CloudManifestFilesInner client = this.inner(); + return client.listAsync() + .map(new Func1() { + @Override + public CloudManifestFileResponse call(CloudManifestFileResponseInner inner) { + return new CloudManifestFileResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFilesInner.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFilesInner.java new file mode 100644 index 000000000000..cd8e5d1dff76 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CloudManifestFilesInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.azurestack.v2017_06_01.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CloudManifestFiles. + */ +public class CloudManifestFilesInner { + /** The Retrofit service to perform REST calls. */ + private CloudManifestFilesService service; + /** The service client containing this operation class. */ + private AzureStackManagementClientImpl client; + + /** + * Initializes an instance of CloudManifestFilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CloudManifestFilesInner(Retrofit retrofit, AzureStackManagementClientImpl client) { + this.service = retrofit.create(CloudManifestFilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for CloudManifestFiles to be + * used by Retrofit to perform actually REST calls. + */ + interface CloudManifestFilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFiles list" }) + @GET("providers/Microsoft.AzureStack/cloudManifestFiles") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azurestack.v2017_06_01.CloudManifestFiles get" }) + @GET("providers/Microsoft.AzureStack/cloudManifestFiles/{verificationVersion}") + Observable> get(@Path("verificationVersion") String verificationVersion, @Query("versionCreationDate") String versionCreationDate, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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 CloudManifestFileResponseInner object if successful. + */ + public CloudManifestFileResponseInner list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @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); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudManifestFileResponseInner object + */ + public Observable listAsync() { + return listWithServiceResponseAsync().map(new Func1, CloudManifestFileResponseInner>() { + @Override + public CloudManifestFileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a cloud specific manifest JSON file with latest version. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudManifestFileResponseInner 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 clientResponse = listDelegate(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().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @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 CloudManifestFileResponseInner object if successful. + */ + public CloudManifestFileResponseInner get(String verificationVersion) { + return getWithServiceResponseAsync(verificationVersion).toBlocking().single().body(); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @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 verificationVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(verificationVersion), serviceCallback); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudManifestFileResponseInner object + */ + public Observable getAsync(String verificationVersion) { + return getWithServiceResponseAsync(verificationVersion).map(new Func1, CloudManifestFileResponseInner>() { + @Override + public CloudManifestFileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudManifestFileResponseInner object + */ + public Observable> getWithServiceResponseAsync(String verificationVersion) { + if (verificationVersion == null) { + throw new IllegalArgumentException("Parameter verificationVersion 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 versionCreationDate = null; + return service.get(verificationVersion, versionCreationDate, 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); + } + } + }); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 CloudManifestFileResponseInner object if successful. + */ + public CloudManifestFileResponseInner get(String verificationVersion, String versionCreationDate) { + return getWithServiceResponseAsync(verificationVersion, versionCreationDate).toBlocking().single().body(); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @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 verificationVersion, String versionCreationDate, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(verificationVersion, versionCreationDate), serviceCallback); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudManifestFileResponseInner object + */ + public Observable getAsync(String verificationVersion, String versionCreationDate) { + return getWithServiceResponseAsync(verificationVersion, versionCreationDate).map(new Func1, CloudManifestFileResponseInner>() { + @Override + public CloudManifestFileResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a cloud specific manifest JSON file. + * + * @param verificationVersion Signing verification key version. + * @param versionCreationDate Signing verification key version creation date. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudManifestFileResponseInner object + */ + public Observable> getWithServiceResponseAsync(String verificationVersion, String versionCreationDate) { + if (verificationVersion == null) { + throw new IllegalArgumentException("Parameter verificationVersion 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(verificationVersion, versionCreationDate, 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CustomerSubscriptionsImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CustomerSubscriptionsImpl.java index b3b968107662..78e6131a0811 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CustomerSubscriptionsImpl.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/CustomerSubscriptionsImpl.java @@ -64,10 +64,14 @@ public CustomerSubscription call(CustomerSubscriptionInner inner) { public Observable getAsync(String resourceGroup, String registrationName, String customerSubscriptionName) { CustomerSubscriptionsInner client = this.inner(); return client.getAsync(resourceGroup, registrationName, customerSubscriptionName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public CustomerSubscription call(CustomerSubscriptionInner inner) { - return wrapModel(inner); + public Observable call(CustomerSubscriptionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CustomerSubscription)wrapModel(inner)); + } } }); } diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductImpl.java index 924d6e839b56..24e5f170f166 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductImpl.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.azurestack.v2017_06_01.Product; import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; import rx.Observable; +import com.microsoft.azure.management.azurestack.v2017_06_01.Compatibility; import com.microsoft.azure.management.azurestack.v2017_06_01.IconUris; import java.util.List; import com.microsoft.azure.management.azurestack.v2017_06_01.ProductLink; @@ -49,6 +50,11 @@ public String billingPartNumber() { return this.inner().billingPartNumber(); } + @Override + public Compatibility compatibility() { + return this.inner().compatibility(); + } + @Override public String description() { return this.inner().description(); diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductInner.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductInner.java index f670dbbec94c..6f2d90d5457f 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductInner.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductInner.java @@ -12,6 +12,7 @@ import java.util.List; import com.microsoft.azure.management.azurestack.v2017_06_01.ProductLink; import com.microsoft.azure.management.azurestack.v2017_06_01.ProductProperties; +import com.microsoft.azure.management.azurestack.v2017_06_01.Compatibility; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.ProxyResource; @@ -123,6 +124,12 @@ public class ProductInner extends ProxyResource { @JsonProperty(value = "properties.productProperties") private ProductProperties productProperties; + /** + * Product compatibility with current device. + */ + @JsonProperty(value = "properties.compatibility") + private Compatibility compatibility; + /** * The entity tag used for optimistic concurrency when modifying the * resource. @@ -470,6 +477,26 @@ public ProductInner withProductProperties(ProductProperties productProperties) { return this; } + /** + * Get product compatibility with current device. + * + * @return the compatibility value + */ + public Compatibility compatibility() { + return this.compatibility; + } + + /** + * Set product compatibility with current device. + * + * @param compatibility the compatibility value to set + * @return the ProductInner object itself. + */ + public ProductInner withCompatibility(Compatibility compatibility) { + this.compatibility = compatibility; + return this; + } + /** * Get the entity tag used for optimistic concurrency when modifying the resource. * diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductListImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductListImpl.java new file mode 100644 index 000000000000..d0f25ba9c7bf --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductListImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01.implementation; + +import com.microsoft.azure.management.azurestack.v2017_06_01.ProductList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ProductListImpl extends WrapperImpl implements ProductList { + private final AzureStackManager manager; + ProductListImpl(ProductListInner inner, AzureStackManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AzureStackManager manager() { + return this.manager; + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductListInner.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductListInner.java new file mode 100644 index 000000000000..d73f12e60da1 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductListInner.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.azurestack.v2017_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Pageable list of products. + */ +public class ProductListInner { + /** + * URI to the next page. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * List of products. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get uRI to the next page. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set uRI to the next page. + * + * @param nextLink the nextLink value to set + * @return the ProductListInner object itself. + */ + public ProductListInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get list of products. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set list of products. + * + * @param value the value value to set + * @return the ProductListInner object itself. + */ + public ProductListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductLogImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductLogImpl.java new file mode 100644 index 000000000000..51672a4f9520 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductLogImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01.implementation; + +import com.microsoft.azure.management.azurestack.v2017_06_01.ProductLog; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ProductLogImpl extends WrapperImpl implements ProductLog { + private final AzureStackManager manager; + ProductLogImpl(ProductLogInner inner, AzureStackManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public AzureStackManager manager() { + return this.manager; + } + + @Override + public String details() { + return this.inner().details(); + } + + @Override + public String endDate() { + return this.inner().endDate(); + } + + @Override + public String error() { + return this.inner().error(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String productId() { + return this.inner().productId(); + } + + @Override + public String registrationName() { + return this.inner().registrationName(); + } + + @Override + public String resourceGroupName() { + return this.inner().resourceGroupName(); + } + + @Override + public String startDate() { + return this.inner().startDate(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String subscriptionId() { + return this.inner().subscriptionId(); + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductLogInner.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductLogInner.java new file mode 100644 index 000000000000..8306acb4ee05 --- /dev/null +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductLogInner.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.azurestack.v2017_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Product action log. + */ +public class ProductLogInner { + /** + * Log ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Logged product ID. + */ + @JsonProperty(value = "productId", access = JsonProperty.Access.WRITE_ONLY) + private String productId; + + /** + * Logged subscription ID. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /** + * Logged registration name. + */ + @JsonProperty(value = "registrationName", access = JsonProperty.Access.WRITE_ONLY) + private String registrationName; + + /** + * Logged resource group name. + */ + @JsonProperty(value = "resourceGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroupName; + + /** + * Logged operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Operation start datetime. + */ + @JsonProperty(value = "startDate", access = JsonProperty.Access.WRITE_ONLY) + private String startDate; + + /** + * Operation end datetime. + */ + @JsonProperty(value = "endDate", access = JsonProperty.Access.WRITE_ONLY) + private String endDate; + + /** + * Operation status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Operation error data. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private String error; + + /** + * Operation error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private String details; + + /** + * Get log ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get logged product ID. + * + * @return the productId value + */ + public String productId() { + return this.productId; + } + + /** + * Get logged subscription ID. + * + * @return the subscriptionId value + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get logged registration name. + * + * @return the registrationName value + */ + public String registrationName() { + return this.registrationName; + } + + /** + * Get logged resource group name. + * + * @return the resourceGroupName value + */ + public String resourceGroupName() { + return this.resourceGroupName; + } + + /** + * Get logged operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get operation start datetime. + * + * @return the startDate value + */ + public String startDate() { + return this.startDate; + } + + /** + * Get operation end datetime. + * + * @return the endDate value + */ + public String endDate() { + return this.endDate; + } + + /** + * Get operation status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get operation error data. + * + * @return the error value + */ + public String error() { + return this.error; + } + + /** + * Get operation error details. + * + * @return the details value + */ + public String details() { + return this.details; + } + +} diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsImpl.java index 69d0a515aab0..20e5a1f76d54 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsImpl.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsImpl.java @@ -15,7 +15,9 @@ import rx.functions.Func1; import com.microsoft.azure.Page; import com.microsoft.azure.management.azurestack.v2017_06_01.ExtendedProduct; +import com.microsoft.azure.management.azurestack.v2017_06_01.ProductList; import com.microsoft.azure.management.azurestack.v2017_06_01.Product; +import com.microsoft.azure.management.azurestack.v2017_06_01.ProductLog; class ProductsImpl extends WrapperImpl implements Products { private final AzureStackManager manager; @@ -45,6 +47,42 @@ public ExtendedProduct call(ExtendedProductInner inner) { }); } + @Override + public Observable getProductsAsync(String resourceGroup, String registrationName) { + ProductsInner client = this.inner(); + return client.getProductsAsync(resourceGroup, registrationName) + .map(new Func1() { + @Override + public ProductList call(ProductListInner inner) { + return new ProductListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getProductAsync(String resourceGroup, String registrationName, String productName) { + ProductsInner client = this.inner(); + return client.getProductAsync(resourceGroup, registrationName, productName) + .map(new Func1() { + @Override + public Product call(ProductInner inner) { + return new ProductImpl(inner, manager()); + } + }); + } + + @Override + public Observable uploadLogAsync(String resourceGroup, String registrationName, String productName) { + ProductsInner client = this.inner(); + return client.uploadLogAsync(resourceGroup, registrationName, productName) + .map(new Func1() { + @Override + public ProductLog call(ProductLogInner inner) { + return new ProductLogImpl(inner, manager()); + } + }); + } + @Override public Observable listAsync(final String resourceGroup, final String registrationName) { ProductsInner client = this.inner(); @@ -67,10 +105,14 @@ public Product call(ProductInner inner) { public Observable getAsync(String resourceGroup, String registrationName, String productName) { ProductsInner client = this.inner(); return client.getAsync(resourceGroup, registrationName, productName) - .map(new Func1() { + .flatMap(new Func1>() { @Override - public Product call(ProductInner inner) { - return wrapModel(inner); + public Observable call(ProductInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Product)wrapModel(inner)); + } } }); } diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsInner.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsInner.java index 742bf14e84c6..c824ecc78147 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsInner.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/ProductsInner.java @@ -13,7 +13,9 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.azurestack.v2017_06_01.DeviceConfiguration; import com.microsoft.azure.management.azurestack.v2017_06_01.ErrorResponseException; +import com.microsoft.azure.management.azurestack.v2017_06_01.MarketplaceProductLogUpdate; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -22,6 +24,7 @@ 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; @@ -71,6 +74,18 @@ interface ProductsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/listDetails") Observable> listDetails(@Path("subscriptionId") String subscriptionId, @Path("resourceGroup") String resourceGroup, @Path("registrationName") String registrationName, @Path("productName") String productName, @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.azurestack.v2017_06_01.Products getProducts" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/_all/GetProducts") + Observable> getProducts(@Path("subscriptionId") String subscriptionId, @Path("resourceGroup") String resourceGroup, @Path("registrationName") String registrationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DeviceConfiguration deviceConfiguration, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azurestack.v2017_06_01.Products getProduct" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/GetProduct") + Observable> getProduct(@Path("subscriptionId") String subscriptionId, @Path("resourceGroup") String resourceGroup, @Path("registrationName") String registrationName, @Path("productName") String productName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DeviceConfiguration deviceConfiguration, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azurestack.v2017_06_01.Products uploadLog" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/products/{productName}/uploadProductLog") + Observable> uploadLog(@Path("subscriptionId") String subscriptionId, @Path("resourceGroup") String resourceGroup, @Path("registrationName") String registrationName, @Path("productName") String productName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MarketplaceProductLogUpdate marketplaceProductLogUpdate, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.azurestack.v2017_06_01.Products listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -386,6 +401,278 @@ private ServiceResponse listDetailsDelegate(Response getProductsAsync(String resourceGroup, String registrationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getProductsWithServiceResponseAsync(resourceGroup, registrationName), serviceCallback); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductListInner object + */ + public Observable getProductsAsync(String resourceGroup, String registrationName) { + return getProductsWithServiceResponseAsync(resourceGroup, registrationName).map(new Func1, ProductListInner>() { + @Override + public ProductListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a list of products. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductListInner object + */ + public Observable> getProductsWithServiceResponseAsync(String resourceGroup, String registrationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + if (registrationName == null) { + throw new IllegalArgumentException("Parameter registrationName 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.getProducts(this.client.subscriptionId(), resourceGroup, registrationName, this.client.apiVersion(), this.client.acceptLanguage(), deviceConfiguration, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getProductsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getProductsDelegate(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); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 ProductInner object if successful. + */ + public ProductInner getProduct(String resourceGroup, String registrationName, String productName) { + return getProductWithServiceResponseAsync(resourceGroup, registrationName, productName).toBlocking().single().body(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 getProductAsync(String resourceGroup, String registrationName, String productName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getProductWithServiceResponseAsync(resourceGroup, registrationName, productName), serviceCallback); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable getProductAsync(String resourceGroup, String registrationName, String productName) { + return getProductWithServiceResponseAsync(resourceGroup, registrationName, productName).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> getProductWithServiceResponseAsync(String resourceGroup, String registrationName, String productName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + if (registrationName == null) { + throw new IllegalArgumentException("Parameter registrationName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName 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.getProduct(this.client.subscriptionId(), resourceGroup, registrationName, productName, this.client.apiVersion(), this.client.acceptLanguage(), deviceConfiguration, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getProductDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getProductDelegate(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); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 ProductLogInner object if successful. + */ + public ProductLogInner uploadLog(String resourceGroup, String registrationName, String productName) { + return uploadLogWithServiceResponseAsync(resourceGroup, registrationName, productName).toBlocking().single().body(); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @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 uploadLogAsync(String resourceGroup, String registrationName, String productName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadLogWithServiceResponseAsync(resourceGroup, registrationName, productName), serviceCallback); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductLogInner object + */ + public Observable uploadLogAsync(String resourceGroup, String registrationName, String productName) { + return uploadLogWithServiceResponseAsync(resourceGroup, registrationName, productName).map(new Func1, ProductLogInner>() { + @Override + public ProductLogInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns the specified product. + * + * @param resourceGroup Name of the resource group. + * @param registrationName Name of the Azure Stack registration. + * @param productName Name of the product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductLogInner object + */ + public Observable> uploadLogWithServiceResponseAsync(String resourceGroup, String registrationName, String productName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroup == null) { + throw new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."); + } + if (registrationName == null) { + throw new IllegalArgumentException("Parameter registrationName is required and cannot be null."); + } + if (productName == null) { + throw new IllegalArgumentException("Parameter productName 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.uploadLog(this.client.subscriptionId(), resourceGroup, registrationName, productName, this.client.apiVersion(), this.client.acceptLanguage(), marketplaceProductLogUpdate, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadLogDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse uploadLogDelegate(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); + } + /** * Returns a list of products. * diff --git a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/RegistrationImpl.java b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/RegistrationImpl.java index 4bb0b152c8f2..1929812c87c8 100644 --- a/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/RegistrationImpl.java +++ b/sdk/azurestack/mgmt-v2017_06_01/src/main/java/com/microsoft/azure/management/azurestack/v2017_06_01/implementation/RegistrationImpl.java @@ -9,7 +9,6 @@ package com.microsoft.azure.management.azurestack.v2017_06_01.implementation; import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; -import com.microsoft.azure.management.azurestack.v2017_06_01.Location; import com.microsoft.azure.management.azurestack.v2017_06_01.Registration; import rx.Observable; import com.microsoft.azure.management.azurestack.v2017_06_01.RegistrationParameter; @@ -25,7 +24,7 @@ class RegistrationImpl extends GroupableResourceCoreImpl createResourceAsync() { RegistrationsInner client = this.manager().inner().registrations(); - this.createOrUpdateParameter.withLocation(Location.fromString(inner().location())); + this.createOrUpdateParameter.withLocation(inner().location()); return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) .map(new Func1() { @Override