diff --git a/azure-mgmt-databox/pom.xml b/azure-mgmt-databox/pom.xml new file mode 100644 index 000000000000..9ceffd9de619 --- /dev/null +++ b/azure-mgmt-databox/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.databox + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-databox + 1.0.0-beta + jar + Microsoft Azure SDK for DataBox Management + This package contains Microsoft DataBox Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AccessProtocol.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AccessProtocol.java new file mode 100644 index 000000000000..f77615db8131 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AccessProtocol.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessProtocol. + */ +public enum AccessProtocol { + /** Server Message Block protocol(SMB). */ + SMB("SMB"), + + /** Network File System protocol(NFS). */ + NFS("NFS"); + + /** The actual serialized value for a AccessProtocol instance. */ + private String value; + + AccessProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessProtocol object, or null if unable to parse. + */ + @JsonCreator + public static AccessProtocol fromString(String value) { + AccessProtocol[] items = AccessProtocol.values(); + for (AccessProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AccountCredentialDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AccountCredentialDetails.java new file mode 100644 index 000000000000..030752ef507d --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AccountCredentialDetails.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Credential details of the account. + */ +public class AccountCredentialDetails { + /** + * Name of the account. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /** + * Connection string of the account endpoint to use the account as a + * storage endpoint on the device. + */ + @JsonProperty(value = "accountConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String accountConnectionString; + + /** + * Per share level unencrypted access credentials. + */ + @JsonProperty(value = "shareCredentialDetails", access = JsonProperty.Access.WRITE_ONLY) + private List shareCredentialDetails; + + /** + * Get name of the account. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Get connection string of the account endpoint to use the account as a storage endpoint on the device. + * + * @return the accountConnectionString value + */ + public String accountConnectionString() { + return this.accountConnectionString; + } + + /** + * Get per share level unencrypted access credentials. + * + * @return the shareCredentialDetails value + */ + public List shareCredentialDetails() { + return this.shareCredentialDetails; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressType.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressType.java new file mode 100644 index 000000000000..376ea1a8e452 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressType.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AddressType. + */ +public enum AddressType { + /** Address type not known. */ + NONE("None"), + + /** Residential Address. */ + RESIDENTIAL("Residential"), + + /** Commercial Address. */ + COMMERCIAL("Commercial"); + + /** The actual serialized value for a AddressType instance. */ + private String value; + + AddressType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AddressType instance. + * + * @param value the serialized value to parse. + * @return the parsed AddressType object, or null if unable to parse. + */ + @JsonCreator + public static AddressType fromString(String value) { + AddressType[] items = AddressType.values(); + for (AddressType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressValidationOutput.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressValidationOutput.java new file mode 100644 index 000000000000..d1466a162c92 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressValidationOutput.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databox.implementation.DataBoxManager; +import com.microsoft.azure.management.databox.implementation.AddressValidationOutputInner; +import java.util.List; + +/** + * Type representing AddressValidationOutput. + */ +public interface AddressValidationOutput extends HasInner, HasManager { + /** + * @return the alternateAddresses value. + */ + List alternateAddresses(); + + /** + * @return the validationStatus value. + */ + AddressValidationStatus validationStatus(); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressValidationStatus.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressValidationStatus.java new file mode 100644 index 000000000000..2a7626d9af34 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AddressValidationStatus.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AddressValidationStatus. + */ +public enum AddressValidationStatus { + /** Address provided is valid. */ + VALID("Valid"), + + /** Address provided is invalid or not supported. */ + INVALID("Invalid"), + + /** Address provided is ambiguous, please choose one of the alternate addresses returned. */ + AMBIGUOUS("Ambiguous"); + + /** The actual serialized value for a AddressValidationStatus instance. */ + private String value; + + AddressValidationStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AddressValidationStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AddressValidationStatus object, or null if unable to parse. + */ + @JsonCreator + public static AddressValidationStatus fromString(String value) { + AddressValidationStatus[] items = AddressValidationStatus.values(); + for (AddressValidationStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ApplianceNetworkConfiguration.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ApplianceNetworkConfiguration.java new file mode 100644 index 000000000000..987e5d2b5037 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ApplianceNetworkConfiguration.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Network Adapter configuration of a DataBox. + */ +public class ApplianceNetworkConfiguration { + /** + * Name of the network. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Mac Address. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /** + * Get name of the network. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get mac Address. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ArmBaseObject.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ArmBaseObject.java new file mode 100644 index 000000000000..840c81150561 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ArmBaseObject.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for all objects under resource. + */ +public class ArmBaseObject { + /** + * Name of the object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Id of the object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Type of the object. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get name of the object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get id of the object. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get type of the object. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AvailableSkuRequest.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AvailableSkuRequest.java new file mode 100644 index 000000000000..9e0379059563 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/AvailableSkuRequest.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The filters for showing the available skus. + */ +public class AvailableSkuRequest { + /** + * Type of the transfer. + */ + @JsonProperty(value = "transferType", required = true) + private String transferType; + + /** + * ISO country code. Country for hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * Location for data transfer. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Sku Names to filter for available skus. + */ + @JsonProperty(value = "skuNames") + private List skuNames; + + /** + * Creates an instance of AvailableSkuRequest class. + * @param country iSO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + * @param location location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + */ + public AvailableSkuRequest() { + transferType = "ImportToAzure"; + } + + /** + * Get type of the transfer. + * + * @return the transferType value + */ + public String transferType() { + return this.transferType; + } + + /** + * Set type of the transfer. + * + * @param transferType the transferType value to set + * @return the AvailableSkuRequest object itself. + */ + public AvailableSkuRequest withTransferType(String transferType) { + this.transferType = transferType; + return this; + } + + /** + * Get iSO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set iSO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements. + * + * @param country the country value to set + * @return the AvailableSkuRequest object itself. + */ + public AvailableSkuRequest withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01. + * + * @param location the location value to set + * @return the AvailableSkuRequest object itself. + */ + public AvailableSkuRequest withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get sku Names to filter for available skus. + * + * @return the skuNames value + */ + public List skuNames() { + return this.skuNames; + } + + /** + * Set sku Names to filter for available skus. + * + * @param skuNames the skuNames value to set + * @return the AvailableSkuRequest object itself. + */ + public AvailableSkuRequest withSkuNames(List skuNames) { + this.skuNames = skuNames; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CancellationReason.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CancellationReason.java new file mode 100644 index 000000000000..669939d3c6d6 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CancellationReason.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Reason for cancellation. + */ +public class CancellationReason { + /** + * Reason for cancellation. + */ + @JsonProperty(value = "reason", required = true) + private String reason; + + /** + * Get reason for cancellation. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set reason for cancellation. + * + * @param reason the reason value to set + * @return the CancellationReason object itself. + */ + public CancellationReason withReason(String reason) { + this.reason = reason; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ContactDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ContactDetails.java new file mode 100644 index 000000000000..158a355ee14f --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ContactDetails.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contact Details. + */ +public class ContactDetails { + /** + * Contact name of the person. + */ + @JsonProperty(value = "contactName", required = true) + private String contactName; + + /** + * Phone number of the contact person. + */ + @JsonProperty(value = "phone", required = true) + private String phone; + + /** + * Phone extension number of the contact person. + */ + @JsonProperty(value = "phoneExtension") + private String phoneExtension; + + /** + * Mobile number of the contact person. + */ + @JsonProperty(value = "mobile") + private String mobile; + + /** + * List of Email-ids to be notified about job progress. + */ + @JsonProperty(value = "emailList", required = true) + private List emailList; + + /** + * Notification preference for a job stage. + */ + @JsonProperty(value = "notificationPreference") + private List notificationPreference; + + /** + * Get contact name of the person. + * + * @return the contactName value + */ + public String contactName() { + return this.contactName; + } + + /** + * Set contact name of the person. + * + * @param contactName the contactName value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withContactName(String contactName) { + this.contactName = contactName; + return this; + } + + /** + * Get phone number of the contact person. + * + * @return the phone value + */ + public String phone() { + return this.phone; + } + + /** + * Set phone number of the contact person. + * + * @param phone the phone value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone extension number of the contact person. + * + * @return the phoneExtension value + */ + public String phoneExtension() { + return this.phoneExtension; + } + + /** + * Set phone extension number of the contact person. + * + * @param phoneExtension the phoneExtension value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withPhoneExtension(String phoneExtension) { + this.phoneExtension = phoneExtension; + return this; + } + + /** + * Get mobile number of the contact person. + * + * @return the mobile value + */ + public String mobile() { + return this.mobile; + } + + /** + * Set mobile number of the contact person. + * + * @param mobile the mobile value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withMobile(String mobile) { + this.mobile = mobile; + return this; + } + + /** + * Get list of Email-ids to be notified about job progress. + * + * @return the emailList value + */ + public List emailList() { + return this.emailList; + } + + /** + * Set list of Email-ids to be notified about job progress. + * + * @param emailList the emailList value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withEmailList(List emailList) { + this.emailList = emailList; + return this; + } + + /** + * Get notification preference for a job stage. + * + * @return the notificationPreference value + */ + public List notificationPreference() { + return this.notificationPreference; + } + + /** + * Set notification preference for a job stage. + * + * @param notificationPreference the notificationPreference value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withNotificationPreference(List notificationPreference) { + this.notificationPreference = notificationPreference; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyLogDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyLogDetails.java new file mode 100644 index 000000000000..55be4e4d7f34 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyLogDetails.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Details for log generated during copy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "copyLogDetailsType") +@JsonTypeName("CopyLogDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DataBox", value = DataBoxAccountCopyLogDetails.class), + @JsonSubTypes.Type(name = "DataBoxDisk", value = DataBoxDiskCopyLogDetails.class), + @JsonSubTypes.Type(name = "DataBoxHeavy", value = DataBoxHeavyAccountCopyLogDetails.class) +}) +public class CopyLogDetails { +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyProgress.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyProgress.java new file mode 100644 index 000000000000..7f395490f154 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyProgress.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Copy progress. + */ +public class CopyProgress { + /** + * Name of the storage account where the data needs to be uploaded. + */ + @JsonProperty(value = "storageAccountName", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountName; + + /** + * Id of the account where the data needs to be uploaded. + */ + @JsonProperty(value = "accountId", access = JsonProperty.Access.WRITE_ONLY) + private String accountId; + + /** + * The bytesSentToCloud property. + */ + @JsonProperty(value = "bytesSentToCloud", access = JsonProperty.Access.WRITE_ONLY) + private String bytesSentToCloud; + + /** + * Total amount of data to be processed by the job. + */ + @JsonProperty(value = "totalBytesToProcess", access = JsonProperty.Access.WRITE_ONLY) + private Long totalBytesToProcess; + + /** + * Number of files processed by the job as of now. + */ + @JsonProperty(value = "filesProcessed", access = JsonProperty.Access.WRITE_ONLY) + private Long filesProcessed; + + /** + * Total number of files to be processed by the job. + */ + @JsonProperty(value = "totalFilesToProcess", access = JsonProperty.Access.WRITE_ONLY) + private Long totalFilesToProcess; + + /** + * Get name of the storage account where the data needs to be uploaded. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Get id of the account where the data needs to be uploaded. + * + * @return the accountId value + */ + public String accountId() { + return this.accountId; + } + + /** + * Get the bytesSentToCloud value. + * + * @return the bytesSentToCloud value + */ + public String bytesSentToCloud() { + return this.bytesSentToCloud; + } + + /** + * Get total amount of data to be processed by the job. + * + * @return the totalBytesToProcess value + */ + public Long totalBytesToProcess() { + return this.totalBytesToProcess; + } + + /** + * Get number of files processed by the job as of now. + * + * @return the filesProcessed value + */ + public Long filesProcessed() { + return this.filesProcessed; + } + + /** + * Get total number of files to be processed by the job. + * + * @return the totalFilesToProcess value + */ + public Long totalFilesToProcess() { + return this.totalFilesToProcess; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyStatus.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyStatus.java new file mode 100644 index 000000000000..0176c911421d --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/CopyStatus.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CopyStatus. + */ +public enum CopyStatus { + /** Data copy hasn't started yet. */ + NOT_STARTED("NotStarted"), + + /** Data copy is in progress. */ + IN_PROGRESS("InProgress"), + + /** Data copy completed. */ + COMPLETED("Completed"), + + /** Data copy completed with errors. */ + COMPLETED_WITH_ERRORS("CompletedWithErrors"), + + /** Data copy failed. No data was copied. */ + FAILED("Failed"), + + /** No copy triggered as device was not returned. */ + NOT_RETURNED("NotReturned"); + + /** The actual serialized value for a CopyStatus instance. */ + private String value; + + CopyStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CopyStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed CopyStatus object, or null if unable to parse. + */ + @JsonCreator + public static CopyStatus fromString(String value) { + CopyStatus[] items = CopyStatus.values(); + for (CopyStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxAccountCopyLogDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxAccountCopyLogDetails.java new file mode 100644 index 000000000000..9f8bfa7f87b6 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxAccountCopyLogDetails.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Copy log details for a storage account of a DataBox job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "copyLogDetailsType") +@JsonTypeName("DataBox") +public class DataBoxAccountCopyLogDetails extends CopyLogDetails { + /** + * Destination account name. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /** + * Link for copy logs. + */ + @JsonProperty(value = "copyLogLink", access = JsonProperty.Access.WRITE_ONLY) + private String copyLogLink; + + /** + * Get destination account name. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Get link for copy logs. + * + * @return the copyLogLink value + */ + public String copyLogLink() { + return this.copyLogLink; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskCopyLogDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskCopyLogDetails.java new file mode 100644 index 000000000000..f055f1533dac --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskCopyLogDetails.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Copy Log Details for a disk. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "copyLogDetailsType") +@JsonTypeName("DataBoxDisk") +public class DataBoxDiskCopyLogDetails extends CopyLogDetails { + /** + * Disk Serial Number. + */ + @JsonProperty(value = "diskSerialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String diskSerialNumber; + + /** + * Link for copy error logs. + */ + @JsonProperty(value = "errorLogLink", access = JsonProperty.Access.WRITE_ONLY) + private String errorLogLink; + + /** + * Link for copy verbose logs. + */ + @JsonProperty(value = "verboseLogLink", access = JsonProperty.Access.WRITE_ONLY) + private String verboseLogLink; + + /** + * Get disk Serial Number. + * + * @return the diskSerialNumber value + */ + public String diskSerialNumber() { + return this.diskSerialNumber; + } + + /** + * Get link for copy error logs. + * + * @return the errorLogLink value + */ + public String errorLogLink() { + return this.errorLogLink; + } + + /** + * Get link for copy verbose logs. + * + * @return the verboseLogLink value + */ + public String verboseLogLink() { + return this.verboseLogLink; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskCopyProgress.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskCopyProgress.java new file mode 100644 index 000000000000..656fdd6ed400 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskCopyProgress.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataBox Disk Copy Progress. + */ +public class DataBoxDiskCopyProgress { + /** + * The serial number of the disk. + */ + @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /** + * Bytes copied during the copy of disk. + */ + @JsonProperty(value = "bytesCopied", access = JsonProperty.Access.WRITE_ONLY) + private Long bytesCopied; + + /** + * Indicates the percentage completed for the copy of the disk. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /** + * The Status of the copy. Possible values include: 'NotStarted', + * 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', + * 'NotReturned'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private CopyStatus status; + + /** + * Get the serial number of the disk. + * + * @return the serialNumber value + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get bytes copied during the copy of disk. + * + * @return the bytesCopied value + */ + public Long bytesCopied() { + return this.bytesCopied; + } + + /** + * Get indicates the percentage completed for the copy of the disk. + * + * @return the percentComplete value + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the Status of the copy. Possible values include: 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'NotReturned'. + * + * @return the status value + */ + public CopyStatus status() { + return this.status; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskJobDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskJobDetails.java new file mode 100644 index 000000000000..0dddda584bbd --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskJobDetails.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DataBox Disk Job Details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobDetailsType") +@JsonTypeName("DataBoxDisk") +public class DataBoxDiskJobDetails extends JobDetails { + /** + * User preference on what size disks are needed for the job. The map is + * from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB + * size. Key is string but will be checked against an int. + */ + @JsonProperty(value = "preferredDisks") + private Map preferredDisks; + + /** + * Copy progress per disk. + */ + @JsonProperty(value = "copyProgress", access = JsonProperty.Access.WRITE_ONLY) + private List copyProgress; + + /** + * Contains the map of disk serial number to the disk size being used for + * the job. Is returned only after the disks are shipped to the customer. + */ + @JsonProperty(value = "disksAndSizeDetails", access = JsonProperty.Access.WRITE_ONLY) + private Map disksAndSizeDetails; + + /** + * User entered passkey for DataBox Disk job. + */ + @JsonProperty(value = "passkey") + private String passkey; + + /** + * Get user preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. + * + * @return the preferredDisks value + */ + public Map preferredDisks() { + return this.preferredDisks; + } + + /** + * Set user preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. + * + * @param preferredDisks the preferredDisks value to set + * @return the DataBoxDiskJobDetails object itself. + */ + public DataBoxDiskJobDetails withPreferredDisks(Map preferredDisks) { + this.preferredDisks = preferredDisks; + return this; + } + + /** + * Get copy progress per disk. + * + * @return the copyProgress value + */ + public List copyProgress() { + return this.copyProgress; + } + + /** + * Get contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. + * + * @return the disksAndSizeDetails value + */ + public Map disksAndSizeDetails() { + return this.disksAndSizeDetails; + } + + /** + * Get user entered passkey for DataBox Disk job. + * + * @return the passkey value + */ + public String passkey() { + return this.passkey; + } + + /** + * Set user entered passkey for DataBox Disk job. + * + * @param passkey the passkey value to set + * @return the DataBoxDiskJobDetails object itself. + */ + public DataBoxDiskJobDetails withPasskey(String passkey) { + this.passkey = passkey; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskJobSecrets.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskJobSecrets.java new file mode 100644 index 000000000000..bd3c970e854b --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxDiskJobSecrets.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The secrets related to disk job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobSecretsType") +@JsonTypeName("DataBoxDisk") +public class DataBoxDiskJobSecrets extends JobSecrets { + /** + * Contains the list of secrets object for that device. + */ + @JsonProperty(value = "diskSecrets", access = JsonProperty.Access.WRITE_ONLY) + private List diskSecrets; + + /** + * PassKey for the disk Job. + */ + @JsonProperty(value = "passKey", access = JsonProperty.Access.WRITE_ONLY) + private String passKey; + + /** + * Whether passkey was provided by user. + */ + @JsonProperty(value = "isPasskeyUserDefined", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isPasskeyUserDefined; + + /** + * Get contains the list of secrets object for that device. + * + * @return the diskSecrets value + */ + public List diskSecrets() { + return this.diskSecrets; + } + + /** + * Get passKey for the disk Job. + * + * @return the passKey value + */ + public String passKey() { + return this.passKey; + } + + /** + * Get whether passkey was provided by user. + * + * @return the isPasskeyUserDefined value + */ + public Boolean isPasskeyUserDefined() { + return this.isPasskeyUserDefined; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyAccountCopyLogDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyAccountCopyLogDetails.java new file mode 100644 index 000000000000..10ca746d6246 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyAccountCopyLogDetails.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Copy log details for a storage account for DataBoxHeavy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "copyLogDetailsType") +@JsonTypeName("DataBoxHeavy") +public class DataBoxHeavyAccountCopyLogDetails extends CopyLogDetails { + /** + * Destination account name. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /** + * Link for copy logs. + */ + @JsonProperty(value = "copyLogLink", access = JsonProperty.Access.WRITE_ONLY) + private List copyLogLink; + + /** + * Get destination account name. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Get link for copy logs. + * + * @return the copyLogLink value + */ + public List copyLogLink() { + return this.copyLogLink; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyJobDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyJobDetails.java new file mode 100644 index 000000000000..385c75233d1e --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyJobDetails.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DataBoxHeavy Device Job Details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobDetailsType") +@JsonTypeName("DataBoxHeavy") +public class DataBoxHeavyJobDetails extends JobDetails { + /** + * Copy progress per account. + */ + @JsonProperty(value = "copyProgress", access = JsonProperty.Access.WRITE_ONLY) + private List copyProgress; + + /** + * Get copy progress per account. + * + * @return the copyProgress value + */ + public List copyProgress() { + return this.copyProgress; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyJobSecrets.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyJobSecrets.java new file mode 100644 index 000000000000..36e146667e6a --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavyJobSecrets.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The secrets related to a DataBoxHeavy job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobSecretsType") +@JsonTypeName("DataBoxHeavy") +public class DataBoxHeavyJobSecrets extends JobSecrets { + /** + * Contains the list of secret objects for a DataBoxHeavy job. + */ + @JsonProperty(value = "cabinetPodSecrets", access = JsonProperty.Access.WRITE_ONLY) + private List cabinetPodSecrets; + + /** + * Get contains the list of secret objects for a DataBoxHeavy job. + * + * @return the cabinetPodSecrets value + */ + public List cabinetPodSecrets() { + return this.cabinetPodSecrets; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavySecret.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavySecret.java new file mode 100644 index 000000000000..85792a17bd27 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxHeavySecret.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secrets related to a DataBoxHeavy. + */ +public class DataBoxHeavySecret { + /** + * Serial number of the assigned device. + */ + @JsonProperty(value = "deviceSerialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String deviceSerialNumber; + + /** + * Password for out of the box experience on device. + */ + @JsonProperty(value = "devicePassword", access = JsonProperty.Access.WRITE_ONLY) + private String devicePassword; + + /** + * Network configuration of the appliance. + */ + @JsonProperty(value = "networkConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List networkConfigurations; + + /** + * The base 64 encoded public key to authenticate with the device. + */ + @JsonProperty(value = "encodedValidationCertPubKey", access = JsonProperty.Access.WRITE_ONLY) + private String encodedValidationCertPubKey; + + /** + * Per account level access credentials. + */ + @JsonProperty(value = "accountCredentialDetails", access = JsonProperty.Access.WRITE_ONLY) + private List accountCredentialDetails; + + /** + * Get serial number of the assigned device. + * + * @return the deviceSerialNumber value + */ + public String deviceSerialNumber() { + return this.deviceSerialNumber; + } + + /** + * Get password for out of the box experience on device. + * + * @return the devicePassword value + */ + public String devicePassword() { + return this.devicePassword; + } + + /** + * Get network configuration of the appliance. + * + * @return the networkConfigurations value + */ + public List networkConfigurations() { + return this.networkConfigurations; + } + + /** + * Get the base 64 encoded public key to authenticate with the device. + * + * @return the encodedValidationCertPubKey value + */ + public String encodedValidationCertPubKey() { + return this.encodedValidationCertPubKey; + } + + /** + * Get per account level access credentials. + * + * @return the accountCredentialDetails value + */ + public List accountCredentialDetails() { + return this.accountCredentialDetails; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxJobDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxJobDetails.java new file mode 100644 index 000000000000..abf866d42491 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxJobDetails.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DataBox Job Details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobDetailsType") +@JsonTypeName("DataBox") +public class DataBoxJobDetails extends JobDetails { + /** + * Copy progress per storage account. + */ + @JsonProperty(value = "copyProgress", access = JsonProperty.Access.WRITE_ONLY) + private List copyProgress; + + /** + * Get copy progress per storage account. + * + * @return the copyProgress value + */ + public List copyProgress() { + return this.copyProgress; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxSecret.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxSecret.java new file mode 100644 index 000000000000..79f35f6db83a --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataBoxSecret.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The secrets related to a DataBox. + */ +public class DataBoxSecret { + /** + * Serial number of the assigned device. + */ + @JsonProperty(value = "deviceSerialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String deviceSerialNumber; + + /** + * Password for out of the box experience on device. + */ + @JsonProperty(value = "devicePassword", access = JsonProperty.Access.WRITE_ONLY) + private String devicePassword; + + /** + * Network configuration of the appliance. + */ + @JsonProperty(value = "networkConfigurations", access = JsonProperty.Access.WRITE_ONLY) + private List networkConfigurations; + + /** + * The base 64 encoded public key to authenticate with the device. + */ + @JsonProperty(value = "encodedValidationCertPubKey", access = JsonProperty.Access.WRITE_ONLY) + private String encodedValidationCertPubKey; + + /** + * Per account level access credentials. + */ + @JsonProperty(value = "accountCredentialDetails", access = JsonProperty.Access.WRITE_ONLY) + private List accountCredentialDetails; + + /** + * Get serial number of the assigned device. + * + * @return the deviceSerialNumber value + */ + public String deviceSerialNumber() { + return this.deviceSerialNumber; + } + + /** + * Get password for out of the box experience on device. + * + * @return the devicePassword value + */ + public String devicePassword() { + return this.devicePassword; + } + + /** + * Get network configuration of the appliance. + * + * @return the networkConfigurations value + */ + public List networkConfigurations() { + return this.networkConfigurations; + } + + /** + * Get the base 64 encoded public key to authenticate with the device. + * + * @return the encodedValidationCertPubKey value + */ + public String encodedValidationCertPubKey() { + return this.encodedValidationCertPubKey; + } + + /** + * Get per account level access credentials. + * + * @return the accountCredentialDetails value + */ + public List accountCredentialDetails() { + return this.accountCredentialDetails; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataboxJobSecrets.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataboxJobSecrets.java new file mode 100644 index 000000000000..e91d7bf621a0 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DataboxJobSecrets.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The secrets related to a DataBox job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobSecretsType") +@JsonTypeName("DataBox") +public class DataboxJobSecrets extends JobSecrets { + /** + * Contains the list of secret objects for a job. + */ + @JsonProperty(value = "podSecrets") + private List podSecrets; + + /** + * Get contains the list of secret objects for a job. + * + * @return the podSecrets value + */ + public List podSecrets() { + return this.podSecrets; + } + + /** + * Set contains the list of secret objects for a job. + * + * @param podSecrets the podSecrets value to set + * @return the DataboxJobSecrets object itself. + */ + public DataboxJobSecrets withPodSecrets(List podSecrets) { + this.podSecrets = podSecrets; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationAccountDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationAccountDetails.java new file mode 100644 index 000000000000..735290e43034 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationAccountDetails.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Details of the destination of the data. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataDestinationType") +@JsonTypeName("DestinationAccountDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ManagedDisk", value = DestinationManagedDiskDetails.class), + @JsonSubTypes.Type(name = "StorageAccount", value = DestinationStorageAccountDetails.class) +}) +public class DestinationAccountDetails { + /** + * Arm Id of the destination where the data has to be moved. + */ + @JsonProperty(value = "accountId") + private String accountId; + + /** + * Get arm Id of the destination where the data has to be moved. + * + * @return the accountId value + */ + public String accountId() { + return this.accountId; + } + + /** + * Set arm Id of the destination where the data has to be moved. + * + * @param accountId the accountId value to set + * @return the DestinationAccountDetails object itself. + */ + public DestinationAccountDetails withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationManagedDiskDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationManagedDiskDetails.java new file mode 100644 index 000000000000..159b2b34649e --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationManagedDiskDetails.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Details for the destination compute disks. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataDestinationType") +@JsonTypeName("ManagedDisk") +public class DestinationManagedDiskDetails extends DestinationAccountDetails { + /** + * Destination Resource Group Id where the Compute disks should be created. + */ + @JsonProperty(value = "resourceGroupId", required = true) + private String resourceGroupId; + + /** + * Arm Id of the storage account that can be used to copy the vhd for + * staging. + */ + @JsonProperty(value = "stagingStorageAccountId", required = true) + private String stagingStorageAccountId; + + /** + * Get destination Resource Group Id where the Compute disks should be created. + * + * @return the resourceGroupId value + */ + public String resourceGroupId() { + return this.resourceGroupId; + } + + /** + * Set destination Resource Group Id where the Compute disks should be created. + * + * @param resourceGroupId the resourceGroupId value to set + * @return the DestinationManagedDiskDetails object itself. + */ + public DestinationManagedDiskDetails withResourceGroupId(String resourceGroupId) { + this.resourceGroupId = resourceGroupId; + return this; + } + + /** + * Get arm Id of the storage account that can be used to copy the vhd for staging. + * + * @return the stagingStorageAccountId value + */ + public String stagingStorageAccountId() { + return this.stagingStorageAccountId; + } + + /** + * Set arm Id of the storage account that can be used to copy the vhd for staging. + * + * @param stagingStorageAccountId the stagingStorageAccountId value to set + * @return the DestinationManagedDiskDetails object itself. + */ + public DestinationManagedDiskDetails withStagingStorageAccountId(String stagingStorageAccountId) { + this.stagingStorageAccountId = stagingStorageAccountId; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationStorageAccountDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationStorageAccountDetails.java new file mode 100644 index 000000000000..c632b30fa713 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationStorageAccountDetails.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Details for the destination storage account. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dataDestinationType") +@JsonTypeName("StorageAccount") +public class DestinationStorageAccountDetails extends DestinationAccountDetails { + /** + * Destination Storage Account Arm Id. + */ + @JsonProperty(value = "storageAccountId", required = true) + private String storageAccountId; + + /** + * Get destination Storage Account Arm Id. + * + * @return the storageAccountId value + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set destination Storage Account Arm Id. + * + * @param storageAccountId the storageAccountId value to set + * @return the DestinationStorageAccountDetails object itself. + */ + public DestinationStorageAccountDetails withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationToServiceLocationMap.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationToServiceLocationMap.java new file mode 100644 index 000000000000..54020d2f0b31 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DestinationToServiceLocationMap.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Map of destination location to service location. + */ +public class DestinationToServiceLocationMap { + /** + * Location of the destination. + */ + @JsonProperty(value = "destinationLocation", access = JsonProperty.Access.WRITE_ONLY) + private String destinationLocation; + + /** + * Location of the service. + */ + @JsonProperty(value = "serviceLocation", access = JsonProperty.Access.WRITE_ONLY) + private String serviceLocation; + + /** + * Get location of the destination. + * + * @return the destinationLocation value + */ + public String destinationLocation() { + return this.destinationLocation; + } + + /** + * Get location of the service. + * + * @return the serviceLocation value + */ + public String serviceLocation() { + return this.serviceLocation; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DiskSecret.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DiskSecret.java new file mode 100644 index 000000000000..d9592abd9c70 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/DiskSecret.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains all the secrets of a Disk. + */ +public class DiskSecret { + /** + * Serial number of the assigned disk. + */ + @JsonProperty(value = "diskSerialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String diskSerialNumber; + + /** + * Bit Locker key of the disk which can be used to unlock the disk to copy + * data. + */ + @JsonProperty(value = "bitLockerKey", access = JsonProperty.Access.WRITE_ONLY) + private String bitLockerKey; + + /** + * Get serial number of the assigned disk. + * + * @return the diskSerialNumber value + */ + public String diskSerialNumber() { + return this.diskSerialNumber; + } + + /** + * Get bit Locker key of the disk which can be used to unlock the disk to copy data. + * + * @return the bitLockerKey value + */ + public String bitLockerKey() { + return this.bitLockerKey; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Error.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Error.java new file mode 100644 index 000000000000..0009fe9ef7af --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Error.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Top level error for the job. + */ +public class Error { + /** + * Error code that can be used to programmatically identify the error. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Describes the error in detail and provides debugging information. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get error code that can be used to programmatically identify the error. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get describes the error in detail and provides debugging information. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobDetails.java new file mode 100644 index 000000000000..1853f2a5ac3b --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobDetails.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Job details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobDetailsType") +@JsonTypeName("JobDetails") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DataBoxDisk", value = DataBoxDiskJobDetails.class), + @JsonSubTypes.Type(name = "DataBoxHeavy", value = DataBoxHeavyJobDetails.class), + @JsonSubTypes.Type(name = "DataBox", value = DataBoxJobDetails.class) +}) +public class JobDetails { + /** + * The expected size of the data, which needs to be transferred in this + * job, in terabytes. + */ + @JsonProperty(value = "expectedDataSizeInTeraBytes") + private Integer expectedDataSizeInTeraBytes; + + /** + * List of stages that run in the job. + */ + @JsonProperty(value = "jobStages", access = JsonProperty.Access.WRITE_ONLY) + private List jobStages; + + /** + * Contact details for notification and shipping. + */ + @JsonProperty(value = "contactDetails", required = true) + private ContactDetails contactDetails; + + /** + * Shipping address of the customer. + */ + @JsonProperty(value = "shippingAddress", required = true) + private ShippingAddress shippingAddress; + + /** + * Delivery package shipping details. + */ + @JsonProperty(value = "deliveryPackage", access = JsonProperty.Access.WRITE_ONLY) + private PackageShippingDetails deliveryPackage; + + /** + * Return package shipping details. + */ + @JsonProperty(value = "returnPackage", access = JsonProperty.Access.WRITE_ONLY) + private PackageShippingDetails returnPackage; + + /** + * Destination account details. + */ + @JsonProperty(value = "destinationAccountDetails", required = true) + private List destinationAccountDetails; + + /** + * Error details for failure. This is optional. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** + * Preferences for the order. + */ + @JsonProperty(value = "preferences") + private Preferences preferences; + + /** + * List of copy log details. + */ + @JsonProperty(value = "copyLogDetails", access = JsonProperty.Access.WRITE_ONLY) + private List copyLogDetails; + + /** + * Shared access key to download the return shipment label. + */ + @JsonProperty(value = "reverseShipmentLabelSasKey", access = JsonProperty.Access.WRITE_ONLY) + private String reverseShipmentLabelSasKey; + + /** + * Shared access key to download the chain of custody logs. + */ + @JsonProperty(value = "chainOfCustodySasKey", access = JsonProperty.Access.WRITE_ONLY) + private String chainOfCustodySasKey; + + /** + * Get the expected size of the data, which needs to be transferred in this job, in terabytes. + * + * @return the expectedDataSizeInTeraBytes value + */ + public Integer expectedDataSizeInTeraBytes() { + return this.expectedDataSizeInTeraBytes; + } + + /** + * Set the expected size of the data, which needs to be transferred in this job, in terabytes. + * + * @param expectedDataSizeInTeraBytes the expectedDataSizeInTeraBytes value to set + * @return the JobDetails object itself. + */ + public JobDetails withExpectedDataSizeInTeraBytes(Integer expectedDataSizeInTeraBytes) { + this.expectedDataSizeInTeraBytes = expectedDataSizeInTeraBytes; + return this; + } + + /** + * Get list of stages that run in the job. + * + * @return the jobStages value + */ + public List jobStages() { + return this.jobStages; + } + + /** + * Get contact details for notification and shipping. + * + * @return the contactDetails value + */ + public ContactDetails contactDetails() { + return this.contactDetails; + } + + /** + * Set contact details for notification and shipping. + * + * @param contactDetails the contactDetails value to set + * @return the JobDetails object itself. + */ + public JobDetails withContactDetails(ContactDetails contactDetails) { + this.contactDetails = contactDetails; + return this; + } + + /** + * Get shipping address of the customer. + * + * @return the shippingAddress value + */ + public ShippingAddress shippingAddress() { + return this.shippingAddress; + } + + /** + * Set shipping address of the customer. + * + * @param shippingAddress the shippingAddress value to set + * @return the JobDetails object itself. + */ + public JobDetails withShippingAddress(ShippingAddress shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Get delivery package shipping details. + * + * @return the deliveryPackage value + */ + public PackageShippingDetails deliveryPackage() { + return this.deliveryPackage; + } + + /** + * Get return package shipping details. + * + * @return the returnPackage value + */ + public PackageShippingDetails returnPackage() { + return this.returnPackage; + } + + /** + * Get destination account details. + * + * @return the destinationAccountDetails value + */ + public List destinationAccountDetails() { + return this.destinationAccountDetails; + } + + /** + * Set destination account details. + * + * @param destinationAccountDetails the destinationAccountDetails value to set + * @return the JobDetails object itself. + */ + public JobDetails withDestinationAccountDetails(List destinationAccountDetails) { + this.destinationAccountDetails = destinationAccountDetails; + return this; + } + + /** + * Get error details for failure. This is optional. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get preferences for the order. + * + * @return the preferences value + */ + public Preferences preferences() { + return this.preferences; + } + + /** + * Set preferences for the order. + * + * @param preferences the preferences value to set + * @return the JobDetails object itself. + */ + public JobDetails withPreferences(Preferences preferences) { + this.preferences = preferences; + return this; + } + + /** + * Get list of copy log details. + * + * @return the copyLogDetails value + */ + public List copyLogDetails() { + return this.copyLogDetails; + } + + /** + * Get shared access key to download the return shipment label. + * + * @return the reverseShipmentLabelSasKey value + */ + public String reverseShipmentLabelSasKey() { + return this.reverseShipmentLabelSasKey; + } + + /** + * Get shared access key to download the chain of custody logs. + * + * @return the chainOfCustodySasKey value + */ + public String chainOfCustodySasKey() { + return this.chainOfCustodySasKey; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobErrorDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobErrorDetails.java new file mode 100644 index 000000000000..305d78f54f71 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobErrorDetails.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Job Error Details for providing the information and recommended action. + */ +public class JobErrorDetails { + /** + * Message for the error. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /** + * Code for the error. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /** + * Recommended action for the error. + */ + @JsonProperty(value = "recommendedAction", access = JsonProperty.Access.WRITE_ONLY) + private String recommendedAction; + + /** + * Contains the non localized exception message. + */ + @JsonProperty(value = "exceptionMessage", access = JsonProperty.Access.WRITE_ONLY) + private String exceptionMessage; + + /** + * Get message for the error. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get code for the error. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get recommended action for the error. + * + * @return the recommendedAction value + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Get contains the non localized exception message. + * + * @return the exceptionMessage value + */ + public String exceptionMessage() { + return this.exceptionMessage; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobResource.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobResource.java new file mode 100644 index 000000000000..bab71f942690 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobResource.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +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.databox.implementation.DataBoxManager; +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.databox.implementation.JobResourceInner; + +/** + * Type representing JobResource. + */ +public interface JobResource extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the cancellationReason value. + */ + String cancellationReason(); + + /** + * @return the details value. + */ + JobDetails details(); + + /** + * @return the error value. + */ + Error error(); + + /** + * @return the isCancellable value. + */ + Boolean isCancellable(); + + /** + * @return the isDeletable value. + */ + Boolean isDeletable(); + + /** + * @return the isShippingAddressEditable value. + */ + Boolean isShippingAddressEditable(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + StageName status(); + + /** + * The entirety of the JobResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of JobResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a JobResource definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the JobResource definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the jobresource definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku type + * @return the next definition stage +*/ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the jobresource definition allowing to specify Details. + */ + interface WithDetails { + /** + * Specifies details. + * @param details Details of a job run. This field will only be sent for expand details filter + * @return the next definition stage + */ + WithCreate withDetails(JobDetails details); + } + + /** + * 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.WithDetails { + } + } + /** + * The template for a JobResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIfMatch, UpdateStages.WithDestinationAccountDetails, UpdateStages.WithDetails { + } + + /** + * Grouping of JobResource update stages. + */ + interface UpdateStages { + /** + * The stage of the jobresource update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the jobresource update allowing to specify DestinationAccountDetails. + */ + interface WithDestinationAccountDetails { + /** + * Specifies destinationAccountDetails. + * @param destinationAccountDetails Destination account details + * @return the next update stage + */ + Update withDestinationAccountDetails(List destinationAccountDetails); + } + + /** + * The stage of the jobresource update allowing to specify Details. + */ + interface WithDetails { + /** + * Specifies details. + * @param details Details of a job to be updated + * @return the next update stage + */ + Update withDetails(UpdateJobDetails details); + } + + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobResourceUpdateParameter.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobResourceUpdateParameter.java new file mode 100644 index 000000000000..aeeadc140a4e --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobResourceUpdateParameter.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The JobResourceUpdateParameter. + */ +@JsonFlatten +public class JobResourceUpdateParameter { + /** + * Details of a job to be updated. + */ + @JsonProperty(value = "properties.details") + private UpdateJobDetails details; + + /** + * Destination account details. + */ + @JsonProperty(value = "properties.destinationAccountDetails") + private List destinationAccountDetails; + + /** + * The list of key value pairs that describe the resource. These tags can + * be used in viewing and grouping this resource (across resource groups). + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get details of a job to be updated. + * + * @return the details value + */ + public UpdateJobDetails details() { + return this.details; + } + + /** + * Set details of a job to be updated. + * + * @param details the details value to set + * @return the JobResourceUpdateParameter object itself. + */ + public JobResourceUpdateParameter withDetails(UpdateJobDetails details) { + this.details = details; + return this; + } + + /** + * Get destination account details. + * + * @return the destinationAccountDetails value + */ + public List destinationAccountDetails() { + return this.destinationAccountDetails; + } + + /** + * Set destination account details. + * + * @param destinationAccountDetails the destinationAccountDetails value to set + * @return the JobResourceUpdateParameter object itself. + */ + public JobResourceUpdateParameter withDestinationAccountDetails(List destinationAccountDetails) { + this.destinationAccountDetails = destinationAccountDetails; + return this; + } + + /** + * Get the list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). + * + * @param tags the tags value to set + * @return the JobResourceUpdateParameter object itself. + */ + public JobResourceUpdateParameter withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobSecrets.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobSecrets.java new file mode 100644 index 000000000000..37cfa126f99e --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobSecrets.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for the secrets. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobSecretsType") +@JsonTypeName("JobSecrets") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DataBoxDisk", value = DataBoxDiskJobSecrets.class), + @JsonSubTypes.Type(name = "DataBoxHeavy", value = DataBoxHeavyJobSecrets.class), + @JsonSubTypes.Type(name = "DataBox", value = DataboxJobSecrets.class) +}) +public class JobSecrets { +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobStages.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobStages.java new file mode 100644 index 000000000000..9589c531da4a --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/JobStages.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Job stages. + */ +public class JobStages { + /** + * Name of the job stage. Possible values include: 'DeviceOrdered', + * 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', + * 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', + * 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', + * 'Aborted'. + */ + @JsonProperty(value = "stageName", access = JsonProperty.Access.WRITE_ONLY) + private StageName stageName; + + /** + * Display name of the job stage. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Status of the job stage. Possible values include: 'None', 'InProgress', + * 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', 'SucceededWithErrors'. + */ + @JsonProperty(value = "stageStatus", access = JsonProperty.Access.WRITE_ONLY) + private StageStatus stageStatus; + + /** + * Time for the job stage in UTC ISO 8601 format. + */ + @JsonProperty(value = "stageTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime stageTime; + + /** + * Job Stage Details. + */ + @JsonProperty(value = "jobStageDetails", access = JsonProperty.Access.WRITE_ONLY) + private Object jobStageDetails; + + /** + * Error details for the stage. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** + * Get name of the job stage. Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted'. + * + * @return the stageName value + */ + public StageName stageName() { + return this.stageName; + } + + /** + * Get display name of the job stage. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Get status of the job stage. Possible values include: 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', 'SucceededWithErrors'. + * + * @return the stageStatus value + */ + public StageStatus stageStatus() { + return this.stageStatus; + } + + /** + * Get time for the job stage in UTC ISO 8601 format. + * + * @return the stageTime value + */ + public DateTime stageTime() { + return this.stageTime; + } + + /** + * Get job Stage Details. + * + * @return the jobStageDetails value + */ + public Object jobStageDetails() { + return this.jobStageDetails; + } + + /** + * Get error details for the stage. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Jobs.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Jobs.java new file mode 100644 index 000000000000..455b67459abb --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Jobs.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.databox.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Jobs. + */ +public interface Jobs extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Book shipment pick up. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param shipmentPickUpRequest Details of shipment pick up request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable bookShipmentPickUpAsync(String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest); + + /** + * CancelJob. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param reason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelAsync(String resourceGroupName, String jobName, String reason); + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCredentialsAsync(String resourceGroupName, String jobName); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/NotificationPreference.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/NotificationPreference.java new file mode 100644 index 000000000000..f791de498870 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/NotificationPreference.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Notification preference for a job stage. + */ +public class NotificationPreference { + /** + * Name of the stage. Possible values include: 'DevicePrepared', + * 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy'. + */ + @JsonProperty(value = "stageName", required = true) + private NotificationStageName stageName; + + /** + * Notification is required or not. + */ + @JsonProperty(value = "sendNotification", required = true) + private boolean sendNotification; + + /** + * Get name of the stage. Possible values include: 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy'. + * + * @return the stageName value + */ + public NotificationStageName stageName() { + return this.stageName; + } + + /** + * Set name of the stage. Possible values include: 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy'. + * + * @param stageName the stageName value to set + * @return the NotificationPreference object itself. + */ + public NotificationPreference withStageName(NotificationStageName stageName) { + this.stageName = stageName; + return this; + } + + /** + * Get notification is required or not. + * + * @return the sendNotification value + */ + public boolean sendNotification() { + return this.sendNotification; + } + + /** + * Set notification is required or not. + * + * @param sendNotification the sendNotification value to set + * @return the NotificationPreference object itself. + */ + public NotificationPreference withSendNotification(boolean sendNotification) { + this.sendNotification = sendNotification; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/NotificationStageName.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/NotificationStageName.java new file mode 100644 index 000000000000..4067ab72e3f9 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/NotificationStageName.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NotificationStageName. + */ +public enum NotificationStageName { + /** Notification at device prepared stage. */ + DEVICE_PREPARED("DevicePrepared"), + + /** Notification at device dispatched stage. */ + DISPATCHED("Dispatched"), + + /** Notification at device delivered stage. */ + DELIVERED("Delivered"), + + /** Notification at device picked up from user stage. */ + PICKED_UP("PickedUp"), + + /** Notification at device received at azure datacenter stage. */ + AT_AZURE_DC("AtAzureDC"), + + /** Notification at data copy started stage. */ + DATA_COPY("DataCopy"); + + /** The actual serialized value for a NotificationStageName instance. */ + private String value; + + NotificationStageName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NotificationStageName instance. + * + * @param value the serialized value to parse. + * @return the parsed NotificationStageName object, or null if unable to parse. + */ + @JsonCreator + public static NotificationStageName fromString(String value) { + NotificationStageName[] items = NotificationStageName.values(); + for (NotificationStageName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Operation.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Operation.java new file mode 100644 index 000000000000..16da7ba34ae1 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Operation.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databox.implementation.DataBoxManager; +import com.microsoft.azure.management.databox.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + Object properties(); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/OperationDisplay.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/OperationDisplay.java new file mode 100644 index 000000000000..a272b0b49e83 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/OperationDisplay.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation display. + */ +public class OperationDisplay { + /** + * Provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource name. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Localized name of the operation for display purpose. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Localized description of the operation for display purpose. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider name. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource name. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource name. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get localized name of the operation for display purpose. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set localized name of the operation for display purpose. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get localized description of the operation for display purpose. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set localized description of the operation for display purpose. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Operations.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Operations.java new file mode 100644 index 000000000000..af72e5ec2c40 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/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.databox; + +import rx.Observable; +import com.microsoft.azure.management.databox.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/PackageShippingDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/PackageShippingDetails.java new file mode 100644 index 000000000000..dd4b11a5b038 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/PackageShippingDetails.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shipping details. + */ +public class PackageShippingDetails { + /** + * Name of the carrier. + */ + @JsonProperty(value = "carrierName", access = JsonProperty.Access.WRITE_ONLY) + private String carrierName; + + /** + * Tracking Id of shipment. + */ + @JsonProperty(value = "trackingId", access = JsonProperty.Access.WRITE_ONLY) + private String trackingId; + + /** + * Url where shipment can be tracked. + */ + @JsonProperty(value = "trackingUrl", access = JsonProperty.Access.WRITE_ONLY) + private String trackingUrl; + + /** + * Get name of the carrier. + * + * @return the carrierName value + */ + public String carrierName() { + return this.carrierName; + } + + /** + * Get tracking Id of shipment. + * + * @return the trackingId value + */ + public String trackingId() { + return this.trackingId; + } + + /** + * Get url where shipment can be tracked. + * + * @return the trackingUrl value + */ + public String trackingUrl() { + return this.trackingUrl; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Preferences.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Preferences.java new file mode 100644 index 000000000000..efdc56440710 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Preferences.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.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Preferences related to the order. + */ +public class Preferences { + /** + * The preferredDataCenterRegion property. + */ + @JsonProperty(value = "preferredDataCenterRegion") + private List preferredDataCenterRegion; + + /** + * Get the preferredDataCenterRegion value. + * + * @return the preferredDataCenterRegion value + */ + public List preferredDataCenterRegion() { + return this.preferredDataCenterRegion; + } + + /** + * Set the preferredDataCenterRegion value. + * + * @param preferredDataCenterRegion the preferredDataCenterRegion value to set + * @return the Preferences object itself. + */ + public Preferences withPreferredDataCenterRegion(List preferredDataCenterRegion) { + this.preferredDataCenterRegion = preferredDataCenterRegion; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Services.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Services.java new file mode 100644 index 000000000000..80969d83f9dd --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Services.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import rx.Observable; +import com.microsoft.azure.management.databox.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Services. + */ +public interface Services extends HasInner { + /** + * This method provides the list of available skus for the given subscription and location. + * + * @param location The location of the resource + * @param availableSkuRequest Filters for showing the available skus. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAvailableSkusAsync(final String location, final AvailableSkuRequest availableSkuRequest); + + /** + * This method validates the customer shipping address and provide alternate addresses if any. + * + * @param location The location of the resource + * @param validateAddress Shipping address of the customer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable validateAddressMethodAsync(String location, ValidateAddress validateAddress); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShareCredentialDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShareCredentialDetails.java new file mode 100644 index 000000000000..1977b5386c6b --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShareCredentialDetails.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Credential details of the shares in account. + */ +public class ShareCredentialDetails { + /** + * Name of the share. + */ + @JsonProperty(value = "shareName", access = JsonProperty.Access.WRITE_ONLY) + private String shareName; + + /** + * Type of the share. Possible values include: 'UnknownType', 'HCS', + * 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk'. + */ + @JsonProperty(value = "shareType", access = JsonProperty.Access.WRITE_ONLY) + private ShareDestinationFormatType shareType; + + /** + * User name for the share. + */ + @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) + private String userName; + + /** + * Password for the share. + */ + @JsonProperty(value = "password", access = JsonProperty.Access.WRITE_ONLY) + private String password; + + /** + * Access protocols supported on the device. + */ + @JsonProperty(value = "supportedAccessProtocols", access = JsonProperty.Access.WRITE_ONLY) + private List supportedAccessProtocols; + + /** + * Get name of the share. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Get type of the share. Possible values include: 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk'. + * + * @return the shareType value + */ + public ShareDestinationFormatType shareType() { + return this.shareType; + } + + /** + * Get user name for the share. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Get password for the share. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Get access protocols supported on the device. + * + * @return the supportedAccessProtocols value + */ + public List supportedAccessProtocols() { + return this.supportedAccessProtocols; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShareDestinationFormatType.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShareDestinationFormatType.java new file mode 100644 index 000000000000..fa718410c5f9 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShareDestinationFormatType.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ShareDestinationFormatType. + */ +public enum ShareDestinationFormatType { + /** Unknown format. */ + UNKNOWN_TYPE("UnknownType"), + + /** StorSimple data format. */ + HCS("HCS"), + + /** Azure storage block blob format. */ + BLOCK_BLOB("BlockBlob"), + + /** Azure storage page blob format. */ + PAGE_BLOB("PageBlob"), + + /** Azure storage file format. */ + AZURE_FILE("AzureFile"), + + /** Azure Compute Disk. */ + MANAGED_DISK("ManagedDisk"); + + /** The actual serialized value for a ShareDestinationFormatType instance. */ + private String value; + + ShareDestinationFormatType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ShareDestinationFormatType instance. + * + * @param value the serialized value to parse. + * @return the parsed ShareDestinationFormatType object, or null if unable to parse. + */ + @JsonCreator + public static ShareDestinationFormatType fromString(String value) { + ShareDestinationFormatType[] items = ShareDestinationFormatType.values(); + for (ShareDestinationFormatType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShipmentPickUpRequest.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShipmentPickUpRequest.java new file mode 100644 index 000000000000..3b589e0bdb24 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShipmentPickUpRequest.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shipment pick up request details. + */ +public class ShipmentPickUpRequest { + /** + * Minimum date after which the pick up should commence, this must be in + * local time of pick up area. + */ + @JsonProperty(value = "startTime", required = true) + private DateTime startTime; + + /** + * Maximum date before which the pick up should commence, this must be in + * local time of pick up area. + */ + @JsonProperty(value = "endTime", required = true) + private DateTime endTime; + + /** + * Shipment Location in the pickup place. Eg.front desk. + */ + @JsonProperty(value = "shipmentLocation", required = true) + private String shipmentLocation; + + /** + * Get minimum date after which the pick up should commence, this must be in local time of pick up area. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set minimum date after which the pick up should commence, this must be in local time of pick up area. + * + * @param startTime the startTime value to set + * @return the ShipmentPickUpRequest object itself. + */ + public ShipmentPickUpRequest withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get maximum date before which the pick up should commence, this must be in local time of pick up area. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set maximum date before which the pick up should commence, this must be in local time of pick up area. + * + * @param endTime the endTime value to set + * @return the ShipmentPickUpRequest object itself. + */ + public ShipmentPickUpRequest withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get shipment Location in the pickup place. Eg.front desk. + * + * @return the shipmentLocation value + */ + public String shipmentLocation() { + return this.shipmentLocation; + } + + /** + * Set shipment Location in the pickup place. Eg.front desk. + * + * @param shipmentLocation the shipmentLocation value to set + * @return the ShipmentPickUpRequest object itself. + */ + public ShipmentPickUpRequest withShipmentLocation(String shipmentLocation) { + this.shipmentLocation = shipmentLocation; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShipmentPickUpResponse.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShipmentPickUpResponse.java new file mode 100644 index 000000000000..165865cb56e3 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShipmentPickUpResponse.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databox.implementation.DataBoxManager; +import com.microsoft.azure.management.databox.implementation.ShipmentPickUpResponseInner; +import org.joda.time.DateTime; + +/** + * Type representing ShipmentPickUpResponse. + */ +public interface ShipmentPickUpResponse extends HasInner, HasManager { + /** + * @return the confirmationNumber value. + */ + String confirmationNumber(); + + /** + * @return the readyByTime value. + */ + DateTime readyByTime(); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShippingAddress.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShippingAddress.java new file mode 100644 index 000000000000..0a620abdf792 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ShippingAddress.java @@ -0,0 +1,278 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shipping address where customer wishes to receive the device. + */ +public class ShippingAddress { + /** + * Street Address line 1. + */ + @JsonProperty(value = "streetAddress1", required = true) + private String streetAddress1; + + /** + * Street Address line 2. + */ + @JsonProperty(value = "streetAddress2") + private String streetAddress2; + + /** + * Street Address line 3. + */ + @JsonProperty(value = "streetAddress3") + private String streetAddress3; + + /** + * Name of the City. + */ + @JsonProperty(value = "city") + private String city; + + /** + * Name of the State or Province. + */ + @JsonProperty(value = "stateOrProvince") + private String stateOrProvince; + + /** + * Name of the Country. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * Postal code. + */ + @JsonProperty(value = "postalCode", required = true) + private String postalCode; + + /** + * Extended Zip Code. + */ + @JsonProperty(value = "zipExtendedCode") + private String zipExtendedCode; + + /** + * Name of the company. + */ + @JsonProperty(value = "companyName") + private String companyName; + + /** + * Type of address. Possible values include: 'None', 'Residential', + * 'Commercial'. + */ + @JsonProperty(value = "addressType") + private AddressType addressType; + + /** + * Get street Address line 1. + * + * @return the streetAddress1 value + */ + public String streetAddress1() { + return this.streetAddress1; + } + + /** + * Set street Address line 1. + * + * @param streetAddress1 the streetAddress1 value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withStreetAddress1(String streetAddress1) { + this.streetAddress1 = streetAddress1; + return this; + } + + /** + * Get street Address line 2. + * + * @return the streetAddress2 value + */ + public String streetAddress2() { + return this.streetAddress2; + } + + /** + * Set street Address line 2. + * + * @param streetAddress2 the streetAddress2 value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withStreetAddress2(String streetAddress2) { + this.streetAddress2 = streetAddress2; + return this; + } + + /** + * Get street Address line 3. + * + * @return the streetAddress3 value + */ + public String streetAddress3() { + return this.streetAddress3; + } + + /** + * Set street Address line 3. + * + * @param streetAddress3 the streetAddress3 value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withStreetAddress3(String streetAddress3) { + this.streetAddress3 = streetAddress3; + return this; + } + + /** + * Get name of the City. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set name of the City. + * + * @param city the city value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withCity(String city) { + this.city = city; + return this; + } + + /** + * Get name of the State or Province. + * + * @return the stateOrProvince value + */ + public String stateOrProvince() { + return this.stateOrProvince; + } + + /** + * Set name of the State or Province. + * + * @param stateOrProvince the stateOrProvince value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + return this; + } + + /** + * Get name of the Country. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set name of the Country. + * + * @param country the country value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get postal code. + * + * @return the postalCode value + */ + public String postalCode() { + return this.postalCode; + } + + /** + * Set postal code. + * + * @param postalCode the postalCode value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get extended Zip Code. + * + * @return the zipExtendedCode value + */ + public String zipExtendedCode() { + return this.zipExtendedCode; + } + + /** + * Set extended Zip Code. + * + * @param zipExtendedCode the zipExtendedCode value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withZipExtendedCode(String zipExtendedCode) { + this.zipExtendedCode = zipExtendedCode; + return this; + } + + /** + * Get name of the company. + * + * @return the companyName value + */ + public String companyName() { + return this.companyName; + } + + /** + * Set name of the company. + * + * @param companyName the companyName value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withCompanyName(String companyName) { + this.companyName = companyName; + return this; + } + + /** + * Get type of address. Possible values include: 'None', 'Residential', 'Commercial'. + * + * @return the addressType value + */ + public AddressType addressType() { + return this.addressType; + } + + /** + * Set type of address. Possible values include: 'None', 'Residential', 'Commercial'. + * + * @param addressType the addressType value to set + * @return the ShippingAddress object itself. + */ + public ShippingAddress withAddressType(AddressType addressType) { + this.addressType = addressType; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Sku.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Sku.java new file mode 100644 index 000000000000..915e07540f89 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/Sku.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Sku. + */ +public class Sku { + /** + * The sku name. Possible values include: 'DataBox', 'DataBoxDisk', + * 'DataBoxHeavy'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The display name of the sku. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The sku family. + */ + @JsonProperty(value = "family") + private String family; + + /** + * Get the sku name. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the sku name. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the display name of the sku. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the sku. + * + * @param displayName the displayName value to set + * @return the Sku object itself. + */ + public Sku withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the sku family. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set the sku family. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuCapacity.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuCapacity.java new file mode 100644 index 000000000000..b30894ff6cb3 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuCapacity.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Capacity of the sku. + */ +public class SkuCapacity { + /** + * Usable capacity in TB. + */ + @JsonProperty(value = "usable", access = JsonProperty.Access.WRITE_ONLY) + private String usable; + + /** + * Maximum capacity in TB. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private String maximum; + + /** + * Get usable capacity in TB. + * + * @return the usable value + */ + public String usable() { + return this.usable; + } + + /** + * Get maximum capacity in TB. + * + * @return the maximum value + */ + public String maximum() { + return this.maximum; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuCost.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuCost.java new file mode 100644 index 000000000000..6fef2c5fb9d2 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuCost.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes metadata for retrieving price info. + */ +public class SkuCost { + /** + * Meter id of the Sku. + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /** + * The type of the meter. + */ + @JsonProperty(value = "meterType", access = JsonProperty.Access.WRITE_ONLY) + private String meterType; + + /** + * Get meter id of the Sku. + * + * @return the meterId value + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the type of the meter. + * + * @return the meterType value + */ + public String meterType() { + return this.meterType; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuDisabledReason.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuDisabledReason.java new file mode 100644 index 000000000000..274597d67b28 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuDisabledReason.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuDisabledReason. + */ +public enum SkuDisabledReason { + /** SKU is not disabled. */ + NONE("None"), + + /** SKU is not available in the requested country. */ + COUNTRY("Country"), + + /** SKU is not available to push data to the requested Azure region. */ + REGION("Region"), + + /** Required features are not enabled for the SKU. */ + FEATURE("Feature"), + + /** Subscription does not have required offer types for the SKU. */ + OFFER_TYPE("OfferType"), + + /** Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification. */ + NO_SUBSCRIPTION_INFO("NoSubscriptionInfo"); + + /** The actual serialized value for a SkuDisabledReason instance. */ + private String value; + + SkuDisabledReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuDisabledReason instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuDisabledReason object, or null if unable to parse. + */ + @JsonCreator + public static SkuDisabledReason fromString(String value) { + SkuDisabledReason[] items = SkuDisabledReason.values(); + for (SkuDisabledReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuInformation.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuInformation.java new file mode 100644 index 000000000000..cffa8c24ca88 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuInformation.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databox.implementation.DataBoxManager; +import com.microsoft.azure.management.databox.implementation.SkuInformationInner; +import java.util.List; + +/** + * Type representing SkuInformation. + */ +public interface SkuInformation extends HasInner, HasManager { + /** + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * @return the capacity value. + */ + SkuCapacity capacity(); + + /** + * @return the costs value. + */ + List costs(); + + /** + * @return the destinationToServiceLocationMap value. + */ + List destinationToServiceLocationMap(); + + /** + * @return the disabledReason value. + */ + SkuDisabledReason disabledReason(); + + /** + * @return the disabledReasonMessage value. + */ + String disabledReasonMessage(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the requiredFeature value. + */ + String requiredFeature(); + + /** + * @return the sku value. + */ + Sku sku(); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuName.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuName.java new file mode 100644 index 000000000000..bafc42e024a9 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/SkuName.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.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuName. + */ +public enum SkuName { + /** DataBox. */ + DATA_BOX("DataBox"), + + /** DataBoxDisk. */ + DATA_BOX_DISK("DataBoxDisk"), + + /** DataBoxHeavy. */ + DATA_BOX_HEAVY("DataBoxHeavy"); + + /** The actual serialized value for a SkuName instance. */ + private String value; + + SkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuName object, or null if unable to parse. + */ + @JsonCreator + public static SkuName fromString(String value) { + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/StageName.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/StageName.java new file mode 100644 index 000000000000..216721050894 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/StageName.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StageName. + */ +public enum StageName { + /** An order has been created. */ + DEVICE_ORDERED("DeviceOrdered"), + + /** A device has been prepared for the order. */ + DEVICE_PREPARED("DevicePrepared"), + + /** Device has been dispatched to the user of the order. */ + DISPATCHED("Dispatched"), + + /** Device has been delivered to the user of the order. */ + DELIVERED("Delivered"), + + /** Device has been picked up from user and in transit to azure datacenter. */ + PICKED_UP("PickedUp"), + + /** Device has been received at azure datacenter from the user. */ + AT_AZURE_DC("AtAzureDC"), + + /** Data copy from the device at azure datacenter. */ + DATA_COPY("DataCopy"), + + /** Order has completed. */ + COMPLETED("Completed"), + + /** Order has completed with errors. */ + COMPLETED_WITH_ERRORS("CompletedWithErrors"), + + /** Order has been cancelled. */ + CANCELLED("Cancelled"), + + /** Order has failed due to issue reported by user. */ + FAILED_ISSUE_REPORTED_AT_CUSTOMER("Failed_IssueReportedAtCustomer"), + + /** Order has failed due to issue detected at azure datacenter. */ + FAILED_ISSUE_DETECTED_AT_AZURE_DC("Failed_IssueDetectedAtAzureDC"), + + /** Order has been aborted. */ + ABORTED("Aborted"); + + /** The actual serialized value for a StageName instance. */ + private String value; + + StageName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StageName instance. + * + * @param value the serialized value to parse. + * @return the parsed StageName object, or null if unable to parse. + */ + @JsonCreator + public static StageName fromString(String value) { + StageName[] items = StageName.values(); + for (StageName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/StageStatus.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/StageStatus.java new file mode 100644 index 000000000000..7d85a0045c04 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/StageStatus.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StageStatus. + */ +public enum StageStatus { + /** No status available yet. */ + NONE("None"), + + /** Stage is in progress. */ + IN_PROGRESS("InProgress"), + + /** Stage has succeeded. */ + SUCCEEDED("Succeeded"), + + /** Stage has failed. */ + FAILED("Failed"), + + /** Stage has been cancelled. */ + CANCELLED("Cancelled"), + + /** Stage is cancelling. */ + CANCELLING("Cancelling"), + + /** Stage has succeeded with errors. */ + SUCCEEDED_WITH_ERRORS("SucceededWithErrors"); + + /** The actual serialized value for a StageStatus instance. */ + private String value; + + StageStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StageStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed StageStatus object, or null if unable to parse. + */ + @JsonCreator + public static StageStatus fromString(String value) { + StageStatus[] items = StageStatus.values(); + for (StageStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/UnencryptedCredentials.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/UnencryptedCredentials.java new file mode 100644 index 000000000000..28d135cc743f --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/UnencryptedCredentials.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databox.implementation.DataBoxManager; +import com.microsoft.azure.management.databox.implementation.UnencryptedCredentialsInner; + +/** + * Type representing UnencryptedCredentials. + */ +public interface UnencryptedCredentials extends HasInner, HasManager { + /** + * @return the jobName value. + */ + String jobName(); + + /** + * @return the jobSecrets value. + */ + JobSecrets jobSecrets(); + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/UpdateJobDetails.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/UpdateJobDetails.java new file mode 100644 index 000000000000..149660095d19 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/UpdateJobDetails.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.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Job details for update. + */ +public class UpdateJobDetails { + /** + * Contact details for notification and shipping. + */ + @JsonProperty(value = "contactDetails") + private ContactDetails contactDetails; + + /** + * Shipping address of the customer. + */ + @JsonProperty(value = "shippingAddress") + private ShippingAddress shippingAddress; + + /** + * Get contact details for notification and shipping. + * + * @return the contactDetails value + */ + public ContactDetails contactDetails() { + return this.contactDetails; + } + + /** + * Set contact details for notification and shipping. + * + * @param contactDetails the contactDetails value to set + * @return the UpdateJobDetails object itself. + */ + public UpdateJobDetails withContactDetails(ContactDetails contactDetails) { + this.contactDetails = contactDetails; + return this; + } + + /** + * Get shipping address of the customer. + * + * @return the shippingAddress value + */ + public ShippingAddress shippingAddress() { + return this.shippingAddress; + } + + /** + * Set shipping address of the customer. + * + * @param shippingAddress the shippingAddress value to set + * @return the UpdateJobDetails object itself. + */ + public UpdateJobDetails withShippingAddress(ShippingAddress shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ValidateAddress.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ValidateAddress.java new file mode 100644 index 000000000000..1e6ecd9537e8 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/ValidateAddress.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The requirements to validate customer address where the device needs to be + * shipped. + */ +public class ValidateAddress { + /** + * Shipping address of the customer. + */ + @JsonProperty(value = "shippingAddress", required = true) + private ShippingAddress shippingAddress; + + /** + * Device type to be used for the job. Possible values include: 'DataBox', + * 'DataBoxDisk', 'DataBoxHeavy'. + */ + @JsonProperty(value = "deviceType", required = true) + private SkuName deviceType; + + /** + * Get shipping address of the customer. + * + * @return the shippingAddress value + */ + public ShippingAddress shippingAddress() { + return this.shippingAddress; + } + + /** + * Set shipping address of the customer. + * + * @param shippingAddress the shippingAddress value to set + * @return the ValidateAddress object itself. + */ + public ValidateAddress withShippingAddress(ShippingAddress shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Get device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'. + * + * @return the deviceType value + */ + public SkuName deviceType() { + return this.deviceType; + } + + /** + * Set device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'. + * + * @param deviceType the deviceType value to set + * @return the ValidateAddress object itself. + */ + public ValidateAddress withDeviceType(SkuName deviceType) { + this.deviceType = deviceType; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/AddressValidationOutputImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/AddressValidationOutputImpl.java new file mode 100644 index 000000000000..2a51d9914dc0 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/AddressValidationOutputImpl.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.implementation; + +import com.microsoft.azure.management.databox.AddressValidationOutput; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.databox.ShippingAddress; +import com.microsoft.azure.management.databox.AddressValidationStatus; + +class AddressValidationOutputImpl extends WrapperImpl implements AddressValidationOutput { + private final DataBoxManager manager; + AddressValidationOutputImpl(AddressValidationOutputInner inner, DataBoxManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxManager manager() { + return this.manager; + } + + @Override + public List alternateAddresses() { + return this.inner().alternateAddresses(); + } + + @Override + public AddressValidationStatus validationStatus() { + return this.inner().validationStatus(); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/AddressValidationOutputInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/AddressValidationOutputInner.java new file mode 100644 index 000000000000..16e3bb47d164 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/AddressValidationOutputInner.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.databox.implementation; + +import com.microsoft.azure.management.databox.AddressValidationStatus; +import java.util.List; +import com.microsoft.azure.management.databox.ShippingAddress; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Output of the address validation api. + */ +@JsonFlatten +public class AddressValidationOutputInner { + /** + * The address validation status. Possible values include: 'Valid', + * 'Invalid', 'Ambiguous'. + */ + @JsonProperty(value = "properties.validationStatus", access = JsonProperty.Access.WRITE_ONLY) + private AddressValidationStatus validationStatus; + + /** + * List of alternate addresses. + */ + @JsonProperty(value = "properties.alternateAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List alternateAddresses; + + /** + * Get the address validation status. Possible values include: 'Valid', 'Invalid', 'Ambiguous'. + * + * @return the validationStatus value + */ + public AddressValidationStatus validationStatus() { + return this.validationStatus; + } + + /** + * Get list of alternate addresses. + * + * @return the alternateAddresses value + */ + public List alternateAddresses() { + return this.alternateAddresses; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/DataBoxManagementClientImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/DataBoxManagementClientImpl.java new file mode 100644 index 000000000000..574a8402e129 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/DataBoxManagementClientImpl.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.databox.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 DataBoxManagementClientImpl class. + */ +public class DataBoxManagementClientImpl 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. */ + private String apiVersion; + + /** + * Gets The API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The Subscription Id. */ + private String subscriptionId; + + /** + * Gets The Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataBoxManagementClientImpl 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 DataBoxManagementClientImpl 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 DataBoxManagementClientImpl 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 DataBoxManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The JobsInner object to access its operations. + */ + private JobsInner jobs; + + /** + * Gets the JobsInner object to access its operations. + * @return the JobsInner object. + */ + public JobsInner jobs() { + return this.jobs; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * Initializes an instance of DataBoxManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataBoxManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataBoxManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataBoxManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataBoxManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataBoxManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-01-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.services = new ServicesInner(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(), "DataBoxManagementClient", "2018-01-01-preview"); + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/DataBoxManager.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/DataBoxManager.java new file mode 100644 index 000000000000..a16dff159094 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/DataBoxManager.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.databox.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.databox.Operations; +import com.microsoft.azure.management.databox.Jobs; +import com.microsoft.azure.management.databox.Services; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataBox resource management. + */ +public final class DataBoxManager extends ManagerCore { + private Operations operations; + private Jobs jobs; + private Services services; + /** + * Get a Configurable instance that can be used to create DataBoxManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataBoxManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataBoxManager that exposes DataBox resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataBoxManager + */ + public static DataBoxManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataBoxManager(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 DataBoxManager that exposes DataBox resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataBoxManager + */ + public static DataBoxManager authenticate(RestClient restClient, String subscriptionId) { + return new DataBoxManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataBoxManager that exposes DataBox management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataBox management API entry points that work across subscriptions + */ + DataBoxManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Jobs. + */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(this); + } + return this.jobs; + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataBoxManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataBoxManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataBoxManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataBoxManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/IdParsingUtils.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..7e904287a0ea --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/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.databox.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/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobResourceImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobResourceImpl.java new file mode 100644 index 000000000000..7cf6db88b1b4 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobResourceImpl.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.databox.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.databox.JobResource; +import rx.Observable; +import com.microsoft.azure.management.databox.JobResourceUpdateParameter; +import java.util.List; +import com.microsoft.azure.management.databox.Sku; +import com.microsoft.azure.management.databox.StageName; +import org.joda.time.DateTime; +import com.microsoft.azure.management.databox.Error; +import com.microsoft.azure.management.databox.JobDetails; +import com.microsoft.azure.management.databox.DestinationAccountDetails; +import com.microsoft.azure.management.databox.UpdateJobDetails; +import rx.functions.Func1; + +class JobResourceImpl extends GroupableResourceCoreImpl implements JobResource, JobResource.Definition, JobResource.Update { + private String uifMatch; + private JobResourceUpdateParameter updateParameter; + JobResourceImpl(String name, JobResourceInner inner, DataBoxManager manager) { + super(name, inner, manager); + this.updateParameter = new JobResourceUpdateParameter(); + } + + @Override + public Observable createResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public JobResourceInner call(JobResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter, this.uifMatch) + .map(new Func1() { + @Override + public JobResourceInner call(JobResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new JobResourceUpdateParameter(); + } + + @Override + public String cancellationReason() { + return this.inner().cancellationReason(); + } + + @Override + public JobDetails details() { + return this.inner().details(); + } + + @Override + public Error error() { + return this.inner().error(); + } + + @Override + public Boolean isCancellable() { + return this.inner().isCancellable(); + } + + @Override + public Boolean isDeletable() { + return this.inner().isDeletable(); + } + + @Override + public Boolean isShippingAddressEditable() { + return this.inner().isShippingAddressEditable(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public StageName status() { + return this.inner().status(); + } + + @Override + public JobResourceImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public JobResourceImpl withDetails(JobDetails details) { + this.inner().withDetails(details); + return this; + } + + @Override + public JobResourceImpl withIfMatch(String ifMatch) { + this.uifMatch = ifMatch; + return this; + } + + @Override + public JobResourceImpl withDestinationAccountDetails(List destinationAccountDetails) { + this.updateParameter.withDestinationAccountDetails(destinationAccountDetails); + return this; + } + + @Override + public JobResourceImpl withDetails(UpdateJobDetails details) { + this.updateParameter.withDetails(details); + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobResourceInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobResourceInner.java new file mode 100644 index 000000000000..af5c40a8aa5c --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobResourceInner.java @@ -0,0 +1,232 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.implementation; + +import com.microsoft.azure.management.databox.StageName; +import org.joda.time.DateTime; +import com.microsoft.azure.management.databox.Error; +import com.microsoft.azure.management.databox.JobDetails; +import com.microsoft.azure.management.databox.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Job Resource. + */ +@JsonFlatten +public class JobResourceInner extends Resource { + /** + * Describes whether the job is cancellable or not. + */ + @JsonProperty(value = "properties.isCancellable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCancellable; + + /** + * Describes whether the job is deletable or not. + */ + @JsonProperty(value = "properties.isDeletable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDeletable; + + /** + * Describes whether the shipping address is editable or not. + */ + @JsonProperty(value = "properties.isShippingAddressEditable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isShippingAddressEditable; + + /** + * Name of the stage which is in progress. Possible values include: + * 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', + * 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', + * 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private StageName status; + + /** + * Time at which the job was started in UTC ISO 8601 format. + */ + @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * Top level error for the job. + */ + @JsonProperty(value = "properties.error", access = JsonProperty.Access.WRITE_ONLY) + private Error error; + + /** + * Details of a job run. This field will only be sent for expand details + * filter. + */ + @JsonProperty(value = "properties.details") + private JobDetails details; + + /** + * Reason for cancellation. + */ + @JsonProperty(value = "properties.cancellationReason", access = JsonProperty.Access.WRITE_ONLY) + private String cancellationReason; + + /** + * Name of the object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Id of the object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Type of the object. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The sku type. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * Get describes whether the job is cancellable or not. + * + * @return the isCancellable value + */ + public Boolean isCancellable() { + return this.isCancellable; + } + + /** + * Get describes whether the job is deletable or not. + * + * @return the isDeletable value + */ + public Boolean isDeletable() { + return this.isDeletable; + } + + /** + * Get describes whether the shipping address is editable or not. + * + * @return the isShippingAddressEditable value + */ + public Boolean isShippingAddressEditable() { + return this.isShippingAddressEditable; + } + + /** + * Get name of the stage which is in progress. Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted'. + * + * @return the status value + */ + public StageName status() { + return this.status; + } + + /** + * Get time at which the job was started in UTC ISO 8601 format. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get top level error for the job. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Get details of a job run. This field will only be sent for expand details filter. + * + * @return the details value + */ + public JobDetails details() { + return this.details; + } + + /** + * Set details of a job run. This field will only be sent for expand details filter. + * + * @param details the details value to set + * @return the JobResourceInner object itself. + */ + public JobResourceInner withDetails(JobDetails details) { + this.details = details; + return this; + } + + /** + * Get reason for cancellation. + * + * @return the cancellationReason value + */ + public String cancellationReason() { + return this.cancellationReason; + } + + /** + * Get name of the object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get id of the object. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get type of the object. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the sku type. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku type. + * + * @param sku the sku value to set + * @return the JobResourceInner object itself. + */ + public JobResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobsImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobsImpl.java new file mode 100644 index 000000000000..0852ac50e9d3 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobsImpl.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.databox.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.databox.Jobs; +import com.microsoft.azure.management.databox.JobResource; +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 java.util.List; +import com.microsoft.azure.management.databox.ShipmentPickUpResponse; +import com.microsoft.azure.management.databox.UnencryptedCredentials; +import com.microsoft.azure.management.databox.ShipmentPickUpRequest; + +class JobsImpl extends GroupableResourcesCoreImpl implements Jobs { + protected JobsImpl(DataBoxManager manager) { + super(manager.inner().jobs(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + JobsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + JobsInner 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) { + JobsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + JobsInner 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 JobResource call(JobResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + JobsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + JobsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public JobResource call(JobResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public JobResourceImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable bookShipmentPickUpAsync(String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { + JobsInner client = this.inner(); + return client.bookShipmentPickUpAsync(resourceGroupName, jobName, shipmentPickUpRequest) + .map(new Func1() { + @Override + public ShipmentPickUpResponse call(ShipmentPickUpResponseInner inner) { + return new ShipmentPickUpResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable cancelAsync(String resourceGroupName, String jobName, String reason) { + JobsInner client = this.inner(); + return client.cancelAsync(resourceGroupName, jobName, reason).toCompletable(); + } + + @Override + public Observable listCredentialsAsync(String resourceGroupName, String jobName) { + JobsInner client = this.inner(); + return client.listCredentialsAsync(resourceGroupName, jobName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public UnencryptedCredentials call(UnencryptedCredentialsInner inner) { + return new UnencryptedCredentialsImpl(inner, manager()); + } + }); + } + + @Override + protected JobResourceImpl wrapModel(JobResourceInner inner) { + return new JobResourceImpl(inner.name(), inner, manager()); + } + + @Override + protected JobResourceImpl wrapModel(String name) { + return new JobResourceImpl(name, new JobResourceInner(), this.manager()); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobsInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobsInner.java new file mode 100644 index 000000000000..08f4ae3e6afc --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/JobsInner.java @@ -0,0 +1,1914 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.databox.CancellationReason; +import com.microsoft.azure.management.databox.JobResourceUpdateParameter; +import com.microsoft.azure.management.databox.ShipmentPickUpRequest; +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 Jobs. + */ +public class JobsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private DataBoxManagementClientImpl client; + + /** + * Initializes an instance of JobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsInner(Retrofit retrofit, DataBoxManagementClientImpl client) { + this.service = retrofit.create(JobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Jobs to be + * used by Retrofit to perform actually REST calls. + */ + interface JobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databox.Jobs list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databox.Jobs listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$skipToken") String skipToken, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databox.Jobs getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Query("$expand") String 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.databox.Jobs create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Body JobResourceInner jobResource, @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.databox.Jobs beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Body JobResourceInner jobResource, @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.databox.Jobs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @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.databox.Jobs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @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.databox.Jobs update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Body JobResourceUpdateParameter jobResourceUpdateParameter, @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.databox.Jobs beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("If-Match") String ifMatch, @Body JobResourceUpdateParameter jobResourceUpdateParameter, @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.databox.Jobs bookShipmentPickUp" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp") + Observable> bookShipmentPickUp(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Body ShipmentPickUpRequest shipmentPickUpRequest, @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.databox.Jobs cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel") + Observable> cancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CancellationReason cancellationReason, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databox.Jobs listCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials") + Observable> listCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobName") String jobName, @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.databox.Jobs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databox.Jobs listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the jobs available under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobResourceInner> 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 jobs available under the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the jobs available under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the jobs available under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> 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 jobs available under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @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<JobResourceInner> object if successful. + */ + public PagedList list(final String skipToken) { + ServiceResponse> response = listSinglePageAsync(skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the jobs available under the subscription. + * + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @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 skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable> listAsync(final String skipToken) { + return listWithServiceResponseAsync(skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String skipToken) { + return listSinglePageAsync(skipToken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the jobs available under the subscription. + * + ServiceResponse> * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String skipToken) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobResourceInner> 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 jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> 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 jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> 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 jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> 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 jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String skipToken = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @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<JobResourceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String skipToken) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String skipToken) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param resourceGroupName The Resource Group Name + * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String skipToken) { + return listByResourceGroupSinglePageAsync(resourceGroupName, skipToken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the jobs available under the given resource group. + * + ServiceResponse> * @param resourceGroupName The Resource Group Name + ServiceResponse> * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String skipToken) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 JobResourceInner object if successful. + */ + public JobResourceInner getByResourceGroup(String resourceGroupName, String jobName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobName).toBlocking().single().body(); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobName), serviceCallback); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String jobName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobName).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String jobName) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, jobName, 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); + } + } + }); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @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 JobResourceInner object if successful. + */ + public JobResourceInner getByResourceGroup(String resourceGroupName, String jobName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobName, expand).toBlocking().single().body(); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @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 jobName, String expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobName, expand), serviceCallback); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String jobName, String expand) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobName, expand).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param expand $expand is supported on details parameter for job, which provides details on the job stages. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String jobName, String 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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, jobName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @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 JobResourceInner object if successful. + */ + public JobResourceInner create(String resourceGroupName, String jobName, JobResourceInner jobResource) { + return createWithServiceResponseAsync(resourceGroupName, jobName, jobResource).toBlocking().last().body(); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @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 createAsync(String resourceGroupName, String jobName, JobResourceInner jobResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, jobName, jobResource), serviceCallback); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String jobName, JobResourceInner jobResource) { + return createWithServiceResponseAsync(resourceGroupName, jobName, jobResource).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String jobName, JobResourceInner jobResource) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (jobResource == null) { + throw new IllegalArgumentException("Parameter jobResource is required and cannot be null."); + } + Validator.validate(jobResource); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), jobResource, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @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 JobResourceInner object if successful. + */ + public JobResourceInner beginCreate(String resourceGroupName, String jobName, JobResourceInner jobResource) { + return beginCreateWithServiceResponseAsync(resourceGroupName, jobName, jobResource).toBlocking().single().body(); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @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 beginCreateAsync(String resourceGroupName, String jobName, JobResourceInner jobResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, jobName, jobResource), serviceCallback); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String jobName, JobResourceInner jobResource) { + return beginCreateWithServiceResponseAsync(resourceGroupName, jobName, jobResource).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResource Job details from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String jobName, JobResourceInner jobResource) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (jobResource == null) { + throw new IllegalArgumentException("Parameter jobResource is required and cannot be null."); + } + Validator.validate(jobResource); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), jobResource, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(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); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 jobName) { + deleteWithServiceResponseAsync(resourceGroupName, jobName).toBlocking().last().body(); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, jobName), serviceCallback); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String jobName) { + return deleteWithServiceResponseAsync(resourceGroupName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String jobName) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 jobName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, jobName).toBlocking().single().body(); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, jobName), serviceCallback); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String jobName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String jobName) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, jobName, 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(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @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 JobResourceInner object if successful. + */ + public JobResourceInner update(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + return updateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter).toBlocking().last().body(); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @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 jobName, JobResourceUpdateParameter jobResourceUpdateParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter), serviceCallback); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + return updateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (jobResourceUpdateParameter == null) { + throw new IllegalArgumentException("Parameter jobResourceUpdateParameter is required and cannot be null."); + } + Validator.validate(jobResourceUpdateParameter); + final String ifMatch = null; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), ifMatch, jobResourceUpdateParameter, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @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 JobResourceInner object if successful. + */ + public JobResourceInner update(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch).toBlocking().last().body(); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @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 jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch), serviceCallback); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (jobResourceUpdateParameter == null) { + throw new IllegalArgumentException("Parameter jobResourceUpdateParameter is required and cannot be null."); + } + Validator.validate(jobResourceUpdateParameter); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), ifMatch, jobResourceUpdateParameter, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @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 JobResourceInner object if successful. + */ + public JobResourceInner beginUpdate(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @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 jobName, JobResourceUpdateParameter jobResourceUpdateParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter), serviceCallback); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (jobResourceUpdateParameter == null) { + throw new IllegalArgumentException("Parameter jobResourceUpdateParameter is required and cannot be null."); + } + Validator.validate(jobResourceUpdateParameter); + final String ifMatch = null; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), ifMatch, jobResourceUpdateParameter, 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); + } + } + }); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @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 JobResourceInner object if successful. + */ + public JobResourceInner beginUpdate(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @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 jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch), serviceCallback); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, jobName, jobResourceUpdateParameter, ifMatch).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param jobResourceUpdateParameter Job update parameters from request body. + * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter, String ifMatch) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (jobResourceUpdateParameter == null) { + throw new IllegalArgumentException("Parameter jobResourceUpdateParameter is required and cannot be null."); + } + Validator.validate(jobResourceUpdateParameter); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), ifMatch, jobResourceUpdateParameter, 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); + } + + /** + * Book shipment pick up. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param shipmentPickUpRequest Details of shipment pick up request. + * @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 ShipmentPickUpResponseInner object if successful. + */ + public ShipmentPickUpResponseInner bookShipmentPickUp(String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { + return bookShipmentPickUpWithServiceResponseAsync(resourceGroupName, jobName, shipmentPickUpRequest).toBlocking().single().body(); + } + + /** + * Book shipment pick up. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param shipmentPickUpRequest Details of shipment pick up request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture bookShipmentPickUpAsync(String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(bookShipmentPickUpWithServiceResponseAsync(resourceGroupName, jobName, shipmentPickUpRequest), serviceCallback); + } + + /** + * Book shipment pick up. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param shipmentPickUpRequest Details of shipment pick up request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ShipmentPickUpResponseInner object + */ + public Observable bookShipmentPickUpAsync(String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { + return bookShipmentPickUpWithServiceResponseAsync(resourceGroupName, jobName, shipmentPickUpRequest).map(new Func1, ShipmentPickUpResponseInner>() { + @Override + public ShipmentPickUpResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Book shipment pick up. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param shipmentPickUpRequest Details of shipment pick up request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ShipmentPickUpResponseInner object + */ + public Observable> bookShipmentPickUpWithServiceResponseAsync(String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (shipmentPickUpRequest == null) { + throw new IllegalArgumentException("Parameter shipmentPickUpRequest is required and cannot be null."); + } + Validator.validate(shipmentPickUpRequest); + return service.bookShipmentPickUp(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), shipmentPickUpRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = bookShipmentPickUpDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse bookShipmentPickUpDelegate(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); + } + + /** + * CancelJob. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param reason Reason for cancellation. + * @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 cancel(String resourceGroupName, String jobName, String reason) { + cancelWithServiceResponseAsync(resourceGroupName, jobName, reason).toBlocking().single().body(); + } + + /** + * CancelJob. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param reason Reason for cancellation. + * @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 cancelAsync(String resourceGroupName, String jobName, String reason, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(resourceGroupName, jobName, reason), serviceCallback); + } + + /** + * CancelJob. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param reason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelAsync(String resourceGroupName, String jobName, String reason) { + return cancelWithServiceResponseAsync(resourceGroupName, jobName, reason).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * CancelJob. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @param reason Reason for cancellation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> cancelWithServiceResponseAsync(String resourceGroupName, String jobName, String reason) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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 (reason == null) { + throw new IllegalArgumentException("Parameter reason is required and cannot be null."); + } + CancellationReason cancellationReason = new CancellationReason(); + cancellationReason.withReason(reason); + return service.cancel(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), cancellationReason, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = cancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse cancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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 List<UnencryptedCredentialsInner> object if successful. + */ + public List listCredentials(String resourceGroupName, String jobName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, jobName).toBlocking().single().body(); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @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> listCredentialsAsync(String resourceGroupName, String jobName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listCredentialsWithServiceResponseAsync(resourceGroupName, jobName), serviceCallback); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UnencryptedCredentialsInner> object + */ + public Observable> listCredentialsAsync(String resourceGroupName, String jobName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, jobName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param resourceGroupName The Resource Group Name + * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UnencryptedCredentialsInner> object + */ + public Observable>> listCredentialsWithServiceResponseAsync(String resourceGroupName, String jobName) { + 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 (jobName == null) { + throw new IllegalArgumentException("Parameter jobName 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.listCredentials(this.client.subscriptionId(), resourceGroupName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCredentialsDelegate(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> listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobResourceInner> 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 jobs available under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> 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 jobs available under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> 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 jobs available under the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> 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); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<JobResourceInner> 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 jobs available under the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> 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 jobs available under the given resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> 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 jobs available under the given resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationImpl.java new file mode 100644 index 000000000000..16875d9e7187 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationImpl.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.databox.implementation; + +import com.microsoft.azure.management.databox.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databox.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final DataBoxManager manager; + OperationImpl(OperationInner inner, DataBoxManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationInner.java new file mode 100644 index 000000000000..64a1497d151d --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationInner.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.implementation; + +import com.microsoft.azure.management.databox.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation entity. + */ +public class OperationInner { + /** + * Name of the operation. Format: + * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Operation display values. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /** + * Operation properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private Object properties; + + /** + * Origin of the operation. Can be : user|system|user,system. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * Get name of the operation. Format: {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get operation display values. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get operation properties. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Get origin of the operation. Can be : user|system|user,system. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationsImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationsImpl.java new file mode 100644 index 000000000000..b50097403717 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/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.databox.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databox.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databox.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DataBoxManager manager; + + OperationsImpl(DataBoxManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DataBoxManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationsInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationsInner.java new file mode 100644 index 000000000000..9dc5fe748e76 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private DataBoxManagementClientImpl 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, DataBoxManagementClientImpl 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.databox.Operations list" }) + @GET("providers/Microsoft.DataBox/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databox.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This method gets all the operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method gets all the operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method gets all the operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method gets all the operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method gets all the operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/PageImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/PageImpl.java new file mode 100644 index 000000000000..bafa49e84f4e --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/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.databox.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/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/PageImpl1.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/PageImpl1.java new file mode 100644 index 000000000000..093145701ea2 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/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.databox.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/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ServicesImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ServicesImpl.java new file mode 100644 index 000000000000..325b37a4e48d --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ServicesImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.databox.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databox.Services; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databox.SkuInformation; +import com.microsoft.azure.management.databox.AddressValidationOutput; +import com.microsoft.azure.management.databox.AvailableSkuRequest; +import com.microsoft.azure.management.databox.ValidateAddress; + +class ServicesImpl extends WrapperImpl implements Services { + private final DataBoxManager manager; + + ServicesImpl(DataBoxManager manager) { + super(manager.inner().services()); + this.manager = manager; + } + + public DataBoxManager manager() { + return this.manager; + } + + @Override + public Observable listAvailableSkusAsync(final String location, final AvailableSkuRequest availableSkuRequest) { + ServicesInner client = this.inner(); + return client.listAvailableSkusAsync(location, availableSkuRequest) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SkuInformation call(SkuInformationInner inner) { + return new SkuInformationImpl(inner, manager()); + } + }); + } + + @Override + public Observable validateAddressMethodAsync(String location, ValidateAddress validateAddress) { + ServicesInner client = this.inner(); + return client.validateAddressMethodAsync(location, validateAddress) + .map(new Func1() { + @Override + public AddressValidationOutput call(AddressValidationOutputInner inner) { + return new AddressValidationOutputImpl(inner, manager()); + } + }); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ServicesInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ServicesInner.java new file mode 100644 index 000000000000..52f590662c71 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ServicesInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.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.databox.AvailableSkuRequest; +import com.microsoft.azure.management.databox.ValidateAddress; +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.Path; +import retrofit2.http.POST; +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 Services. + */ +public class ServicesInner { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private DataBoxManagementClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, DataBoxManagementClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databox.Services listAvailableSkus" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus") + Observable> listAvailableSkus(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body AvailableSkuRequest availableSkuRequest, @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.databox.Services validateAddressMethod" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress") + Observable> validateAddressMethod(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body ValidateAddress validateAddress, @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.databox.Services listAvailableSkusNext" }) + @GET + Observable> listAvailableSkusNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @param location The location of the resource + * @param availableSkuRequest Filters for showing the available skus. + * @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<SkuInformationInner> object if successful. + */ + public PagedList listAvailableSkus(final String location, final AvailableSkuRequest availableSkuRequest) { + ServiceResponse> response = listAvailableSkusSinglePageAsync(location, availableSkuRequest).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @param location The location of the resource + * @param availableSkuRequest Filters for showing the available skus. + * @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> listAvailableSkusAsync(final String location, final AvailableSkuRequest availableSkuRequest, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSkusSinglePageAsync(location, availableSkuRequest), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @param location The location of the resource + * @param availableSkuRequest Filters for showing the available skus. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SkuInformationInner> object + */ + public Observable> listAvailableSkusAsync(final String location, final AvailableSkuRequest availableSkuRequest) { + return listAvailableSkusWithServiceResponseAsync(location, availableSkuRequest) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @param location The location of the resource + * @param availableSkuRequest Filters for showing the available skus. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SkuInformationInner> object + */ + public Observable>> listAvailableSkusWithServiceResponseAsync(final String location, final AvailableSkuRequest availableSkuRequest) { + return listAvailableSkusSinglePageAsync(location, availableSkuRequest) + .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(listAvailableSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + ServiceResponse> * @param location The location of the resource + ServiceResponse> * @param availableSkuRequest Filters for showing the available skus. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SkuInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSkusSinglePageAsync(final String location, final AvailableSkuRequest availableSkuRequest) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (availableSkuRequest == null) { + throw new IllegalArgumentException("Parameter availableSkuRequest is required and cannot be null."); + } + Validator.validate(availableSkuRequest); + return service.listAvailableSkus(this.client.subscriptionId(), location, this.client.apiVersion(), availableSkuRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSkusDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSkusDelegate(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); + } + + /** + * This method validates the customer shipping address and provide alternate addresses if any. + * + * @param location The location of the resource + * @param validateAddress Shipping address of the customer. + * @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 AddressValidationOutputInner object if successful. + */ + public AddressValidationOutputInner validateAddressMethod(String location, ValidateAddress validateAddress) { + return validateAddressMethodWithServiceResponseAsync(location, validateAddress).toBlocking().single().body(); + } + + /** + * This method validates the customer shipping address and provide alternate addresses if any. + * + * @param location The location of the resource + * @param validateAddress Shipping address of the customer. + * @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 validateAddressMethodAsync(String location, ValidateAddress validateAddress, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validateAddressMethodWithServiceResponseAsync(location, validateAddress), serviceCallback); + } + + /** + * This method validates the customer shipping address and provide alternate addresses if any. + * + * @param location The location of the resource + * @param validateAddress Shipping address of the customer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AddressValidationOutputInner object + */ + public Observable validateAddressMethodAsync(String location, ValidateAddress validateAddress) { + return validateAddressMethodWithServiceResponseAsync(location, validateAddress).map(new Func1, AddressValidationOutputInner>() { + @Override + public AddressValidationOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This method validates the customer shipping address and provide alternate addresses if any. + * + * @param location The location of the resource + * @param validateAddress Shipping address of the customer. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AddressValidationOutputInner object + */ + public Observable> validateAddressMethodWithServiceResponseAsync(String location, ValidateAddress validateAddress) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (validateAddress == null) { + throw new IllegalArgumentException("Parameter validateAddress is required and cannot be null."); + } + Validator.validate(validateAddress); + return service.validateAddressMethod(this.client.subscriptionId(), location, this.client.apiVersion(), validateAddress, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validateAddressMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validateAddressMethodDelegate(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); + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @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<SkuInformationInner> object if successful. + */ + public PagedList listAvailableSkusNext(final String nextPageLink) { + ServiceResponse> response = listAvailableSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listAvailableSkusNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @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> listAvailableSkusNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listAvailableSkusNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listAvailableSkusNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @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<SkuInformationInner> object + */ + public Observable> listAvailableSkusNextAsync(final String nextPageLink) { + return listAvailableSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + * @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<SkuInformationInner> object + */ + public Observable>> listAvailableSkusNextWithServiceResponseAsync(final String nextPageLink) { + return listAvailableSkusNextSinglePageAsync(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(listAvailableSkusNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * This method provides the list of available skus for the given subscription and location. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SkuInformationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listAvailableSkusNextSinglePageAsync(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.listAvailableSkusNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listAvailableSkusNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAvailableSkusNextDelegate(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/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ShipmentPickUpResponseImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ShipmentPickUpResponseImpl.java new file mode 100644 index 000000000000..a06f390128a3 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ShipmentPickUpResponseImpl.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.databox.implementation; + +import com.microsoft.azure.management.databox.ShipmentPickUpResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; + +class ShipmentPickUpResponseImpl extends WrapperImpl implements ShipmentPickUpResponse { + private final DataBoxManager manager; + ShipmentPickUpResponseImpl(ShipmentPickUpResponseInner inner, DataBoxManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxManager manager() { + return this.manager; + } + + @Override + public String confirmationNumber() { + return this.inner().confirmationNumber(); + } + + @Override + public DateTime readyByTime() { + return this.inner().readyByTime(); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ShipmentPickUpResponseInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ShipmentPickUpResponseInner.java new file mode 100644 index 000000000000..17fb28f27a12 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/ShipmentPickUpResponseInner.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Shipment pick up response. + */ +public class ShipmentPickUpResponseInner { + /** + * Confirmation number for the pick up request. + */ + @JsonProperty(value = "confirmationNumber", access = JsonProperty.Access.WRITE_ONLY) + private String confirmationNumber; + + /** + * Time by which shipment should be ready for pick up, this is in local + * time of pick up area. + */ + @JsonProperty(value = "readyByTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime readyByTime; + + /** + * Get confirmation number for the pick up request. + * + * @return the confirmationNumber value + */ + public String confirmationNumber() { + return this.confirmationNumber; + } + + /** + * Get time by which shipment should be ready for pick up, this is in local time of pick up area. + * + * @return the readyByTime value + */ + public DateTime readyByTime() { + return this.readyByTime; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/SkuInformationImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/SkuInformationImpl.java new file mode 100644 index 000000000000..6440a7589262 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/SkuInformationImpl.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.databox.implementation; + +import com.microsoft.azure.management.databox.SkuInformation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.databox.SkuCapacity; +import com.microsoft.azure.management.databox.SkuCost; +import com.microsoft.azure.management.databox.DestinationToServiceLocationMap; +import com.microsoft.azure.management.databox.SkuDisabledReason; +import com.microsoft.azure.management.databox.Sku; + +class SkuInformationImpl extends WrapperImpl implements SkuInformation { + private final DataBoxManager manager; + SkuInformationImpl(SkuInformationInner inner, DataBoxManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxManager manager() { + return this.manager; + } + + @Override + public List apiVersions() { + return this.inner().apiVersions(); + } + + @Override + public SkuCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public List costs() { + return this.inner().costs(); + } + + @Override + public List destinationToServiceLocationMap() { + return this.inner().destinationToServiceLocationMap(); + } + + @Override + public SkuDisabledReason disabledReason() { + return this.inner().disabledReason(); + } + + @Override + public String disabledReasonMessage() { + return this.inner().disabledReasonMessage(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String requiredFeature() { + return this.inner().requiredFeature(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/SkuInformationInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/SkuInformationInner.java new file mode 100644 index 000000000000..bd244b2ed839 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/SkuInformationInner.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.databox.implementation; + +import com.microsoft.azure.management.databox.Sku; +import java.util.List; +import com.microsoft.azure.management.databox.DestinationToServiceLocationMap; +import com.microsoft.azure.management.databox.SkuCapacity; +import com.microsoft.azure.management.databox.SkuCost; +import com.microsoft.azure.management.databox.SkuDisabledReason; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Information of the sku. + */ +@JsonFlatten +public class SkuInformationInner { + /** + * The Sku. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /** + * The sku is enabled or not. + */ + @JsonProperty(value = "enabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enabled; + + /** + * The map of destination location to service location. + */ + @JsonProperty(value = "properties.destinationToServiceLocationMap", access = JsonProperty.Access.WRITE_ONLY) + private List destinationToServiceLocationMap; + + /** + * Capacity of the Sku. + */ + @JsonProperty(value = "properties.capacity", access = JsonProperty.Access.WRITE_ONLY) + private SkuCapacity capacity; + + /** + * Cost of the Sku. + */ + @JsonProperty(value = "properties.costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /** + * Api versions that support this Sku. + */ + @JsonProperty(value = "properties.apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /** + * Reason why the Sku is disabled. Possible values include: 'None', + * 'Country', 'Region', 'Feature', 'OfferType', 'NoSubscriptionInfo'. + */ + @JsonProperty(value = "properties.disabledReason", access = JsonProperty.Access.WRITE_ONLY) + private SkuDisabledReason disabledReason; + + /** + * Message for why the Sku is disabled. + */ + @JsonProperty(value = "properties.disabledReasonMessage", access = JsonProperty.Access.WRITE_ONLY) + private String disabledReasonMessage; + + /** + * Required feature to access the sku. + */ + @JsonProperty(value = "properties.requiredFeature", access = JsonProperty.Access.WRITE_ONLY) + private String requiredFeature; + + /** + * Get the Sku. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the sku is enabled or not. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Get the map of destination location to service location. + * + * @return the destinationToServiceLocationMap value + */ + public List destinationToServiceLocationMap() { + return this.destinationToServiceLocationMap; + } + + /** + * Get capacity of the Sku. + * + * @return the capacity value + */ + public SkuCapacity capacity() { + return this.capacity; + } + + /** + * Get cost of the Sku. + * + * @return the costs value + */ + public List costs() { + return this.costs; + } + + /** + * Get api versions that support this Sku. + * + * @return the apiVersions value + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get reason why the Sku is disabled. Possible values include: 'None', 'Country', 'Region', 'Feature', 'OfferType', 'NoSubscriptionInfo'. + * + * @return the disabledReason value + */ + public SkuDisabledReason disabledReason() { + return this.disabledReason; + } + + /** + * Get message for why the Sku is disabled. + * + * @return the disabledReasonMessage value + */ + public String disabledReasonMessage() { + return this.disabledReasonMessage; + } + + /** + * Get required feature to access the sku. + * + * @return the requiredFeature value + */ + public String requiredFeature() { + return this.requiredFeature; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/UnencryptedCredentialsImpl.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/UnencryptedCredentialsImpl.java new file mode 100644 index 000000000000..0f1d962e80dd --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/UnencryptedCredentialsImpl.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.databox.implementation; + +import com.microsoft.azure.management.databox.UnencryptedCredentials; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databox.JobSecrets; + +class UnencryptedCredentialsImpl extends WrapperImpl implements UnencryptedCredentials { + private final DataBoxManager manager; + UnencryptedCredentialsImpl(UnencryptedCredentialsInner inner, DataBoxManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxManager manager() { + return this.manager; + } + + @Override + public String jobName() { + return this.inner().jobName(); + } + + @Override + public JobSecrets jobSecrets() { + return this.inner().jobSecrets(); + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/UnencryptedCredentialsInner.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/UnencryptedCredentialsInner.java new file mode 100644 index 000000000000..be6d7c6e050c --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/UnencryptedCredentialsInner.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.databox.implementation; + +import com.microsoft.azure.management.databox.JobSecrets; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Unencrypted credentials for accessing device. + */ +public class UnencryptedCredentialsInner { + /** + * Name of the job. + */ + @JsonProperty(value = "jobName", access = JsonProperty.Access.WRITE_ONLY) + private String jobName; + + /** + * Secrets related to this job. + */ + @JsonProperty(value = "jobSecrets", access = JsonProperty.Access.WRITE_ONLY) + private JobSecrets jobSecrets; + + /** + * Get name of the job. + * + * @return the jobName value + */ + public String jobName() { + return this.jobName; + } + + /** + * Get secrets related to this job. + * + * @return the jobSecrets value + */ + public JobSecrets jobSecrets() { + return this.jobSecrets; + } + +} diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/package-info.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/package-info.java new file mode 100644 index 000000000000..92a244ef4a1d --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights 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 DataBoxManagementClient. + */ +package com.microsoft.azure.management.databox.implementation; diff --git a/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/package-info.java b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/package-info.java new file mode 100644 index 000000000000..61c5f01a8451 --- /dev/null +++ b/azure-mgmt-databox/src/main/java/com/microsoft/azure/management/databox/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights 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 DataBoxManagementClient. + */ +package com.microsoft.azure.management.databox;