diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/pom.xml b/recoveryservices.backup/resource-manager/v2016_06_01/pom.xml new file mode 100644 index 000000000000..556833bffe4c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.recoveryservices.backup.v2016_06_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-recoveryservices + 1.0.0-beta + jar + Microsoft Azure SDK for RecoveryServices Management + This package contains Microsoft RecoveryServices Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureBackupServerEngine.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureBackupServerEngine.java new file mode 100644 index 000000000000..d6433eadfbc6 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureBackupServerEngine.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The backup engine type when Azure Backup Server is used to manage the + * backups. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType") +@JsonTypeName("AzureBackupServerEngine") +public class AzureBackupServerEngine extends BackupEngineBase { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMContainer.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMContainer.java new file mode 100644 index 000000000000..92ed3bc61be8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMContainer.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing a classic-deployed + * virtual machine. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableObjectType") +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +public class AzureIaaSClassicComputeVMContainer extends IaaSVMContainer { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMProtectableItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMProtectableItem.java new file mode 100644 index 000000000000..75119685dd58 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMProtectableItem.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing a classic VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +public class AzureIaaSClassicComputeVMProtectableItem extends IaaSVMProtectableItem { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMProtectedItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMProtectedItem.java new file mode 100644 index 000000000000..6650e42967ab --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSClassicComputeVMProtectedItem.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing the classic VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("Microsoft.ClassicCompute/virtualMachines") +public class AzureIaaSClassicComputeVMProtectedItem extends AzureIaaSVMProtectedItem { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMContainer.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMContainer.java new file mode 100644 index 000000000000..d72e58a2a162 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMContainer.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing a Resource + * Manager-deployed virtual machine. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableObjectType") +@JsonTypeName("Microsoft.Compute/virtualMachines") +public class AzureIaaSComputeVMContainer extends IaaSVMContainer { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMProtectableItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMProtectableItem.java new file mode 100644 index 000000000000..84a900758700 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMProtectableItem.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing a Resource Manager VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("Microsoft.Compute/virtualMachines") +public class AzureIaaSComputeVMProtectableItem extends IaaSVMProtectableItem { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMProtectedItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMProtectedItem.java new file mode 100644 index 000000000000..7965245b24fc --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSComputeVMProtectedItem.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific backup item representing the Resource Manager VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("Microsoft.Compute/virtualMachines") +public class AzureIaaSComputeVMProtectedItem extends AzureIaaSVMProtectedItem { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMErrorInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMErrorInfo.java new file mode 100644 index 000000000000..29052b013717 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMErrorInfo.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure IaaS VM workload-specific error information. + */ +public class AzureIaaSVMErrorInfo { + /** + * Error code. + */ + @JsonProperty(value = "errorCode") + private Integer errorCode; + + /** + * Title: typically, the entity associated the error. + */ + @JsonProperty(value = "errorTitle") + private String errorTitle; + + /** + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /** + * List of localized recommendations for the error string. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get error code. + * + * @return the errorCode value + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set error code. + * + * @param errorCode the errorCode value to set + * @return the AzureIaaSVMErrorInfo object itself. + */ + public AzureIaaSVMErrorInfo withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get title: typically, the entity associated the error. + * + * @return the errorTitle value + */ + public String errorTitle() { + return this.errorTitle; + } + + /** + * Set title: typically, the entity associated the error. + * + * @param errorTitle the errorTitle value to set + * @return the AzureIaaSVMErrorInfo object itself. + */ + public AzureIaaSVMErrorInfo withErrorTitle(String errorTitle) { + this.errorTitle = errorTitle; + return this; + } + + /** + * Get localized error string. + * + * @return the errorString value + */ + public String errorString() { + return this.errorString; + } + + /** + * Set localized error string. + * + * @param errorString the errorString value to set + * @return the AzureIaaSVMErrorInfo object itself. + */ + public AzureIaaSVMErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get list of localized recommendations for the error string. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set list of localized recommendations for the error string. + * + * @param recommendations the recommendations value to set + * @return the AzureIaaSVMErrorInfo object itself. + */ + public AzureIaaSVMErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJob.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJob.java new file mode 100644 index 000000000000..6170d8fe1bdd --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJob.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.Period; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobInner; + +/** + * The Azure IaaS VM workload-specific job object. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("AzureIaaSVMJob") +public class AzureIaaSVMJob extends JobInner { + /** + * The time that elapsed during the execution of this job. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * Gets or sets the state, or actions, applicable on this job. Examples of + * the actions are: Cancel or Retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /** + * Error details about this job. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Specifies whether the backup item is a Classic VM or a Resource Manager + * VM. + */ + @JsonProperty(value = "virtualMachineVersion") + private String virtualMachineVersion; + + /** + * Additional information for this job. + */ + @JsonProperty(value = "extendedInfo") + private AzureIaaSVMJobExtendedInfo extendedInfo; + + /** + * Get the time that elapsed during the execution of this job. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set the time that elapsed during the execution of this job. + * + * @param duration the duration value to set + * @return the AzureIaaSVMJob object itself. + */ + public AzureIaaSVMJob withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get gets or sets the state, or actions, applicable on this job. Examples of the actions are: Cancel or Retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set gets or sets the state, or actions, applicable on this job. Examples of the actions are: Cancel or Retry. + * + * @param actionsInfo the actionsInfo value to set + * @return the AzureIaaSVMJob object itself. + */ + public AzureIaaSVMJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get error details about this job. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set error details about this job. + * + * @param errorDetails the errorDetails value to set + * @return the AzureIaaSVMJob object itself. + */ + public AzureIaaSVMJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get specifies whether the backup item is a Classic VM or a Resource Manager VM. + * + * @return the virtualMachineVersion value + */ + public String virtualMachineVersion() { + return this.virtualMachineVersion; + } + + /** + * Set specifies whether the backup item is a Classic VM or a Resource Manager VM. + * + * @param virtualMachineVersion the virtualMachineVersion value to set + * @return the AzureIaaSVMJob object itself. + */ + public AzureIaaSVMJob withVirtualMachineVersion(String virtualMachineVersion) { + this.virtualMachineVersion = virtualMachineVersion; + return this; + } + + /** + * Get additional information for this job. + * + * @return the extendedInfo value + */ + public AzureIaaSVMJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for this job. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureIaaSVMJob object itself. + */ + public AzureIaaSVMJob withExtendedInfo(AzureIaaSVMJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJobExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJobExtendedInfo.java new file mode 100644 index 000000000000..c80e03ee2d4d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJobExtendedInfo.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for the Azure IaaS VM workload-specific job. + */ +public class AzureIaaSVMJobExtendedInfo { + /** + * List of tasks associated with this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /** + * Job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /** + * Indicates progress of the job. Null if it has not started or completed. + */ + @JsonProperty(value = "progressPercentage") + private Double progressPercentage; + + /** + * Non-localized error message for job execution. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get list of tasks associated with this job. + * + * @return the tasksList value + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set list of tasks associated with this job. + * + * @param tasksList the tasksList value to set + * @return the AzureIaaSVMJobExtendedInfo object itself. + */ + public AzureIaaSVMJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get job properties. + * + * @return the propertyBag value + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set job properties. + * + * @param propertyBag the propertyBag value to set + * @return the AzureIaaSVMJobExtendedInfo object itself. + */ + public AzureIaaSVMJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get indicates progress of the job. Null if it has not started or completed. + * + * @return the progressPercentage value + */ + public Double progressPercentage() { + return this.progressPercentage; + } + + /** + * Set indicates progress of the job. Null if it has not started or completed. + * + * @param progressPercentage the progressPercentage value to set + * @return the AzureIaaSVMJobExtendedInfo object itself. + */ + public AzureIaaSVMJobExtendedInfo withProgressPercentage(Double progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + + /** + * Get non-localized error message for job execution. + * + * @return the dynamicErrorMessage value + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set non-localized error message for job execution. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set + * @return the AzureIaaSVMJobExtendedInfo object itself. + */ + public AzureIaaSVMJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJobTaskDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJobTaskDetails.java new file mode 100644 index 000000000000..ee30b21880ba --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMJobTaskDetails.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure IaaS VM workload-specific job task details. + */ +public class AzureIaaSVMJobTaskDetails { + /** + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /** + * The start time. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The instance ID. + */ + @JsonProperty(value = "instanceId") + private String instanceId; + + /** + * The time elapsed for the task. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The progress of the task, as a percentage. + */ + @JsonProperty(value = "progressPercentage") + private Double progressPercentage; + + /** + * Get the task display name. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the task display name. + * + * @param taskId the taskId value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time. + * + * @param startTime the startTime value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time. + * + * @param endTime the endTime value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the instance ID. + * + * @return the instanceId value + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instance ID. + * + * @param instanceId the instanceId value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get the time elapsed for the task. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set the time elapsed for the task. + * + * @param duration the duration value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get the status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status. + * + * @param status the status value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the progress of the task, as a percentage. + * + * @return the progressPercentage value + */ + public Double progressPercentage() { + return this.progressPercentage; + } + + /** + * Set the progress of the task, as a percentage. + * + * @param progressPercentage the progressPercentage value to set + * @return the AzureIaaSVMJobTaskDetails object itself. + */ + public AzureIaaSVMJobTaskDetails withProgressPercentage(Double progressPercentage) { + this.progressPercentage = progressPercentage; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectedItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectedItem.java new file mode 100644 index 000000000000..3771dc984bf9 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectedItem.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemInner; + +/** + * This Azure VM workload-specific (also known as IaaS VM workload-specific) + * backup item has been backed up. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("AzureIaaSVMProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMProtectedItem.class), + @JsonSubTypes.Type(name = "Microsoft.ClassicCompute/virtualMachines", value = AzureIaaSClassicComputeVMProtectedItem.class) +}) +public class AzureIaaSVMProtectedItem extends ProtectedItemInner { + /** + * The friendly name of the VM represented by this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The fully qualified Resource Manager ID of the virtual machine + * represented by this item. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * The backup status of this backup item. + */ + @JsonProperty(value = "protectionStatus") + private String protectionStatus; + + /** + * The backup state of this backup item. Possible values include: + * 'Invalid', 'IRPending', 'Protected', 'ProtectionError', + * 'ProtectionStopped', 'ProtectionPaused'. + */ + @JsonProperty(value = "protectionState") + private ProtectionState protectionState; + + /** + * The last backup operation status. The possible values are: Healthy or + * Unhealthy. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * The timestamp of the last backup operation for this backup item. + */ + @JsonProperty(value = "lastBackupTime") + private DateTime lastBackupTime; + + /** + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureIaaSVMProtectedItemExtendedInfo extendedInfo; + + /** + * Get the friendly name of the VM represented by this backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name of the VM represented by this backup item. + * + * @param friendlyName the friendlyName value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the fully qualified Resource Manager ID of the virtual machine represented by this item. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the fully qualified Resource Manager ID of the virtual machine represented by this item. + * + * @param virtualMachineId the virtualMachineId value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Get the backup status of this backup item. + * + * @return the protectionStatus value + */ + public String protectionStatus() { + return this.protectionStatus; + } + + /** + * Set the backup status of this backup item. + * + * @param protectionStatus the protectionStatus value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withProtectionStatus(String protectionStatus) { + this.protectionStatus = protectionStatus; + return this; + } + + /** + * Get the backup state of this backup item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @return the protectionState value + */ + public ProtectionState protectionState() { + return this.protectionState; + } + + /** + * Set the backup state of this backup item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @param protectionState the protectionState value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withProtectionState(ProtectionState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the last backup operation status. The possible values are: Healthy or Unhealthy. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the last backup operation status. The possible values are: Healthy or Unhealthy. + * + * @param lastBackupStatus the lastBackupStatus value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the timestamp of the last backup operation for this backup item. + * + * @return the lastBackupTime value + */ + public DateTime lastBackupTime() { + return this.lastBackupTime; + } + + /** + * Set the timestamp of the last backup operation for this backup item. + * + * @param lastBackupTime the lastBackupTime value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withLastBackupTime(DateTime lastBackupTime) { + this.lastBackupTime = lastBackupTime; + return this; + } + + /** + * Get additional information for this backup item. + * + * @return the extendedInfo value + */ + public AzureIaaSVMProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureIaaSVMProtectedItem object itself. + */ + public AzureIaaSVMProtectedItem withExtendedInfo(AzureIaaSVMProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectedItemExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..cc5113b68e8f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectedItemExtendedInfo.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for the Azure VM (also known as IaaS VM)-specific + * backup item. + */ +public class AzureIaaSVMProtectedItemExtendedInfo { + /** + * The oldest backup copy available for this backup item. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * The number of backup copies available for this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Specifies if the backup policy associated with the backup item is + * inconsistent. + */ + @JsonProperty(value = "policyInconsistent") + private Boolean policyInconsistent; + + /** + * Get the oldest backup copy available for this backup item. + * + * @return the oldestRecoveryPoint value + */ + public DateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldest backup copy available for this backup item. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set + * @return the AzureIaaSVMProtectedItemExtendedInfo object itself. + */ + public AzureIaaSVMProtectedItemExtendedInfo withOldestRecoveryPoint(DateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the number of backup copies available for this backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the number of backup copies available for this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set + * @return the AzureIaaSVMProtectedItemExtendedInfo object itself. + */ + public AzureIaaSVMProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get specifies if the backup policy associated with the backup item is inconsistent. + * + * @return the policyInconsistent value + */ + public Boolean policyInconsistent() { + return this.policyInconsistent; + } + + /** + * Set specifies if the backup policy associated with the backup item is inconsistent. + * + * @param policyInconsistent the policyInconsistent value to set + * @return the AzureIaaSVMProtectedItemExtendedInfo object itself. + */ + public AzureIaaSVMProtectedItemExtendedInfo withPolicyInconsistent(Boolean policyInconsistent) { + this.policyInconsistent = policyInconsistent; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectionPolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectionPolicy.java new file mode 100644 index 000000000000..af31087ee79c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureIaaSVMProtectionPolicy.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyInner; + +/** + * Azure VM (also known as IaaS VM) workload-specific backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("AzureIaasVM") +public class AzureIaaSVMProtectionPolicy extends ProtectionPolicyInner { + /** + * The backup schedule specified as part of backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /** + * The retention policy with the details on backup copy retention ranges. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the backup schedule specified as part of backup policy. + * + * @return the schedulePolicy value + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set the backup schedule specified as part of backup policy. + * + * @param schedulePolicy the schedulePolicy value to set + * @return the AzureIaaSVMProtectionPolicy object itself. + */ + public AzureIaaSVMProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get the retention policy with the details on backup copy retention ranges. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retention policy with the details on backup copy retention ranges. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the AzureIaaSVMProtectionPolicy object itself. + */ + public AzureIaaSVMProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlContainer.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlContainer.java new file mode 100644 index 000000000000..740ec37d37b9 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlContainer.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerInner; + +/** + * Azure SQL workload-specific container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableObjectType") +@JsonTypeName("AzureSqlContainer") +public class AzureSqlContainer extends ProtectionContainerInner { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectedItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectedItem.java new file mode 100644 index 000000000000..fd8f33745c97 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectedItem.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemInner; + +/** + * This is an Azure SQL workload-specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("Microsoft.Sql/servers/databases") +public class AzureSqlProtectedItem extends ProtectedItemInner { + /** + * The internal ID of a backup item. The internal ID is used by the Azure + * SQL Backup engine to contact Recovery Services. + */ + @JsonProperty(value = "protectedItemDataId") + private String protectedItemDataId; + + /** + * The backup state of the backup item. Possible values include: 'Invalid', + * 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', + * 'ProtectionPaused'. + */ + @JsonProperty(value = "protectionState") + private ProtectedItemState protectionState; + + /** + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private AzureSqlProtectedItemExtendedInfo extendedInfo; + + /** + * Get the internal ID of a backup item. The internal ID is used by the Azure SQL Backup engine to contact Recovery Services. + * + * @return the protectedItemDataId value + */ + public String protectedItemDataId() { + return this.protectedItemDataId; + } + + /** + * Set the internal ID of a backup item. The internal ID is used by the Azure SQL Backup engine to contact Recovery Services. + * + * @param protectedItemDataId the protectedItemDataId value to set + * @return the AzureSqlProtectedItem object itself. + */ + public AzureSqlProtectedItem withProtectedItemDataId(String protectedItemDataId) { + this.protectedItemDataId = protectedItemDataId; + return this; + } + + /** + * Get the backup state of the backup item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @return the protectionState value + */ + public ProtectedItemState protectionState() { + return this.protectionState; + } + + /** + * Set the backup state of the backup item. Possible values include: 'Invalid', 'IRPending', 'Protected', 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused'. + * + * @param protectionState the protectionState value to set + * @return the AzureSqlProtectedItem object itself. + */ + public AzureSqlProtectedItem withProtectionState(ProtectedItemState protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get additional information for this backup item. + * + * @return the extendedInfo value + */ + public AzureSqlProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set + * @return the AzureSqlProtectedItem object itself. + */ + public AzureSqlProtectedItem withExtendedInfo(AzureSqlProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectedItemExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..8375181a5446 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectedItemExtendedInfo.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for the Azure SQL specific backup item. + */ +public class AzureSqlProtectedItemExtendedInfo { + /** + * The oldest backup copy available for this item in the service. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * The number of available backup copies for this backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * The state of the backup policy associated with this backup item. + */ + @JsonProperty(value = "policyState") + private String policyState; + + /** + * Get the oldest backup copy available for this item in the service. + * + * @return the oldestRecoveryPoint value + */ + public DateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldest backup copy available for this item in the service. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set + * @return the AzureSqlProtectedItemExtendedInfo object itself. + */ + public AzureSqlProtectedItemExtendedInfo withOldestRecoveryPoint(DateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the number of available backup copies for this backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the number of available backup copies for this backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set + * @return the AzureSqlProtectedItemExtendedInfo object itself. + */ + public AzureSqlProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + + /** + * Get the state of the backup policy associated with this backup item. + * + * @return the policyState value + */ + public String policyState() { + return this.policyState; + } + + /** + * Set the state of the backup policy associated with this backup item. + * + * @param policyState the policyState value to set + * @return the AzureSqlProtectedItemExtendedInfo object itself. + */ + public AzureSqlProtectedItemExtendedInfo withPolicyState(String policyState) { + this.policyState = policyState; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectionPolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectionPolicy.java new file mode 100644 index 000000000000..8d2030f2ab62 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/AzureSqlProtectionPolicy.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyInner; + +/** + * The Azure SQL workload-specific backup policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("AzureSql") +public class AzureSqlProtectionPolicy extends ProtectionPolicyInner { + /** + * The retention policy details. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the retention policy details. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retention policy details. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the AzureSqlProtectionPolicy object itself. + */ + public AzureSqlProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BEKDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BEKDetails.java new file mode 100644 index 000000000000..7fc6b6f4efa5 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BEKDetails.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BEK is Bitlocker Encryption Key. + */ +public class BEKDetails { + /** + * Secret refers to Bitlocker Encryption Key (BEK). The Secret can be + * unlocked by the key (or KEK). + */ + @JsonProperty(value = "secretUrl") + private String secretUrl; + + /** + * ID of the Key Vault where this Secret is stored. + */ + @JsonProperty(value = "secretVaultId") + private String secretVaultId; + + /** + * Bitlocker Encryption Key (BEK) data. + */ + @JsonProperty(value = "secretData") + private String secretData; + + /** + * Get secret refers to Bitlocker Encryption Key (BEK). The Secret can be unlocked by the key (or KEK). + * + * @return the secretUrl value + */ + public String secretUrl() { + return this.secretUrl; + } + + /** + * Set secret refers to Bitlocker Encryption Key (BEK). The Secret can be unlocked by the key (or KEK). + * + * @param secretUrl the secretUrl value to set + * @return the BEKDetails object itself. + */ + public BEKDetails withSecretUrl(String secretUrl) { + this.secretUrl = secretUrl; + return this; + } + + /** + * Get iD of the Key Vault where this Secret is stored. + * + * @return the secretVaultId value + */ + public String secretVaultId() { + return this.secretVaultId; + } + + /** + * Set iD of the Key Vault where this Secret is stored. + * + * @param secretVaultId the secretVaultId value to set + * @return the BEKDetails object itself. + */ + public BEKDetails withSecretVaultId(String secretVaultId) { + this.secretVaultId = secretVaultId; + return this; + } + + /** + * Get bitlocker Encryption Key (BEK) data. + * + * @return the secretData value + */ + public String secretData() { + return this.secretData; + } + + /** + * Set bitlocker Encryption Key (BEK) data. + * + * @param secretData the secretData value to set + * @return the BEKDetails object itself. + */ + public BEKDetails withSecretData(String secretData) { + this.secretData = secretData; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSBackupEngineQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSBackupEngineQueryObject.java new file mode 100644 index 000000000000..ff0b45e865d3 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSBackupEngineQueryObject.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The query parameters used to GET the list of backup engines. + */ +public class BMSBackupEngineQueryObject { + /** + * The backup management type associated with the backup engine. Possible + * values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + * 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Get the backup management type associated with the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type associated with the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSBackupEngineQueryObject object itself. + */ + public BMSBackupEngineQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSContainerQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSContainerQueryObject.java new file mode 100644 index 000000000000..c74293410c04 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSContainerQueryObject.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The query filters that can be used with the list containers API. + */ +public class BMSContainerQueryObject { + /** + * The backup management type for this container. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The status of the container's registration with the Recovery Services + * vault. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Get the backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type for this container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSContainerQueryObject object itself. + */ + public BMSContainerQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the status of the container's registration with the Recovery Services vault. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of the container's registration with the Recovery Services vault. + * + * @param status the status value to set + * @return the BMSContainerQueryObject object itself. + */ + public BMSContainerQueryObject withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the friendly name of the container. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name of the container. + * + * @param friendlyName the friendlyName value to set + * @return the BMSContainerQueryObject object itself. + */ + public BMSContainerQueryObject withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSPOQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSPOQueryObject.java new file mode 100644 index 000000000000..b4f8d89f7c2d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSPOQueryObject.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters the list of backup items. + */ +public class BMSPOQueryObject { + /** + * The backup management type. Possible values include: 'Invalid', + * 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The backup status query parameter. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The friendly name for the item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Get the backup management type. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BMSPOQueryObject object itself. + */ + public BMSPOQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the backup status query parameter. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the backup status query parameter. + * + * @param status the status value to set + * @return the BMSPOQueryObject object itself. + */ + public BMSPOQueryObject withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the friendly name for the item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name for the item. + * + * @param friendlyName the friendlyName value to set + * @return the BMSPOQueryObject object itself. + */ + public BMSPOQueryObject withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSRPQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSRPQueryObject.java new file mode 100644 index 000000000000..14fa5a7b8c74 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BMSRPQueryObject.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters the list of backup copies based on the property. + */ +public class BMSRPQueryObject { + /** + * Use backup copies created after this time. + */ + @JsonProperty(value = "startDate") + private DateTime startDate; + + /** + * Use backup copies created before this time. + */ + @JsonProperty(value = "endDate") + private DateTime endDate; + + /** + * Get use backup copies created after this time. + * + * @return the startDate value + */ + public DateTime startDate() { + return this.startDate; + } + + /** + * Set use backup copies created after this time. + * + * @param startDate the startDate value to set + * @return the BMSRPQueryObject object itself. + */ + public BMSRPQueryObject withStartDate(DateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get use backup copies created before this time. + * + * @return the endDate value + */ + public DateTime endDate() { + return this.endDate; + } + + /** + * Set use backup copies created before this time. + * + * @param endDate the endDate value to set + * @return the BMSRPQueryObject object itself. + */ + public BMSRPQueryObject withEndDate(DateTime endDate) { + this.endDate = endDate; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngineBase.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngineBase.java new file mode 100644 index 000000000000..aba6b76155cb --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngineBase.java @@ -0,0 +1,189 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base backup engine class. All workload-specific backup engines derive + * from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType") +@JsonTypeName("BackupEngineBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureBackupServerEngine", value = AzureBackupServerEngine.class), + @JsonSubTypes.Type(name = "DpmBackupEngine", value = DpmBackupEngine.class) +}) +public class BackupEngineBase { + /** + * The friendly name of the backup engine. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The type of backup management associated with the backup engine. + * Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + * 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The status of the backup engine registration with the Recovery Services + * vault. + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /** + * The backup status of the backup engine. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /** + * The flag indicating whether the backup engine be registered again, once + * the engine has been initially registered. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /** + * The ID of the backup engine. + */ + @JsonProperty(value = "backupEngineId") + private String backupEngineId; + + /** + * Get the friendly name of the backup engine. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name of the backup engine. + * + * @param friendlyName the friendlyName value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the type of backup management associated with the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the type of backup management associated with the backup engine. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the status of the backup engine registration with the Recovery Services vault. + * + * @return the registrationStatus value + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set the status of the backup engine registration with the Recovery Services vault. + * + * @param registrationStatus the registrationStatus value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withRegistrationStatus(String registrationStatus) { + this.registrationStatus = registrationStatus; + return this; + } + + /** + * Get the backup status of the backup engine. + * + * @return the healthStatus value + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set the backup status of the backup engine. + * + * @param healthStatus the healthStatus value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get the flag indicating whether the backup engine be registered again, once the engine has been initially registered. + * + * @return the canReRegister value + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set the flag indicating whether the backup engine be registered again, once the engine has been initially registered. + * + * @param canReRegister the canReRegister value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withCanReRegister(Boolean canReRegister) { + this.canReRegister = canReRegister; + return this; + } + + /** + * Get the ID of the backup engine. + * + * @return the backupEngineId value + */ + public String backupEngineId() { + return this.backupEngineId; + } + + /** + * Set the ID of the backup engine. + * + * @param backupEngineId the backupEngineId value to set + * @return the BackupEngineBase object itself. + */ + public BackupEngineBase withBackupEngineId(String backupEngineId) { + this.backupEngineId = backupEngineId; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngineBaseResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngineBaseResource.java new file mode 100644 index 000000000000..530d83290dce --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngineBaseResource.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.BackupEngineBaseResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing BackupEngineBaseResource. + */ +public interface BackupEngineBaseResource extends HasInner, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + BackupEngineBase properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngines.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngines.java new file mode 100644 index 000000000000..c7b0177c200e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupEngines.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.BackupEnginesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupEngines. + */ +public interface BackupEngines extends HasInner { + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(final String vaultName, final String resourceGroupName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultOperationStatus.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultOperationStatus.java new file mode 100644 index 000000000000..0c107ac0ec81 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultOperationStatus.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.OperationStatusInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import org.joda.time.DateTime; + +/** + * Type representing BackupFabricVaultOperationStatus. + */ +public interface BackupFabricVaultOperationStatus extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the error value. + */ + OperationStatusError error(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + OperationStatusExtendedInfo properties(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + OperationStatusValues status(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultProtectedItemResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultProtectedItemResource.java new file mode 100644 index 000000000000..c60fcae99b15 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultProtectedItemResource.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing BackupFabricVaultProtectedItemResource. + */ +public interface BackupFabricVaultProtectedItemResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectedItemInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultProtectionContainerResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultProtectionContainerResource.java new file mode 100644 index 000000000000..34506a94eaaf --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupFabricVaultProtectionContainerResource.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing BackupFabricVaultProtectionContainerResource. + */ +public interface BackupFabricVaultProtectionContainerResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectionContainerInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupItemType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupItemType.java new file mode 100644 index 000000000000..d3e8f2f61ef2 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupItemType.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for BackupItemType. + */ +public enum BackupItemType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value VM. */ + VM("VM"), + + /** Enum value FileFolder. */ + FILE_FOLDER("FileFolder"), + + /** Enum value AzureSqlDb. */ + AZURE_SQL_DB("AzureSqlDb"), + + /** Enum value SQLDB. */ + SQLDB("SQLDB"), + + /** Enum value Exchange. */ + EXCHANGE("Exchange"), + + /** Enum value Sharepoint. */ + SHAREPOINT("Sharepoint"), + + /** Enum value DPMUnknown. */ + DPMUNKNOWN("DPMUnknown"); + + /** The actual serialized value for a BackupItemType instance. */ + private String value; + + BackupItemType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a BackupItemType instance. + * + * @param value the serialized value to parse. + * @return the parsed BackupItemType object, or null if unable to parse. + */ + @JsonCreator + public static BackupItemType fromString(String value) { + BackupItemType[] items = BackupItemType.values(); + for (BackupItemType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupManagementType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupManagementType.java new file mode 100644 index 000000000000..af7f01b22dc6 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupManagementType.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for BackupManagementType. + */ +public enum BackupManagementType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AzureIaasVM. */ + AZURE_IAAS_VM("AzureIaasVM"), + + /** Enum value MAB. */ + MAB("MAB"), + + /** Enum value DPM. */ + DPM("DPM"), + + /** Enum value AzureBackupServer. */ + AZURE_BACKUP_SERVER("AzureBackupServer"), + + /** Enum value AzureSql. */ + AZURE_SQL("AzureSql"); + + /** The actual serialized value for a BackupManagementType instance. */ + private String value; + + BackupManagementType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a BackupManagementType instance. + * + * @param value the serialized value to parse. + * @return the parsed BackupManagementType object, or null if unable to parse. + */ + @JsonCreator + public static BackupManagementType fromString(String value) { + BackupManagementType[] items = BackupManagementType.values(); + for (BackupManagementType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupOperationResults.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupOperationResults.java new file mode 100644 index 000000000000..d0702291b70f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupOperationResults.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.BackupOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupOperationResults. + */ +public interface BackupOperationResults extends HasInner { + /** + * Provides the status of the delete operations, for example, deleting a backup item. Once the operation starts, the response status code is Accepted. The response status code remains in this state until the operation reaches completion. On successful completion, the status code changes to OK. This method expects OperationID as an argument. OperationID is part of the Location header of the operation response. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable getAsync(String vaultName, String resourceGroupName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupOperationStatuses.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupOperationStatuses.java new file mode 100644 index 000000000000..d94a8320db4f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupOperationStatuses.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.BackupOperationStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BackupOperationStatuses. + */ +public interface BackupOperationStatuses extends HasInner { + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be In progress, Completed or Failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupPolicyVaultOperationStatus.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupPolicyVaultOperationStatus.java new file mode 100644 index 000000000000..bfe4a1851906 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupPolicyVaultOperationStatus.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.OperationStatusInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import org.joda.time.DateTime; + +/** + * Type representing BackupPolicyVaultOperationStatus. + */ +public interface BackupPolicyVaultOperationStatus extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the error value. + */ + OperationStatusError error(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + OperationStatusExtendedInfo properties(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + OperationStatusValues status(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupPolicyVaultProtectionPolicyResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupPolicyVaultProtectionPolicyResource.java new file mode 100644 index 000000000000..d832adb29c80 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupPolicyVaultProtectionPolicyResource.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing BackupPolicyVaultProtectionPolicyResource. + */ +public interface BackupPolicyVaultProtectionPolicyResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectionPolicyInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupRequest.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupRequest.java new file mode 100644 index 000000000000..b9e947d86508 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupRequest.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for a backup request. Workload-specific backup requests are + * derived from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("BackupRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IaasVMBackupRequest", value = IaasVMBackupRequest.class) +}) +public class BackupRequest { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupRequestResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupRequestResource.java new file mode 100644 index 000000000000..23c0823da1f0 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/BackupRequestResource.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for the backup request. Workload-specific backup requests are + * derived from this class. + */ +@SkipParentValidation +public class BackupRequestResource extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private BackupRequest properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public BackupRequest properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the BackupRequestResource object itself. + */ + public BackupRequestResource withProperties(BackupRequest properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the BackupRequestResource object itself. + */ + public BackupRequestResource withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the BackupRequestResource object itself. + */ + public BackupRequestResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the BackupRequestResource object itself. + */ + public BackupRequestResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the BackupRequestResource object itself. + */ + public BackupRequestResource withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Backups.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Backups.java new file mode 100644 index 000000000000..1b151d1dc942 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Backups.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.BackupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Backups. + */ +public interface Backups extends HasInner { + /** + * Triggers the backup job for the specified backup item. This is an asynchronous operation. To know the status of the operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this POST operation. + * @param resourceBackupRequest The resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource resourceBackupRequest); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ClientScriptForConnect.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ClientScriptForConnect.java new file mode 100644 index 000000000000..00a094f5a12e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ClientScriptForConnect.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Client script details for the file or folder restore. + */ +public class ClientScriptForConnect { + /** + * File content of the client script for file or folder restore. + */ + @JsonProperty(value = "scriptContent") + private String scriptContent; + + /** + * File extension of the client script for the file or folder restore. Some + * examples of the extension are: .ps1 and .sh. + */ + @JsonProperty(value = "scriptExtension") + private String scriptExtension; + + /** + * The operating system platform ("Windows" or "Linux") for which this file + * or folder restore client script works. + */ + @JsonProperty(value = "osType") + private String osType; + + /** + * Get file content of the client script for file or folder restore. + * + * @return the scriptContent value + */ + public String scriptContent() { + return this.scriptContent; + } + + /** + * Set file content of the client script for file or folder restore. + * + * @param scriptContent the scriptContent value to set + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withScriptContent(String scriptContent) { + this.scriptContent = scriptContent; + return this; + } + + /** + * Get file extension of the client script for the file or folder restore. Some examples of the extension are: .ps1 and .sh. + * + * @return the scriptExtension value + */ + public String scriptExtension() { + return this.scriptExtension; + } + + /** + * Set file extension of the client script for the file or folder restore. Some examples of the extension are: .ps1 and .sh. + * + * @param scriptExtension the scriptExtension value to set + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withScriptExtension(String scriptExtension) { + this.scriptExtension = scriptExtension; + return this; + } + + /** + * Get the operating system platform ("Windows" or "Linux") for which this file or folder restore client script works. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set the operating system platform ("Windows" or "Linux") for which this file or folder restore client script works. + * + * @param osType the osType value to set + * @return the ClientScriptForConnect object itself. + */ + public ClientScriptForConnect withOsType(String osType) { + this.osType = osType; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DailyRetentionFormat.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DailyRetentionFormat.java new file mode 100644 index 000000000000..97ab47b0e12b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DailyRetentionFormat.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Daily retention format. + */ +public class DailyRetentionFormat { + /** + * List of days of the month. + */ + @JsonProperty(value = "daysOfTheMonth") + private List daysOfTheMonth; + + /** + * Get list of days of the month. + * + * @return the daysOfTheMonth value + */ + public List daysOfTheMonth() { + return this.daysOfTheMonth; + } + + /** + * Set list of days of the month. + * + * @param daysOfTheMonth the daysOfTheMonth value to set + * @return the DailyRetentionFormat object itself. + */ + public DailyRetentionFormat withDaysOfTheMonth(List daysOfTheMonth) { + this.daysOfTheMonth = daysOfTheMonth; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DailyRetentionSchedule.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DailyRetentionSchedule.java new file mode 100644 index 000000000000..fdad7b4b6586 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DailyRetentionSchedule.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Daily retention schedule. + */ +public class DailyRetentionSchedule { + /** + * The retention times of retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * The retention duration of retention policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get the retention times of retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set the retention times of retention policy. + * + * @param retentionTimes the retentionTimes value to set + * @return the DailyRetentionSchedule object itself. + */ + public DailyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get the retention duration of retention policy. + * + * @return the retentionDuration value + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set the retention duration of retention policy. + * + * @param retentionDuration the retentionDuration value to set + * @return the DailyRetentionSchedule object itself. + */ + public DailyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DataSourceType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DataSourceType.java new file mode 100644 index 000000000000..d795aa5a30e8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DataSourceType.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataSourceType. + */ +public enum DataSourceType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value VM. */ + VM("VM"), + + /** Enum value FileFolder. */ + FILE_FOLDER("FileFolder"), + + /** Enum value AzureSqlDb. */ + AZURE_SQL_DB("AzureSqlDb"), + + /** Enum value SQLDB. */ + SQLDB("SQLDB"), + + /** Enum value Exchange. */ + EXCHANGE("Exchange"), + + /** Enum value Sharepoint. */ + SHAREPOINT("Sharepoint"), + + /** Enum value DPMUnknown. */ + DPMUNKNOWN("DPMUnknown"); + + /** The actual serialized value for a DataSourceType instance. */ + private String value; + + DataSourceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataSourceType instance. + * + * @param value the serialized value to parse. + * @return the parsed DataSourceType object, or null if unable to parse. + */ + @JsonCreator + public static DataSourceType fromString(String value) { + DataSourceType[] items = DataSourceType.values(); + for (DataSourceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Day.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Day.java new file mode 100644 index 000000000000..8c6e5c9b5fd0 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Day.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Day of the week. + */ +public class Day { + /** + * The dateProperty property. + */ + @JsonProperty(value = "date") + private Integer dateProperty; + + /** + * The isLast property. + */ + @JsonProperty(value = "isLast") + private Boolean isLast; + + /** + * Get the dateProperty value. + * + * @return the dateProperty value + */ + public Integer dateProperty() { + return this.dateProperty; + } + + /** + * Set the dateProperty value. + * + * @param dateProperty the dateProperty value to set + * @return the Day object itself. + */ + public Day withDateProperty(Integer dateProperty) { + this.dateProperty = dateProperty; + return this; + } + + /** + * Get the isLast value. + * + * @return the isLast value + */ + public Boolean isLast() { + return this.isLast; + } + + /** + * Set the isLast value. + * + * @param isLast the isLast value to set + * @return the Day object itself. + */ + public Day withIsLast(Boolean isLast) { + this.isLast = isLast; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DayOfWeek.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DayOfWeek.java new file mode 100644 index 000000000000..1de811a2420d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DayOfWeek.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DayOfWeek. + */ +public enum DayOfWeek { + /** Enum value Sunday. */ + SUNDAY("Sunday"), + + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"); + + /** The actual serialized value for a DayOfWeek instance. */ + private String value; + + DayOfWeek(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DayOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DayOfWeek object, or null if unable to parse. + */ + @JsonCreator + public static DayOfWeek fromString(String value) { + DayOfWeek[] items = DayOfWeek.values(); + for (DayOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmBackupEngine.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmBackupEngine.java new file mode 100644 index 000000000000..dc785469e754 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmBackupEngine.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The backup engine type when Data Protection Manager (DPM) is used to manage + * backups. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupEngineType") +@JsonTypeName("DpmBackupEngine") +public class DpmBackupEngine extends BackupEngineBase { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmErrorInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmErrorInfo.java new file mode 100644 index 000000000000..a8c52e20cbda --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmErrorInfo.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DPM workload-specific error information. + */ +public class DpmErrorInfo { + /** + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /** + * The list of localized recommendations for the error string. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get localized error string. + * + * @return the errorString value + */ + public String errorString() { + return this.errorString; + } + + /** + * Set localized error string. + * + * @param errorString the errorString value to set + * @return the DpmErrorInfo object itself. + */ + public DpmErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get the list of localized recommendations for the error string. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set the list of localized recommendations for the error string. + * + * @param recommendations the recommendations value to set + * @return the DpmErrorInfo object itself. + */ + public DpmErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJob.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJob.java new file mode 100644 index 000000000000..df1993743c54 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJob.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.Period; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobInner; + +/** + * The DPM workload-specific job object. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("DpmJob") +public class DpmJob extends JobInner { + /** + * The time elapsed for the job. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * DPM server name managing the backup item or backup job. + */ + @JsonProperty(value = "dpmServerName") + private String dpmServerName; + + /** + * The name of the cluster or server protecting the current backup item, if + * any. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * The type of container. + */ + @JsonProperty(value = "containerType") + private String containerType; + + /** + * The type of backup item. + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /** + * The state or actions applicable on this job, such as Cancel or Retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /** + * The errors. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Additional information for this job. + */ + @JsonProperty(value = "extendedInfo") + private DpmJobExtendedInfo extendedInfo; + + /** + * Get the time elapsed for the job. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set the time elapsed for the job. + * + * @param duration the duration value to set + * @return the DpmJob object itself. + */ + public DpmJob withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get dPM server name managing the backup item or backup job. + * + * @return the dpmServerName value + */ + public String dpmServerName() { + return this.dpmServerName; + } + + /** + * Set dPM server name managing the backup item or backup job. + * + * @param dpmServerName the dpmServerName value to set + * @return the DpmJob object itself. + */ + public DpmJob withDpmServerName(String dpmServerName) { + this.dpmServerName = dpmServerName; + return this; + } + + /** + * Get the name of the cluster or server protecting the current backup item, if any. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the name of the cluster or server protecting the current backup item, if any. + * + * @param containerName the containerName value to set + * @return the DpmJob object itself. + */ + public DpmJob withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the type of container. + * + * @return the containerType value + */ + public String containerType() { + return this.containerType; + } + + /** + * Set the type of container. + * + * @param containerType the containerType value to set + * @return the DpmJob object itself. + */ + public DpmJob withContainerType(String containerType) { + this.containerType = containerType; + return this; + } + + /** + * Get the type of backup item. + * + * @return the workloadType value + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set the type of backup item. + * + * @param workloadType the workloadType value to set + * @return the DpmJob object itself. + */ + public DpmJob withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the state or actions applicable on this job, such as Cancel or Retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the state or actions applicable on this job, such as Cancel or Retry. + * + * @param actionsInfo the actionsInfo value to set + * @return the DpmJob object itself. + */ + public DpmJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the errors. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errors. + * + * @param errorDetails the errorDetails value to set + * @return the DpmJob object itself. + */ + public DpmJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get additional information for this job. + * + * @return the extendedInfo value + */ + public DpmJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for this job. + * + * @param extendedInfo the extendedInfo value to set + * @return the DpmJob object itself. + */ + public DpmJob withExtendedInfo(DpmJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJobExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJobExtendedInfo.java new file mode 100644 index 000000000000..6eefad624267 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJobExtendedInfo.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information on the DPM workload-specific job. + */ +public class DpmJobExtendedInfo { + /** + * List of tasks associated with this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /** + * The job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /** + * Non-localized error message on job execution. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get list of tasks associated with this job. + * + * @return the tasksList value + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set list of tasks associated with this job. + * + * @param tasksList the tasksList value to set + * @return the DpmJobExtendedInfo object itself. + */ + public DpmJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get the job properties. + * + * @return the propertyBag value + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the job properties. + * + * @param propertyBag the propertyBag value to set + * @return the DpmJobExtendedInfo object itself. + */ + public DpmJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get non-localized error message on job execution. + * + * @return the dynamicErrorMessage value + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set non-localized error message on job execution. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set + * @return the DpmJobExtendedInfo object itself. + */ + public DpmJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJobTaskDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJobTaskDetails.java new file mode 100644 index 000000000000..511edbca67a9 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/DpmJobTaskDetails.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DPM workload-specific job task details. + */ +public class DpmJobTaskDetails { + /** + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /** + * The start time. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The time elapsed for task. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the task display name. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the task display name. + * + * @param taskId the taskId value to set + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time. + * + * @param startTime the startTime value to set + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time. + * + * @param endTime the endTime value to set + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the time elapsed for task. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set the time elapsed for task. + * + * @param duration the duration value to set + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get the status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status. + * + * @param status the status value to set + * @return the DpmJobTaskDetails object itself. + */ + public DpmJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/EncryptionDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/EncryptionDetails.java new file mode 100644 index 000000000000..05489378cc5e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/EncryptionDetails.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details needed if the VM was encrypted at the time of backup. + */ +public class EncryptionDetails { + /** + * Identifies whether the backup copy represents an encrypted VM at the + * time of backup. + */ + @JsonProperty(value = "encryptionEnabled") + private Boolean encryptionEnabled; + + /** + * URL of the Key Encryption Key (KEK). + */ + @JsonProperty(value = "kekUrl") + private String kekUrl; + + /** + * URL of the Bitlocker Encryption Key (BEK). + */ + @JsonProperty(value = "secretKeyUrl") + private String secretKeyUrl; + + /** + * The ID of Key Vault where the Key Encryption Key (KEK) is stored. + */ + @JsonProperty(value = "kekVaultId") + private String kekVaultId; + + /** + * The ID of Key Vault where the Bitlocker Encryption Key (BEK), or Secret, + * is stored. + */ + @JsonProperty(value = "secretKeyVaultId") + private String secretKeyVaultId; + + /** + * Get identifies whether the backup copy represents an encrypted VM at the time of backup. + * + * @return the encryptionEnabled value + */ + public Boolean encryptionEnabled() { + return this.encryptionEnabled; + } + + /** + * Set identifies whether the backup copy represents an encrypted VM at the time of backup. + * + * @param encryptionEnabled the encryptionEnabled value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withEncryptionEnabled(Boolean encryptionEnabled) { + this.encryptionEnabled = encryptionEnabled; + return this; + } + + /** + * Get uRL of the Key Encryption Key (KEK). + * + * @return the kekUrl value + */ + public String kekUrl() { + return this.kekUrl; + } + + /** + * Set uRL of the Key Encryption Key (KEK). + * + * @param kekUrl the kekUrl value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekUrl(String kekUrl) { + this.kekUrl = kekUrl; + return this; + } + + /** + * Get uRL of the Bitlocker Encryption Key (BEK). + * + * @return the secretKeyUrl value + */ + public String secretKeyUrl() { + return this.secretKeyUrl; + } + + /** + * Set uRL of the Bitlocker Encryption Key (BEK). + * + * @param secretKeyUrl the secretKeyUrl value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withSecretKeyUrl(String secretKeyUrl) { + this.secretKeyUrl = secretKeyUrl; + return this; + } + + /** + * Get the ID of Key Vault where the Key Encryption Key (KEK) is stored. + * + * @return the kekVaultId value + */ + public String kekVaultId() { + return this.kekVaultId; + } + + /** + * Set the ID of Key Vault where the Key Encryption Key (KEK) is stored. + * + * @param kekVaultId the kekVaultId value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withKekVaultId(String kekVaultId) { + this.kekVaultId = kekVaultId; + return this; + } + + /** + * Get the ID of Key Vault where the Bitlocker Encryption Key (BEK), or Secret, is stored. + * + * @return the secretKeyVaultId value + */ + public String secretKeyVaultId() { + return this.secretKeyVaultId; + } + + /** + * Set the ID of Key Vault where the Bitlocker Encryption Key (BEK), or Secret, is stored. + * + * @param secretKeyVaultId the secretKeyVaultId value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withSecretKeyVaultId(String secretKeyVaultId) { + this.secretKeyVaultId = secretKeyVaultId; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ExportJobsOperationResultInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ExportJobsOperationResultInfo.java new file mode 100644 index 000000000000..2c1785afae93 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ExportJobsOperationResultInfo.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * This class is used to send blob details after exporting jobs. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("ExportJobsOperationResultInfo") +public class ExportJobsOperationResultInfo extends OperationResultInfoBase { + /** + * The URL of the blob. The serialized string, which is the list of jobs, + * is exported to this URL. + */ + @JsonProperty(value = "blobUrl") + private String blobUrl; + + /** + * The Shared Access Signatures (SAS) key used to access the blob. The key + * expires after 15 minutes. + */ + @JsonProperty(value = "blobSasKey") + private String blobSasKey; + + /** + * Get the URL of the blob. The serialized string, which is the list of jobs, is exported to this URL. + * + * @return the blobUrl value + */ + public String blobUrl() { + return this.blobUrl; + } + + /** + * Set the URL of the blob. The serialized string, which is the list of jobs, is exported to this URL. + * + * @param blobUrl the blobUrl value to set + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withBlobUrl(String blobUrl) { + this.blobUrl = blobUrl; + return this; + } + + /** + * Get the Shared Access Signatures (SAS) key used to access the blob. The key expires after 15 minutes. + * + * @return the blobSasKey value + */ + public String blobSasKey() { + return this.blobSasKey; + } + + /** + * Set the Shared Access Signatures (SAS) key used to access the blob. The key expires after 15 minutes. + * + * @param blobSasKey the blobSasKey value to set + * @return the ExportJobsOperationResultInfo object itself. + */ + public ExportJobsOperationResultInfo withBlobSasKey(String blobSasKey) { + this.blobSasKey = blobSasKey; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ExportJobsOperationResults.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ExportJobsOperationResults.java new file mode 100644 index 000000000000..b80217bf55a0 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ExportJobsOperationResults.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ExportJobsOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExportJobsOperationResults. + */ +public interface ExportJobsOperationResults extends HasInner { + /** + * Gets the result of the operation triggered by the ExportJob API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID associated with the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/GenericRecoveryPoint.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/GenericRecoveryPoint.java new file mode 100644 index 000000000000..8bdfd6d8027a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/GenericRecoveryPoint.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryPointInner; + +/** + * Generic backup copy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("GenericRecoveryPoint") +public class GenericRecoveryPoint extends RecoveryPointInner { + /** + * Friendly name of the backup copy. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * Type of the backup copy. + */ + @JsonProperty(value = "recoveryPointType") + private String recoveryPointType; + + /** + * The time when this backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime") + private DateTime recoveryPointTime; + + /** + * Additional information associated with this backup copy. + */ + @JsonProperty(value = "recoveryPointAdditionalInfo") + private String recoveryPointAdditionalInfo; + + /** + * Get friendly name of the backup copy. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the backup copy. + * + * @param friendlyName the friendlyName value to set + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get type of the backup copy. + * + * @return the recoveryPointType value + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set type of the backup copy. + * + * @param recoveryPointType the recoveryPointType value to set + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withRecoveryPointType(String recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the time when this backup copy was created. + * + * @return the recoveryPointTime value + */ + public DateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the time when this backup copy was created. + * + * @param recoveryPointTime the recoveryPointTime value to set + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withRecoveryPointTime(DateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Set additional information associated with this backup copy. + * + * @param recoveryPointAdditionalInfo the recoveryPointAdditionalInfo value to set + * @return the GenericRecoveryPoint object itself. + */ + public GenericRecoveryPoint withRecoveryPointAdditionalInfo(String recoveryPointAdditionalInfo) { + this.recoveryPointAdditionalInfo = recoveryPointAdditionalInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/GetProtectedItemQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/GetProtectedItemQueryObject.java new file mode 100644 index 000000000000..842d2dc54d01 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/GetProtectedItemQueryObject.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This object filters the list of backup items. + */ +public class GetProtectedItemQueryObject { + /** + * Specifies if the additional information should be provided for this + * item. + */ + @JsonProperty(value = "expand") + private String expand; + + /** + * Get specifies if the additional information should be provided for this item. + * + * @return the expand value + */ + public String expand() { + return this.expand; + } + + /** + * Set specifies if the additional information should be provided for this item. + * + * @param expand the expand value to set + * @return the GetProtectedItemQueryObject object itself. + */ + public GetProtectedItemQueryObject withExpand(String expand) { + this.expand = expand; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/HttpStatusCode.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/HttpStatusCode.java new file mode 100644 index 000000000000..45efea3e47ef --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/HttpStatusCode.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HttpStatusCode. + */ +public enum HttpStatusCode { + /** Enum value Continue. */ + CONTINUE("Continue"), + + /** Enum value SwitchingProtocols. */ + SWITCHING_PROTOCOLS("SwitchingProtocols"), + + /** Enum value OK. */ + OK("OK"), + + /** Enum value Created. */ + CREATED("Created"), + + /** Enum value Accepted. */ + ACCEPTED("Accepted"), + + /** Enum value NonAuthoritativeInformation. */ + NON_AUTHORITATIVE_INFORMATION("NonAuthoritativeInformation"), + + /** Enum value NoContent. */ + NO_CONTENT("NoContent"), + + /** Enum value ResetContent. */ + RESET_CONTENT("ResetContent"), + + /** Enum value PartialContent. */ + PARTIAL_CONTENT("PartialContent"), + + /** Enum value MultipleChoices. */ + MULTIPLE_CHOICES("MultipleChoices"), + + /** Enum value Ambiguous. */ + AMBIGUOUS("Ambiguous"), + + /** Enum value MovedPermanently. */ + MOVED_PERMANENTLY("MovedPermanently"), + + /** Enum value Moved. */ + MOVED("Moved"), + + /** Enum value Found. */ + FOUND("Found"), + + /** Enum value Redirect. */ + REDIRECT("Redirect"), + + /** Enum value SeeOther. */ + SEE_OTHER("SeeOther"), + + /** Enum value RedirectMethod. */ + REDIRECT_METHOD("RedirectMethod"), + + /** Enum value NotModified. */ + NOT_MODIFIED("NotModified"), + + /** Enum value UseProxy. */ + USE_PROXY("UseProxy"), + + /** Enum value Unused. */ + UNUSED("Unused"), + + /** Enum value TemporaryRedirect. */ + TEMPORARY_REDIRECT("TemporaryRedirect"), + + /** Enum value RedirectKeepVerb. */ + REDIRECT_KEEP_VERB("RedirectKeepVerb"), + + /** Enum value BadRequest. */ + BAD_REQUEST("BadRequest"), + + /** Enum value Unauthorized. */ + UNAUTHORIZED("Unauthorized"), + + /** Enum value PaymentRequired. */ + PAYMENT_REQUIRED("PaymentRequired"), + + /** Enum value Forbidden. */ + FORBIDDEN("Forbidden"), + + /** Enum value NotFound. */ + NOT_FOUND("NotFound"), + + /** Enum value MethodNotAllowed. */ + METHOD_NOT_ALLOWED("MethodNotAllowed"), + + /** Enum value NotAcceptable. */ + NOT_ACCEPTABLE("NotAcceptable"), + + /** Enum value ProxyAuthenticationRequired. */ + PROXY_AUTHENTICATION_REQUIRED("ProxyAuthenticationRequired"), + + /** Enum value RequestTimeout. */ + REQUEST_TIMEOUT("RequestTimeout"), + + /** Enum value Conflict. */ + CONFLICT("Conflict"), + + /** Enum value Gone. */ + GONE("Gone"), + + /** Enum value LengthRequired. */ + LENGTH_REQUIRED("LengthRequired"), + + /** Enum value PreconditionFailed. */ + PRECONDITION_FAILED("PreconditionFailed"), + + /** Enum value RequestEntityTooLarge. */ + REQUEST_ENTITY_TOO_LARGE("RequestEntityTooLarge"), + + /** Enum value RequestUriTooLong. */ + REQUEST_URI_TOO_LONG("RequestUriTooLong"), + + /** Enum value UnsupportedMediaType. */ + UNSUPPORTED_MEDIA_TYPE("UnsupportedMediaType"), + + /** Enum value RequestedRangeNotSatisfiable. */ + REQUESTED_RANGE_NOT_SATISFIABLE("RequestedRangeNotSatisfiable"), + + /** Enum value ExpectationFailed. */ + EXPECTATION_FAILED("ExpectationFailed"), + + /** Enum value UpgradeRequired. */ + UPGRADE_REQUIRED("UpgradeRequired"), + + /** Enum value InternalServerError. */ + INTERNAL_SERVER_ERROR("InternalServerError"), + + /** Enum value NotImplemented. */ + NOT_IMPLEMENTED("NotImplemented"), + + /** Enum value BadGateway. */ + BAD_GATEWAY("BadGateway"), + + /** Enum value ServiceUnavailable. */ + SERVICE_UNAVAILABLE("ServiceUnavailable"), + + /** Enum value GatewayTimeout. */ + GATEWAY_TIMEOUT("GatewayTimeout"), + + /** Enum value HttpVersionNotSupported. */ + HTTP_VERSION_NOT_SUPPORTED("HttpVersionNotSupported"); + + /** The actual serialized value for a HttpStatusCode instance. */ + private String value; + + HttpStatusCode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpStatusCode instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpStatusCode object, or null if unable to parse. + */ + @JsonCreator + public static HttpStatusCode fromString(String value) { + HttpStatusCode[] items = HttpStatusCode.values(); + for (HttpStatusCode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ILRRequest.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ILRRequest.java new file mode 100644 index 000000000000..e08c123f392f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ILRRequest.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Parameters to restore file or folders API. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("ILRRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IaasVMILRRegistrationRequest", value = IaasVMILRRegistrationRequest.class) +}) +public class ILRRequest { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ILRRequestResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ILRRequestResource.java new file mode 100644 index 000000000000..9cd3e8a5f887 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ILRRequestResource.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The parameters to restore files or folders. + */ +@SkipParentValidation +public class ILRRequestResource extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private ILRRequest properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public ILRRequest properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the ILRRequestResource object itself. + */ + public ILRRequestResource withProperties(ILRRequest properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the ILRRequestResource object itself. + */ + public ILRRequestResource withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the ILRRequestResource object itself. + */ + public ILRRequestResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the ILRRequestResource object itself. + */ + public ILRRequestResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the ILRRequestResource object itself. + */ + public ILRRequestResource withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaaSVMContainer.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaaSVMContainer.java new file mode 100644 index 000000000000..f7607cfcd016 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaaSVMContainer.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerInner; + +/** + * IaaS VM workload-specific container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableObjectType") +@JsonTypeName("IaaSVMContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMContainer.class), + @JsonSubTypes.Type(name = "Microsoft.ClassicCompute/virtualMachines", value = AzureIaaSClassicComputeVMContainer.class) +}) +public class IaaSVMContainer extends ProtectionContainerInner { + /** + * The fully qualified Resource Manager URL of the virtual machine + * represented by this Azure IaaS VM container. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * Specifies whether the container represents a classic or a Resource + * Manager-deployed virtual machine. + */ + @JsonProperty(value = "virtualMachineVersion") + private String virtualMachineVersion; + + /** + * The resource group name associated with the Recovery Services vault. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /** + * Get the fully qualified Resource Manager URL of the virtual machine represented by this Azure IaaS VM container. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the fully qualified Resource Manager URL of the virtual machine represented by this Azure IaaS VM container. + * + * @param virtualMachineId the virtualMachineId value to set + * @return the IaaSVMContainer object itself. + */ + public IaaSVMContainer withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Get specifies whether the container represents a classic or a Resource Manager-deployed virtual machine. + * + * @return the virtualMachineVersion value + */ + public String virtualMachineVersion() { + return this.virtualMachineVersion; + } + + /** + * Set specifies whether the container represents a classic or a Resource Manager-deployed virtual machine. + * + * @param virtualMachineVersion the virtualMachineVersion value to set + * @return the IaaSVMContainer object itself. + */ + public IaaSVMContainer withVirtualMachineVersion(String virtualMachineVersion) { + this.virtualMachineVersion = virtualMachineVersion; + return this; + } + + /** + * Get the resource group name associated with the Recovery Services vault. + * + * @return the resourceGroup value + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resource group name associated with the Recovery Services vault. + * + * @param resourceGroup the resourceGroup value to set + * @return the IaaSVMContainer object itself. + */ + public IaaSVMContainer withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaaSVMProtectableItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaaSVMProtectableItem.java new file mode 100644 index 000000000000..d5d2f97e9d98 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaaSVMProtectableItem.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * This Azure VM workload-specific (also known as IaaS VM workload-specific) + * backup item can be backed up. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("IaaSVMProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Microsoft.Compute/virtualMachines", value = AzureIaaSComputeVMProtectableItem.class), + @JsonSubTypes.Type(name = "Microsoft.ClassicCompute/virtualMachines", value = AzureIaaSClassicComputeVMProtectableItem.class) +}) +public class IaaSVMProtectableItem extends WorkloadProtectableItem { + /** + * The fully qualified Resource Manager ID of the virtual machine. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * Get the fully qualified Resource Manager ID of the virtual machine. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the fully qualified Resource Manager ID of the virtual machine. + * + * @param virtualMachineId the virtualMachineId value to set + * @return the IaaSVMProtectableItem object itself. + */ + public IaaSVMProtectableItem withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMBackupRequest.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMBackupRequest.java new file mode 100644 index 000000000000..5e993f7fc43e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMBackupRequest.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * This is an Azure VM (also known as IaaS VM) workload-specific backup + * request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMBackupRequest") +public class IaasVMBackupRequest extends BackupRequest { + /** + * The backup copy will expire after the time specified. The time is in UTC + * format. + */ + @JsonProperty(value = "recoveryPointExpiryTimeInUTC") + private DateTime recoveryPointExpiryTimeInUTC; + + /** + * Get the backup copy will expire after the time specified. The time is in UTC format. + * + * @return the recoveryPointExpiryTimeInUTC value + */ + public DateTime recoveryPointExpiryTimeInUTC() { + return this.recoveryPointExpiryTimeInUTC; + } + + /** + * Set the backup copy will expire after the time specified. The time is in UTC format. + * + * @param recoveryPointExpiryTimeInUTC the recoveryPointExpiryTimeInUTC value to set + * @return the IaasVMBackupRequest object itself. + */ + public IaasVMBackupRequest withRecoveryPointExpiryTimeInUTC(DateTime recoveryPointExpiryTimeInUTC) { + this.recoveryPointExpiryTimeInUTC = recoveryPointExpiryTimeInUTC; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMILRRegistrationRequest.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMILRRegistrationRequest.java new file mode 100644 index 000000000000..d2efe2f437e2 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMILRRegistrationRequest.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Restore files or folders from a backup copy, or recovery point, of an IaaS + * (or Azure) VM. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMILRRegistrationRequest") +public class IaasVMILRRegistrationRequest extends ILRRequest { + /** + * The ID of the IaaS VM recovery point used to restore the files or + * folders. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** + * The fully qualified Resource Manager ID of the VM used to restore the + * files or folders. + */ + @JsonProperty(value = "virtualMachineId") + private String virtualMachineId; + + /** + * The iSCSI initiator name. + */ + @JsonProperty(value = "initiatorName") + private String initiatorName; + + /** + * Whether to renew the existing registration with the iSCSI server. + */ + @JsonProperty(value = "renewExistingRegistration") + private Boolean renewExistingRegistration; + + /** + * Get the ID of the IaaS VM recovery point used to restore the files or folders. + * + * @return the recoveryPointId value + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the ID of the IaaS VM recovery point used to restore the files or folders. + * + * @param recoveryPointId the recoveryPointId value to set + * @return the IaasVMILRRegistrationRequest object itself. + */ + public IaasVMILRRegistrationRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the fully qualified Resource Manager ID of the VM used to restore the files or folders. + * + * @return the virtualMachineId value + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Set the fully qualified Resource Manager ID of the VM used to restore the files or folders. + * + * @param virtualMachineId the virtualMachineId value to set + * @return the IaasVMILRRegistrationRequest object itself. + */ + public IaasVMILRRegistrationRequest withVirtualMachineId(String virtualMachineId) { + this.virtualMachineId = virtualMachineId; + return this; + } + + /** + * Get the iSCSI initiator name. + * + * @return the initiatorName value + */ + public String initiatorName() { + return this.initiatorName; + } + + /** + * Set the iSCSI initiator name. + * + * @param initiatorName the initiatorName value to set + * @return the IaasVMILRRegistrationRequest object itself. + */ + public IaasVMILRRegistrationRequest withInitiatorName(String initiatorName) { + this.initiatorName = initiatorName; + return this; + } + + /** + * Get whether to renew the existing registration with the iSCSI server. + * + * @return the renewExistingRegistration value + */ + public Boolean renewExistingRegistration() { + return this.renewExistingRegistration; + } + + /** + * Set whether to renew the existing registration with the iSCSI server. + * + * @param renewExistingRegistration the renewExistingRegistration value to set + * @return the IaasVMILRRegistrationRequest object itself. + */ + public IaasVMILRRegistrationRequest withRenewExistingRegistration(Boolean renewExistingRegistration) { + this.renewExistingRegistration = renewExistingRegistration; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMRecoveryPoint.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMRecoveryPoint.java new file mode 100644 index 000000000000..341660ba7ad0 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMRecoveryPoint.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryPointInner; + +/** + * Azure VM (also known as IaaS VM) workload-specific backup copy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMRecoveryPoint") +public class IaasVMRecoveryPoint extends RecoveryPointInner { + /** + * Type of the backup copy. + */ + @JsonProperty(value = "recoveryPointType") + private String recoveryPointType; + + /** + * The date and time when the backup copy was created. + */ + @JsonProperty(value = "recoveryPointTime") + private DateTime recoveryPointTime; + + /** + * Additional information associated with this backup copy. + */ + @JsonProperty(value = "recoveryPointAdditionalInfo") + private String recoveryPointAdditionalInfo; + + /** + * The storage type for the VM whose backup copy was created. + */ + @JsonProperty(value = "sourceVMStorageType") + private String sourceVMStorageType; + + /** + * Identifies whether the VM was encrypted when the backup copy is created. + */ + @JsonProperty(value = "isSourceVMEncrypted") + private Boolean isSourceVMEncrypted; + + /** + * Required details for recovering an encrypted VM. Applicable only when + * IsSourceVMEncrypted is true. + */ + @JsonProperty(value = "keyAndSecret") + private KeyAndSecretDetails keyAndSecret; + + /** + * Answer to the question - Is the session to recover items from this + * backup copy still active. + */ + @JsonProperty(value = "isInstantILRSessionActive") + private Boolean isInstantILRSessionActive; + + /** + * Get type of the backup copy. + * + * @return the recoveryPointType value + */ + public String recoveryPointType() { + return this.recoveryPointType; + } + + /** + * Set type of the backup copy. + * + * @param recoveryPointType the recoveryPointType value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointType(String recoveryPointType) { + this.recoveryPointType = recoveryPointType; + return this; + } + + /** + * Get the date and time when the backup copy was created. + * + * @return the recoveryPointTime value + */ + public DateTime recoveryPointTime() { + return this.recoveryPointTime; + } + + /** + * Set the date and time when the backup copy was created. + * + * @param recoveryPointTime the recoveryPointTime value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointTime(DateTime recoveryPointTime) { + this.recoveryPointTime = recoveryPointTime; + return this; + } + + /** + * Get additional information associated with this backup copy. + * + * @return the recoveryPointAdditionalInfo value + */ + public String recoveryPointAdditionalInfo() { + return this.recoveryPointAdditionalInfo; + } + + /** + * Set additional information associated with this backup copy. + * + * @param recoveryPointAdditionalInfo the recoveryPointAdditionalInfo value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withRecoveryPointAdditionalInfo(String recoveryPointAdditionalInfo) { + this.recoveryPointAdditionalInfo = recoveryPointAdditionalInfo; + return this; + } + + /** + * Get the storage type for the VM whose backup copy was created. + * + * @return the sourceVMStorageType value + */ + public String sourceVMStorageType() { + return this.sourceVMStorageType; + } + + /** + * Set the storage type for the VM whose backup copy was created. + * + * @param sourceVMStorageType the sourceVMStorageType value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withSourceVMStorageType(String sourceVMStorageType) { + this.sourceVMStorageType = sourceVMStorageType; + return this; + } + + /** + * Get identifies whether the VM was encrypted when the backup copy is created. + * + * @return the isSourceVMEncrypted value + */ + public Boolean isSourceVMEncrypted() { + return this.isSourceVMEncrypted; + } + + /** + * Set identifies whether the VM was encrypted when the backup copy is created. + * + * @param isSourceVMEncrypted the isSourceVMEncrypted value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withIsSourceVMEncrypted(Boolean isSourceVMEncrypted) { + this.isSourceVMEncrypted = isSourceVMEncrypted; + return this; + } + + /** + * Get required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + * + * @return the keyAndSecret value + */ + public KeyAndSecretDetails keyAndSecret() { + return this.keyAndSecret; + } + + /** + * Set required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. + * + * @param keyAndSecret the keyAndSecret value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withKeyAndSecret(KeyAndSecretDetails keyAndSecret) { + this.keyAndSecret = keyAndSecret; + return this; + } + + /** + * Get answer to the question - Is the session to recover items from this backup copy still active. + * + * @return the isInstantILRSessionActive value + */ + public Boolean isInstantILRSessionActive() { + return this.isInstantILRSessionActive; + } + + /** + * Set answer to the question - Is the session to recover items from this backup copy still active. + * + * @param isInstantILRSessionActive the isInstantILRSessionActive value to set + * @return the IaasVMRecoveryPoint object itself. + */ + public IaasVMRecoveryPoint withIsInstantILRSessionActive(Boolean isInstantILRSessionActive) { + this.isInstantILRSessionActive = isInstantILRSessionActive; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMRestoreRequest.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMRestoreRequest.java new file mode 100644 index 000000000000..40ba535b7f4e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/IaasVMRestoreRequest.java @@ -0,0 +1,383 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IaaS VM workload-specific restore. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("IaasVMRestoreRequest") +public class IaasVMRestoreRequest extends RestoreRequest { + /** + * The ID of the backup copy to be recovered. + */ + @JsonProperty(value = "recoveryPointId") + private String recoveryPointId; + + /** + * The type of this recovery. Possible values include: 'Invalid', + * 'OriginalLocation', 'AlternateLocation', 'RestoreDisks'. + */ + @JsonProperty(value = "recoveryType") + private RecoveryType recoveryType; + + /** + * The fully qualified Resource Manager ID of the VM being recovered. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * The complete Resource Manager ID of the VM that will be created. + * For example: + * /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + */ + @JsonProperty(value = "targetVirtualMachineId") + private String targetVirtualMachineId; + + /** + * The Resource Manager ID of the resource group you're creating for this + * VM and other artifacts. + * For example: /subscriptions/{subId}/resourcegroups/{rg}. + */ + @JsonProperty(value = "targetResourceGroupId") + private String targetResourceGroupId; + + /** + * The fully qualified Resource Manager ID of the storage account where the + * VM will be restored. + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /** + * This is the virtual network ID of the vnet that is attached to the + * virtual machine. + * Your join action permissions are validated during the linked access. + */ + @JsonProperty(value = "virtualNetworkId") + private String virtualNetworkId; + + /** + * Subnet ID is the identifier for the VM to be restored. For Classic VMs + * the subnet ID would be {VnetID}/Subnet/{SubnetName}, and for the + * Resource Manager VMs, the subnet ID would be the Resource Manager + * resource ID used to represent the subnet. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** + * The fully qualified Resource Manager ID of the domain name to be + * associated with the VM being restored. Use the Resource Manager ID to + * identify the domain, only for Classic-deployed virtual machines. + */ + @JsonProperty(value = "targetDomainNameId") + private String targetDomainNameId; + + /** + * The region where the virtual machine is restored. + */ + @JsonProperty(value = "region") + private String region; + + /** + * The affinity group associated with the VM to be restored. Affinity + * groups are used only for Classic-deployed virtual machines. + */ + @JsonProperty(value = "affinityGroup") + private String affinityGroup; + + /** + * Asks the question if a new cloud service should be created while + * restoring the VM. If the answer is false, the VM is restored to the same + * cloud service. + */ + @JsonProperty(value = "createNewCloudService") + private Boolean createNewCloudService; + + /** + * If the VM was encrypted at the time of backup, these details are needed. + */ + @JsonProperty(value = "encryptionDetails") + private EncryptionDetails encryptionDetails; + + /** + * Get the ID of the backup copy to be recovered. + * + * @return the recoveryPointId value + */ + public String recoveryPointId() { + return this.recoveryPointId; + } + + /** + * Set the ID of the backup copy to be recovered. + * + * @param recoveryPointId the recoveryPointId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRecoveryPointId(String recoveryPointId) { + this.recoveryPointId = recoveryPointId; + return this; + } + + /** + * Get the type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks'. + * + * @return the recoveryType value + */ + public RecoveryType recoveryType() { + return this.recoveryType; + } + + /** + * Set the type of this recovery. Possible values include: 'Invalid', 'OriginalLocation', 'AlternateLocation', 'RestoreDisks'. + * + * @param recoveryType the recoveryType value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRecoveryType(RecoveryType recoveryType) { + this.recoveryType = recoveryType; + return this; + } + + /** + * Get the fully qualified Resource Manager ID of the VM being recovered. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the fully qualified Resource Manager ID of the VM being recovered. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the complete Resource Manager ID of the VM that will be created. + For example: /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @return the targetVirtualMachineId value + */ + public String targetVirtualMachineId() { + return this.targetVirtualMachineId; + } + + /** + * Set the complete Resource Manager ID of the VM that will be created. + For example: /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + * + * @param targetVirtualMachineId the targetVirtualMachineId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { + this.targetVirtualMachineId = targetVirtualMachineId; + return this; + } + + /** + * Get the Resource Manager ID of the resource group you're creating for this VM and other artifacts. + For example: /subscriptions/{subId}/resourcegroups/{rg}. + * + * @return the targetResourceGroupId value + */ + public String targetResourceGroupId() { + return this.targetResourceGroupId; + } + + /** + * Set the Resource Manager ID of the resource group you're creating for this VM and other artifacts. + For example: /subscriptions/{subId}/resourcegroups/{rg}. + * + * @param targetResourceGroupId the targetResourceGroupId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetResourceGroupId(String targetResourceGroupId) { + this.targetResourceGroupId = targetResourceGroupId; + return this; + } + + /** + * Get the fully qualified Resource Manager ID of the storage account where the VM will be restored. + * + * @return the storageAccountId value + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the fully qualified Resource Manager ID of the storage account where the VM will be restored. + * + * @param storageAccountId the storageAccountId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get this is the virtual network ID of the vnet that is attached to the virtual machine. + Your join action permissions are validated during the linked access. + * + * @return the virtualNetworkId value + */ + public String virtualNetworkId() { + return this.virtualNetworkId; + } + + /** + * Set this is the virtual network ID of the vnet that is attached to the virtual machine. + Your join action permissions are validated during the linked access. + * + * @param virtualNetworkId the virtualNetworkId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withVirtualNetworkId(String virtualNetworkId) { + this.virtualNetworkId = virtualNetworkId; + return this; + } + + /** + * Get subnet ID is the identifier for the VM to be restored. For Classic VMs the subnet ID would be {VnetID}/Subnet/{SubnetName}, and for the Resource Manager VMs, the subnet ID would be the Resource Manager resource ID used to represent the subnet. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set subnet ID is the identifier for the VM to be restored. For Classic VMs the subnet ID would be {VnetID}/Subnet/{SubnetName}, and for the Resource Manager VMs, the subnet ID would be the Resource Manager resource ID used to represent the subnet. + * + * @param subnetId the subnetId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the fully qualified Resource Manager ID of the domain name to be associated with the VM being restored. Use the Resource Manager ID to identify the domain, only for Classic-deployed virtual machines. + * + * @return the targetDomainNameId value + */ + public String targetDomainNameId() { + return this.targetDomainNameId; + } + + /** + * Set the fully qualified Resource Manager ID of the domain name to be associated with the VM being restored. Use the Resource Manager ID to identify the domain, only for Classic-deployed virtual machines. + * + * @param targetDomainNameId the targetDomainNameId value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withTargetDomainNameId(String targetDomainNameId) { + this.targetDomainNameId = targetDomainNameId; + return this; + } + + /** + * Get the region where the virtual machine is restored. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set the region where the virtual machine is restored. + * + * @param region the region value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the affinity group associated with the VM to be restored. Affinity groups are used only for Classic-deployed virtual machines. + * + * @return the affinityGroup value + */ + public String affinityGroup() { + return this.affinityGroup; + } + + /** + * Set the affinity group associated with the VM to be restored. Affinity groups are used only for Classic-deployed virtual machines. + * + * @param affinityGroup the affinityGroup value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withAffinityGroup(String affinityGroup) { + this.affinityGroup = affinityGroup; + return this; + } + + /** + * Get asks the question if a new cloud service should be created while restoring the VM. If the answer is false, the VM is restored to the same cloud service. + * + * @return the createNewCloudService value + */ + public Boolean createNewCloudService() { + return this.createNewCloudService; + } + + /** + * Set asks the question if a new cloud service should be created while restoring the VM. If the answer is false, the VM is restored to the same cloud service. + * + * @param createNewCloudService the createNewCloudService value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withCreateNewCloudService(Boolean createNewCloudService) { + this.createNewCloudService = createNewCloudService; + return this; + } + + /** + * Get if the VM was encrypted at the time of backup, these details are needed. + * + * @return the encryptionDetails value + */ + public EncryptionDetails encryptionDetails() { + return this.encryptionDetails; + } + + /** + * Set if the VM was encrypted at the time of backup, these details are needed. + * + * @param encryptionDetails the encryptionDetails value to set + * @return the IaasVMRestoreRequest object itself. + */ + public IaasVMRestoreRequest withEncryptionDetails(EncryptionDetails encryptionDetails) { + this.encryptionDetails = encryptionDetails; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/InstantItemRecoveryTarget.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/InstantItemRecoveryTarget.java new file mode 100644 index 000000000000..148a09624410 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/InstantItemRecoveryTarget.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Target details for the file or folder restore. + */ +public class InstantItemRecoveryTarget { + /** + * List of client scripts. + */ + @JsonProperty(value = "clientScripts") + private List clientScripts; + + /** + * Get list of client scripts. + * + * @return the clientScripts value + */ + public List clientScripts() { + return this.clientScripts; + } + + /** + * Set list of client scripts. + * + * @param clientScripts the clientScripts value to set + * @return the InstantItemRecoveryTarget object itself. + */ + public InstantItemRecoveryTarget withClientScripts(List clientScripts) { + this.clientScripts = clientScripts; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ItemLevelRecoveryConnections.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ItemLevelRecoveryConnections.java new file mode 100644 index 000000000000..c87b8fc9ea01 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ItemLevelRecoveryConnections.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ItemLevelRecoveryConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ItemLevelRecoveryConnections. + */ +public interface ItemLevelRecoveryConnections extends HasInner { + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. The value allowed is Azure. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup items whose files or folders will be restored. + * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable revokeAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId); + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup item whose files or folders are to be restored. + * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data. + * @param resourceILRRequest The resource Item Level Recovery (ILR) request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable provisionAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobCancellations.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobCancellations.java new file mode 100644 index 000000000000..f85e102f8a64 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobCancellations.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobCancellationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing JobCancellations. + */ +public interface JobCancellations extends HasInner { + /** + * Cancels the job. This is an asynchronous operation. To know the status of the cancellation, call the GetCancelOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable triggerAsync(String vaultName, String resourceGroupName, String jobName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobDetails.java new file mode 100644 index 000000000000..83c4441faab9 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobDetails.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobDetailsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing JobDetails. + */ +public interface JobDetails extends HasInner { + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String jobName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobOperationResults.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobOperationResults.java new file mode 100644 index 000000000000..14bfb5d1cb0d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobOperationResults.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing JobOperationResults. + */ +public interface JobOperationResults extends HasInner { + /** + * Gets the result of the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Job name associated with this GET operation. + * @param operationId OperationID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable getAsync(String vaultName, String resourceGroupName, String jobName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobOperationType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobOperationType.java new file mode 100644 index 000000000000..e0a2f3f7322b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobOperationType.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobOperationType. + */ +public enum JobOperationType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value ConfigureBackup. */ + CONFIGURE_BACKUP("ConfigureBackup"), + + /** Enum value Backup. */ + BACKUP("Backup"), + + /** Enum value Restore. */ + RESTORE("Restore"), + + /** Enum value DisableBackup. */ + DISABLE_BACKUP("DisableBackup"), + + /** Enum value DeleteBackupData. */ + DELETE_BACKUP_DATA("DeleteBackupData"); + + /** The actual serialized value for a JobOperationType instance. */ + private String value; + + JobOperationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobOperationType instance. + * + * @param value the serialized value to parse. + * @return the parsed JobOperationType object, or null if unable to parse. + */ + @JsonCreator + public static JobOperationType fromString(String value) { + JobOperationType[] items = JobOperationType.values(); + for (JobOperationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobQueryObject.java new file mode 100644 index 000000000000..7601d9217c1c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobQueryObject.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The filters to list the jobs. + */ +public class JobQueryObject { + /** + * Status of the job. Possible values include: 'Invalid', 'InProgress', + * 'Completed', 'Failed', 'CompletedWithWarnings', 'Cancelled', + * 'Cancelling'. + */ + @JsonProperty(value = "status") + private JobStatus status; + + /** + * Type of backup management for the job. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The type of operation. Possible values include: 'Invalid', + * 'ConfigureBackup', 'Backup', 'Restore', 'DisableBackup', + * 'DeleteBackupData'. + */ + @JsonProperty(value = "operation") + private JobOperationType operation; + + /** + * The ID of the job. Each jobID is unique. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /** + * The time when the job starts. The value is in UTC. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The time when the job ends. The value is in UTC. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Get status of the job. Possible values include: 'Invalid', 'InProgress', 'Completed', 'Failed', 'CompletedWithWarnings', 'Cancelled', 'Cancelling'. + * + * @return the status value + */ + public JobStatus status() { + return this.status; + } + + /** + * Set status of the job. Possible values include: 'Invalid', 'InProgress', 'Completed', 'Failed', 'CompletedWithWarnings', 'Cancelled', 'Cancelling'. + * + * @param status the status value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withStatus(JobStatus status) { + this.status = status; + return this; + } + + /** + * Get type of backup management for the job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set type of backup management for the job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the type of operation. Possible values include: 'Invalid', 'ConfigureBackup', 'Backup', 'Restore', 'DisableBackup', 'DeleteBackupData'. + * + * @return the operation value + */ + public JobOperationType operation() { + return this.operation; + } + + /** + * Set the type of operation. Possible values include: 'Invalid', 'ConfigureBackup', 'Backup', 'Restore', 'DisableBackup', 'DeleteBackupData'. + * + * @param operation the operation value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withOperation(JobOperationType operation) { + this.operation = operation; + return this; + } + + /** + * Get the ID of the job. Each jobID is unique. + * + * @return the jobId value + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the ID of the job. Each jobID is unique. + * + * @param jobId the jobId value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the time when the job starts. The value is in UTC. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the time when the job starts. The value is in UTC. + * + * @param startTime the startTime value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the time when the job ends. The value is in UTC. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the time when the job ends. The value is in UTC. + * + * @param endTime the endTime value to set + * @return the JobQueryObject object itself. + */ + public JobQueryObject withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobStatus.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobStatus.java new file mode 100644 index 000000000000..ef10d6789594 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobStatus.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobStatus. + */ +public enum JobStatus { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value CompletedWithWarnings. */ + COMPLETED_WITH_WARNINGS("CompletedWithWarnings"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"), + + /** Enum value Cancelling. */ + CANCELLING("Cancelling"); + + /** The actual serialized value for a JobStatus instance. */ + private String value; + + JobStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed JobStatus object, or null if unable to parse. + */ + @JsonCreator + public static JobStatus fromString(String value) { + JobStatus[] items = JobStatus.values(); + for (JobStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobSupportedAction.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobSupportedAction.java new file mode 100644 index 000000000000..30fc43f1403f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/JobSupportedAction.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobSupportedAction. + */ +public enum JobSupportedAction { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Cancellable. */ + CANCELLABLE("Cancellable"), + + /** Enum value Retriable. */ + RETRIABLE("Retriable"); + + /** The actual serialized value for a JobSupportedAction instance. */ + private String value; + + JobSupportedAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobSupportedAction instance. + * + * @param value the serialized value to parse. + * @return the parsed JobSupportedAction object, or null if unable to parse. + */ + @JsonCreator + public static JobSupportedAction fromString(String value) { + JobSupportedAction[] items = JobSupportedAction.values(); + for (JobSupportedAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Jobs.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Jobs.java new file mode 100644 index 000000000000..188beaae731b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Jobs.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; +import rx.Completable; + +/** + * Type representing Jobs. + */ +public interface Jobs extends HasInner { + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String vaultName, final String resourceGroupName); + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable exportAsync(String vaultName, String resourceGroupName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/KEKDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/KEKDetails.java new file mode 100644 index 000000000000..cba427a7d320 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/KEKDetails.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Key Encryption Key (KEK) is the encryption key for the Bitlocker + * Encryption Key (BEK). + */ +public class KEKDetails { + /** + * Key refers to the Key Encryption Key (KEK). The KEK is the Key to unlock + * the Secret. + */ + @JsonProperty(value = "keyUrl") + private String keyUrl; + + /** + * Key Vault ID identifies where the KEK is stored. + */ + @JsonProperty(value = "keyVaultId") + private String keyVaultId; + + /** + * Key Backup Data refers to Key Encryption Key (KEK) data. + */ + @JsonProperty(value = "keyBackupData") + private String keyBackupData; + + /** + * Get key refers to the Key Encryption Key (KEK). The KEK is the Key to unlock the Secret. + * + * @return the keyUrl value + */ + public String keyUrl() { + return this.keyUrl; + } + + /** + * Set key refers to the Key Encryption Key (KEK). The KEK is the Key to unlock the Secret. + * + * @param keyUrl the keyUrl value to set + * @return the KEKDetails object itself. + */ + public KEKDetails withKeyUrl(String keyUrl) { + this.keyUrl = keyUrl; + return this; + } + + /** + * Get key Vault ID identifies where the KEK is stored. + * + * @return the keyVaultId value + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set key Vault ID identifies where the KEK is stored. + * + * @param keyVaultId the keyVaultId value to set + * @return the KEKDetails object itself. + */ + public KEKDetails withKeyVaultId(String keyVaultId) { + this.keyVaultId = keyVaultId; + return this; + } + + /** + * Get key Backup Data refers to Key Encryption Key (KEK) data. + * + * @return the keyBackupData value + */ + public String keyBackupData() { + return this.keyBackupData; + } + + /** + * Set key Backup Data refers to Key Encryption Key (KEK) data. + * + * @param keyBackupData the keyBackupData value to set + * @return the KEKDetails object itself. + */ + public KEKDetails withKeyBackupData(String keyBackupData) { + this.keyBackupData = keyBackupData; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/KeyAndSecretDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/KeyAndSecretDetails.java new file mode 100644 index 000000000000..c4faf93e14c4 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/KeyAndSecretDetails.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BEK stands for Bitlocker Encryption Key. + * KEK stands for Key Encryption Key. KEK is the encryption key used to protect + * the Secret for the BEK + * If the VM is encrypted, then the service stores the following details : + * 1. Secret(BEK) - Url + Backup Data + vaultID. + * 2. Key(KEK) - Url + Backup Data + vaultID. + * It is possible for the BEK and KEK to have different vaultIDs. + */ +public class KeyAndSecretDetails { + /** + * The Key Encryption Key (KEK) is the encryption key for the Bitlocker + * Encryption Key (BEK). + */ + @JsonProperty(value = "kekDetails") + private KEKDetails kekDetails; + + /** + * BEK is Bitlocker Encryption Key. + */ + @JsonProperty(value = "bekDetails") + private BEKDetails bekDetails; + + /** + * Get the Key Encryption Key (KEK) is the encryption key for the Bitlocker Encryption Key (BEK). + * + * @return the kekDetails value + */ + public KEKDetails kekDetails() { + return this.kekDetails; + } + + /** + * Set the Key Encryption Key (KEK) is the encryption key for the Bitlocker Encryption Key (BEK). + * + * @param kekDetails the kekDetails value to set + * @return the KeyAndSecretDetails object itself. + */ + public KeyAndSecretDetails withKekDetails(KEKDetails kekDetails) { + this.kekDetails = kekDetails; + return this; + } + + /** + * Get bEK is Bitlocker Encryption Key. + * + * @return the bekDetails value + */ + public BEKDetails bekDetails() { + return this.bekDetails; + } + + /** + * Set bEK is Bitlocker Encryption Key. + * + * @param bekDetails the bekDetails value to set + * @return the KeyAndSecretDetails object itself. + */ + public KeyAndSecretDetails withBekDetails(BEKDetails bekDetails) { + this.bekDetails = bekDetails; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/LongTermRetentionPolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/LongTermRetentionPolicy.java new file mode 100644 index 000000000000..4c7a76f120cf --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/LongTermRetentionPolicy.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Long-term retention policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "retentionPolicyType") +@JsonTypeName("LongTermRetentionPolicy") +public class LongTermRetentionPolicy extends RetentionPolicy { + /** + * Daily retention schedule of the backup policy. + */ + @JsonProperty(value = "dailySchedule") + private DailyRetentionSchedule dailySchedule; + + /** + * Weekly retention schedule of the backup policy. + */ + @JsonProperty(value = "weeklySchedule") + private WeeklyRetentionSchedule weeklySchedule; + + /** + * Monthly retention schedule of the backup policy. + */ + @JsonProperty(value = "monthlySchedule") + private MonthlyRetentionSchedule monthlySchedule; + + /** + * Yearly retention schedule of the backup policy. + */ + @JsonProperty(value = "yearlySchedule") + private YearlyRetentionSchedule yearlySchedule; + + /** + * Get daily retention schedule of the backup policy. + * + * @return the dailySchedule value + */ + public DailyRetentionSchedule dailySchedule() { + return this.dailySchedule; + } + + /** + * Set daily retention schedule of the backup policy. + * + * @param dailySchedule the dailySchedule value to set + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withDailySchedule(DailyRetentionSchedule dailySchedule) { + this.dailySchedule = dailySchedule; + return this; + } + + /** + * Get weekly retention schedule of the backup policy. + * + * @return the weeklySchedule value + */ + public WeeklyRetentionSchedule weeklySchedule() { + return this.weeklySchedule; + } + + /** + * Set weekly retention schedule of the backup policy. + * + * @param weeklySchedule the weeklySchedule value to set + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withWeeklySchedule(WeeklyRetentionSchedule weeklySchedule) { + this.weeklySchedule = weeklySchedule; + return this; + } + + /** + * Get monthly retention schedule of the backup policy. + * + * @return the monthlySchedule value + */ + public MonthlyRetentionSchedule monthlySchedule() { + return this.monthlySchedule; + } + + /** + * Set monthly retention schedule of the backup policy. + * + * @param monthlySchedule the monthlySchedule value to set + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withMonthlySchedule(MonthlyRetentionSchedule monthlySchedule) { + this.monthlySchedule = monthlySchedule; + return this; + } + + /** + * Get yearly retention schedule of the backup policy. + * + * @return the yearlySchedule value + */ + public YearlyRetentionSchedule yearlySchedule() { + return this.yearlySchedule; + } + + /** + * Set yearly retention schedule of the backup policy. + * + * @param yearlySchedule the yearlySchedule value to set + * @return the LongTermRetentionPolicy object itself. + */ + public LongTermRetentionPolicy withYearlySchedule(YearlyRetentionSchedule yearlySchedule) { + this.yearlySchedule = yearlySchedule; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/LongTermSchedulePolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/LongTermSchedulePolicy.java new file mode 100644 index 000000000000..039bea0a5ed8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/LongTermSchedulePolicy.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Long-term policy schedule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType") +@JsonTypeName("LongTermSchedulePolicy") +public class LongTermSchedulePolicy extends SchedulePolicy { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabContainer.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabContainer.java new file mode 100644 index 000000000000..f926113a4b8c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabContainer.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerInner; + +/** + * The container associated with items backed up using Azure Backup Server. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableObjectType") +@JsonTypeName("MABWindowsContainer") +public class MabContainer extends ProtectionContainerInner { + /** + * The container can be registered one more time. + */ + @JsonProperty(value = "canReRegister") + private Boolean canReRegister; + + /** + * The ID for the container. + */ + @JsonProperty(value = "containerId") + private Long containerId; + + /** + * The number of backup items in the container. + */ + @JsonProperty(value = "protectedItemCount") + private Long protectedItemCount; + + /** + * The version of the agent used with this container. + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /** + * Additional information for the container. + */ + @JsonProperty(value = "extendedInfo") + private MabContainerExtendedInfo extendedInfo; + + /** + * Get the container can be registered one more time. + * + * @return the canReRegister value + */ + public Boolean canReRegister() { + return this.canReRegister; + } + + /** + * Set the container can be registered one more time. + * + * @param canReRegister the canReRegister value to set + * @return the MabContainer object itself. + */ + public MabContainer withCanReRegister(Boolean canReRegister) { + this.canReRegister = canReRegister; + return this; + } + + /** + * Get the ID for the container. + * + * @return the containerId value + */ + public Long containerId() { + return this.containerId; + } + + /** + * Set the ID for the container. + * + * @param containerId the containerId value to set + * @return the MabContainer object itself. + */ + public MabContainer withContainerId(Long containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the number of backup items in the container. + * + * @return the protectedItemCount value + */ + public Long protectedItemCount() { + return this.protectedItemCount; + } + + /** + * Set the number of backup items in the container. + * + * @param protectedItemCount the protectedItemCount value to set + * @return the MabContainer object itself. + */ + public MabContainer withProtectedItemCount(Long protectedItemCount) { + this.protectedItemCount = protectedItemCount; + return this; + } + + /** + * Get the version of the agent used with this container. + * + * @return the agentVersion value + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the version of the agent used with this container. + * + * @param agentVersion the agentVersion value to set + * @return the MabContainer object itself. + */ + public MabContainer withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get additional information for the container. + * + * @return the extendedInfo value + */ + public MabContainerExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for the container. + * + * @param extendedInfo the extendedInfo value to set + * @return the MabContainer object itself. + */ + public MabContainer withExtendedInfo(MabContainerExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabContainerExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabContainerExtendedInfo.java new file mode 100644 index 000000000000..99a9ecbef494 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabContainerExtendedInfo.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for the container. + */ +public class MabContainerExtendedInfo { + /** + * The time stamp when this container was refreshed. + */ + @JsonProperty(value = "lastRefreshedAt") + private DateTime lastRefreshedAt; + + /** + * The type of backup items associated with this container. Possible values + * include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', + * 'Exchange', 'Sharepoint', 'DPMUnknown'. + */ + @JsonProperty(value = "backupItemType") + private BackupItemType backupItemType; + + /** + * The list of backup items associated with this container. + */ + @JsonProperty(value = "backupItems") + private List backupItems; + + /** + * The backup policy associated with this container. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * The latest backup status of this container. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * Get the time stamp when this container was refreshed. + * + * @return the lastRefreshedAt value + */ + public DateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set the time stamp when this container was refreshed. + * + * @param lastRefreshedAt the lastRefreshedAt value to set + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withLastRefreshedAt(DateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + + /** + * Get the type of backup items associated with this container. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @return the backupItemType value + */ + public BackupItemType backupItemType() { + return this.backupItemType; + } + + /** + * Set the type of backup items associated with this container. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @param backupItemType the backupItemType value to set + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withBackupItemType(BackupItemType backupItemType) { + this.backupItemType = backupItemType; + return this; + } + + /** + * Get the list of backup items associated with this container. + * + * @return the backupItems value + */ + public List backupItems() { + return this.backupItems; + } + + /** + * Set the list of backup items associated with this container. + * + * @param backupItems the backupItems value to set + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withBackupItems(List backupItems) { + this.backupItems = backupItems; + return this; + } + + /** + * Get the backup policy associated with this container. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the backup policy associated with this container. + * + * @param policyName the policyName value to set + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the latest backup status of this container. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the latest backup status of this container. + * + * @param lastBackupStatus the lastBackupStatus value to set + * @return the MabContainerExtendedInfo object itself. + */ + public MabContainerExtendedInfo withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabErrorInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabErrorInfo.java new file mode 100644 index 000000000000..ea16ee65659a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabErrorInfo.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Backup Server workload-specific error information. + */ +public class MabErrorInfo { + /** + * Localized error string. + */ + @JsonProperty(value = "errorString") + private String errorString; + + /** + * List of localized recommendations. + */ + @JsonProperty(value = "recommendations") + private List recommendations; + + /** + * Get localized error string. + * + * @return the errorString value + */ + public String errorString() { + return this.errorString; + } + + /** + * Set localized error string. + * + * @param errorString the errorString value to set + * @return the MabErrorInfo object itself. + */ + public MabErrorInfo withErrorString(String errorString) { + this.errorString = errorString; + return this; + } + + /** + * Get list of localized recommendations. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Set list of localized recommendations. + * + * @param recommendations the recommendations value to set + * @return the MabErrorInfo object itself. + */ + public MabErrorInfo withRecommendations(List recommendations) { + this.recommendations = recommendations; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabFileFolderProtectedItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabFileFolderProtectedItem.java new file mode 100644 index 000000000000..bd9211e5fa82 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabFileFolderProtectedItem.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemInner; + +/** + * This is a file or folder workload-specific backup item. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("MabFileFolderProtectedItem") +public class MabFileFolderProtectedItem extends ProtectedItemInner { + /** + * The friendly name of this backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The name of the computer associated with this backup item. + */ + @JsonProperty(value = "computerName") + private String computerName; + + /** + * The status of last backup operation. + */ + @JsonProperty(value = "lastBackupStatus") + private String lastBackupStatus; + + /** + * The states for this property are: Protected, ProtectionStopped, + * IRPending, or ProtectionError. + */ + @JsonProperty(value = "protectionState") + private String protectionState; + + /** + * The isScheduledForDeferredDelete property. + */ + @JsonProperty(value = "isScheduledForDeferredDelete") + private Boolean isScheduledForDeferredDelete; + + /** + * Additional information for this backup item. + */ + @JsonProperty(value = "extendedInfo") + private MabFileFolderProtectedItemExtendedInfo extendedInfo; + + /** + * Get the friendly name of this backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name of this backup item. + * + * @param friendlyName the friendlyName value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the name of the computer associated with this backup item. + * + * @return the computerName value + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the name of the computer associated with this backup item. + * + * @param computerName the computerName value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the status of last backup operation. + * + * @return the lastBackupStatus value + */ + public String lastBackupStatus() { + return this.lastBackupStatus; + } + + /** + * Set the status of last backup operation. + * + * @param lastBackupStatus the lastBackupStatus value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withLastBackupStatus(String lastBackupStatus) { + this.lastBackupStatus = lastBackupStatus; + return this; + } + + /** + * Get the states for this property are: Protected, ProtectionStopped, IRPending, or ProtectionError. + * + * @return the protectionState value + */ + public String protectionState() { + return this.protectionState; + } + + /** + * Set the states for this property are: Protected, ProtectionStopped, IRPending, or ProtectionError. + * + * @param protectionState the protectionState value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withProtectionState(String protectionState) { + this.protectionState = protectionState; + return this; + } + + /** + * Get the isScheduledForDeferredDelete value. + * + * @return the isScheduledForDeferredDelete value + */ + public Boolean isScheduledForDeferredDelete() { + return this.isScheduledForDeferredDelete; + } + + /** + * Set the isScheduledForDeferredDelete value. + * + * @param isScheduledForDeferredDelete the isScheduledForDeferredDelete value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { + this.isScheduledForDeferredDelete = isScheduledForDeferredDelete; + return this; + } + + /** + * Get additional information for this backup item. + * + * @return the extendedInfo value + */ + public MabFileFolderProtectedItemExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information for this backup item. + * + * @param extendedInfo the extendedInfo value to set + * @return the MabFileFolderProtectedItem object itself. + */ + public MabFileFolderProtectedItem withExtendedInfo(MabFileFolderProtectedItemExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabFileFolderProtectedItemExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabFileFolderProtectedItemExtendedInfo.java new file mode 100644 index 000000000000..cddc23028032 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabFileFolderProtectedItemExtendedInfo.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for the backup item. + */ +public class MabFileFolderProtectedItemExtendedInfo { + /** + * The last day and time the agent synced with the service. + */ + @JsonProperty(value = "lastRefreshedAt") + private DateTime lastRefreshedAt; + + /** + * The oldest backup copy available. + */ + @JsonProperty(value = "oldestRecoveryPoint") + private DateTime oldestRecoveryPoint; + + /** + * The number of backup copies associated with the backup item. + */ + @JsonProperty(value = "recoveryPointCount") + private Integer recoveryPointCount; + + /** + * Get the last day and time the agent synced with the service. + * + * @return the lastRefreshedAt value + */ + public DateTime lastRefreshedAt() { + return this.lastRefreshedAt; + } + + /** + * Set the last day and time the agent synced with the service. + * + * @param lastRefreshedAt the lastRefreshedAt value to set + * @return the MabFileFolderProtectedItemExtendedInfo object itself. + */ + public MabFileFolderProtectedItemExtendedInfo withLastRefreshedAt(DateTime lastRefreshedAt) { + this.lastRefreshedAt = lastRefreshedAt; + return this; + } + + /** + * Get the oldest backup copy available. + * + * @return the oldestRecoveryPoint value + */ + public DateTime oldestRecoveryPoint() { + return this.oldestRecoveryPoint; + } + + /** + * Set the oldest backup copy available. + * + * @param oldestRecoveryPoint the oldestRecoveryPoint value to set + * @return the MabFileFolderProtectedItemExtendedInfo object itself. + */ + public MabFileFolderProtectedItemExtendedInfo withOldestRecoveryPoint(DateTime oldestRecoveryPoint) { + this.oldestRecoveryPoint = oldestRecoveryPoint; + return this; + } + + /** + * Get the number of backup copies associated with the backup item. + * + * @return the recoveryPointCount value + */ + public Integer recoveryPointCount() { + return this.recoveryPointCount; + } + + /** + * Set the number of backup copies associated with the backup item. + * + * @param recoveryPointCount the recoveryPointCount value to set + * @return the MabFileFolderProtectedItemExtendedInfo object itself. + */ + public MabFileFolderProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { + this.recoveryPointCount = recoveryPointCount; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJob.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJob.java new file mode 100644 index 000000000000..577834ecd883 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJob.java @@ -0,0 +1,214 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.Period; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobInner; + +/** + * The Azure Backup Server workload-specific job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("MabJob") +public class MabJob extends JobInner { + /** + * The time required for the job to run. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * The state or actions applicable on jobs such as Cancel or Retry. + */ + @JsonProperty(value = "actionsInfo") + private List actionsInfo; + + /** + * The name of server protecting the data store. + */ + @JsonProperty(value = "mabServerName") + private String mabServerName; + + /** + * Server type of the Azure Backup Server container. Possible values + * include: 'Invalid', 'Unknown', 'IaasVMContainer', + * 'IaasVMServiceContainer', 'DPMContainer', 'DPMVenusContainer', + * 'MABContainer', 'ClusterResource', 'AzureSqlContainer', 'WindowsServer', + * 'Windows'. + */ + @JsonProperty(value = "mabServerType") + private MabServerType mabServerType; + + /** + * Workload type of backup item. Possible values include: 'Invalid', 'VM', + * 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + * 'DPMUnknown'. + */ + @JsonProperty(value = "workloadType") + private WorkloadType workloadType; + + /** + * The errors. + */ + @JsonProperty(value = "errorDetails") + private List errorDetails; + + /** + * Additional information on the job. + */ + @JsonProperty(value = "extendedInfo") + private MabJobExtendedInfo extendedInfo; + + /** + * Get the time required for the job to run. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set the time required for the job to run. + * + * @param duration the duration value to set + * @return the MabJob object itself. + */ + public MabJob withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get the state or actions applicable on jobs such as Cancel or Retry. + * + * @return the actionsInfo value + */ + public List actionsInfo() { + return this.actionsInfo; + } + + /** + * Set the state or actions applicable on jobs such as Cancel or Retry. + * + * @param actionsInfo the actionsInfo value to set + * @return the MabJob object itself. + */ + public MabJob withActionsInfo(List actionsInfo) { + this.actionsInfo = actionsInfo; + return this; + } + + /** + * Get the name of server protecting the data store. + * + * @return the mabServerName value + */ + public String mabServerName() { + return this.mabServerName; + } + + /** + * Set the name of server protecting the data store. + * + * @param mabServerName the mabServerName value to set + * @return the MabJob object itself. + */ + public MabJob withMabServerName(String mabServerName) { + this.mabServerName = mabServerName; + return this; + } + + /** + * Get server type of the Azure Backup Server container. Possible values include: 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', 'DPMVenusContainer', 'MABContainer', 'ClusterResource', 'AzureSqlContainer', 'WindowsServer', 'Windows'. + * + * @return the mabServerType value + */ + public MabServerType mabServerType() { + return this.mabServerType; + } + + /** + * Set server type of the Azure Backup Server container. Possible values include: 'Invalid', 'Unknown', 'IaasVMContainer', 'IaasVMServiceContainer', 'DPMContainer', 'DPMVenusContainer', 'MABContainer', 'ClusterResource', 'AzureSqlContainer', 'WindowsServer', 'Windows'. + * + * @param mabServerType the mabServerType value to set + * @return the MabJob object itself. + */ + public MabJob withMabServerType(MabServerType mabServerType) { + this.mabServerType = mabServerType; + return this; + } + + /** + * Get workload type of backup item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @return the workloadType value + */ + public WorkloadType workloadType() { + return this.workloadType; + } + + /** + * Set workload type of backup item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @param workloadType the workloadType value to set + * @return the MabJob object itself. + */ + public MabJob withWorkloadType(WorkloadType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the errors. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errors. + * + * @param errorDetails the errorDetails value to set + * @return the MabJob object itself. + */ + public MabJob withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get additional information on the job. + * + * @return the extendedInfo value + */ + public MabJobExtendedInfo extendedInfo() { + return this.extendedInfo; + } + + /** + * Set additional information on the job. + * + * @param extendedInfo the extendedInfo value to set + * @return the MabJob object itself. + */ + public MabJob withExtendedInfo(MabJobExtendedInfo extendedInfo) { + this.extendedInfo = extendedInfo; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJobExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJobExtendedInfo.java new file mode 100644 index 000000000000..a61592e383cb --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJobExtendedInfo.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for the Azure Backup Server workload-specific job. + */ +public class MabJobExtendedInfo { + /** + * List of tasks for this job. + */ + @JsonProperty(value = "tasksList") + private List tasksList; + + /** + * The job properties. + */ + @JsonProperty(value = "propertyBag") + private Map propertyBag; + + /** + * Non-localized error message specific to this job. + */ + @JsonProperty(value = "dynamicErrorMessage") + private String dynamicErrorMessage; + + /** + * Get list of tasks for this job. + * + * @return the tasksList value + */ + public List tasksList() { + return this.tasksList; + } + + /** + * Set list of tasks for this job. + * + * @param tasksList the tasksList value to set + * @return the MabJobExtendedInfo object itself. + */ + public MabJobExtendedInfo withTasksList(List tasksList) { + this.tasksList = tasksList; + return this; + } + + /** + * Get the job properties. + * + * @return the propertyBag value + */ + public Map propertyBag() { + return this.propertyBag; + } + + /** + * Set the job properties. + * + * @param propertyBag the propertyBag value to set + * @return the MabJobExtendedInfo object itself. + */ + public MabJobExtendedInfo withPropertyBag(Map propertyBag) { + this.propertyBag = propertyBag; + return this; + } + + /** + * Get non-localized error message specific to this job. + * + * @return the dynamicErrorMessage value + */ + public String dynamicErrorMessage() { + return this.dynamicErrorMessage; + } + + /** + * Set non-localized error message specific to this job. + * + * @param dynamicErrorMessage the dynamicErrorMessage value to set + * @return the MabJobExtendedInfo object itself. + */ + public MabJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) { + this.dynamicErrorMessage = dynamicErrorMessage; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJobTaskDetails.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJobTaskDetails.java new file mode 100644 index 000000000000..e7a86aa7ae30 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabJobTaskDetails.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Backup Server workload-specific job task details. + */ +public class MabJobTaskDetails { + /** + * The task display name. + */ + @JsonProperty(value = "taskId") + private String taskId; + + /** + * The start time. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Time elapsed for task. + */ + @JsonProperty(value = "duration") + private Period duration; + + /** + * The status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the task display name. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the task display name. + * + * @param taskId the taskId value to set + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time. + * + * @param startTime the startTime value to set + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time. + * + * @param endTime the endTime value to set + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get time elapsed for task. + * + * @return the duration value + */ + public Period duration() { + return this.duration; + } + + /** + * Set time elapsed for task. + * + * @param duration the duration value to set + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withDuration(Period duration) { + this.duration = duration; + return this; + } + + /** + * Get the status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status. + * + * @param status the status value to set + * @return the MabJobTaskDetails object itself. + */ + public MabJobTaskDetails withStatus(String status) { + this.status = status; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabProtectionPolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabProtectionPolicy.java new file mode 100644 index 000000000000..e87d641662d2 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabProtectionPolicy.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyInner; + +/** + * The backup policy for the file or folder container. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("MAB") +public class MabProtectionPolicy extends ProtectionPolicyInner { + /** + * The schedule specified in the backup policy. + */ + @JsonProperty(value = "schedulePolicy") + private SchedulePolicy schedulePolicy; + + /** + * The details specified in the Retention policy. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the schedule specified in the backup policy. + * + * @return the schedulePolicy value + */ + public SchedulePolicy schedulePolicy() { + return this.schedulePolicy; + } + + /** + * Set the schedule specified in the backup policy. + * + * @param schedulePolicy the schedulePolicy value to set + * @return the MabProtectionPolicy object itself. + */ + public MabProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { + this.schedulePolicy = schedulePolicy; + return this; + } + + /** + * Get the details specified in the Retention policy. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the details specified in the Retention policy. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the MabProtectionPolicy object itself. + */ + public MabProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabServerType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabServerType.java new file mode 100644 index 000000000000..7cc9a053c562 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MabServerType.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MabServerType. + */ +public enum MabServerType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Unknown. */ + UNKNOWN("Unknown"), + + /** Enum value IaasVMContainer. */ + IAAS_VMCONTAINER("IaasVMContainer"), + + /** Enum value IaasVMServiceContainer. */ + IAAS_VMSERVICE_CONTAINER("IaasVMServiceContainer"), + + /** Enum value DPMContainer. */ + DPMCONTAINER("DPMContainer"), + + /** Enum value DPMVenusContainer. */ + DPMVENUS_CONTAINER("DPMVenusContainer"), + + /** Enum value MABContainer. */ + MABCONTAINER("MABContainer"), + + /** Enum value ClusterResource. */ + CLUSTER_RESOURCE("ClusterResource"), + + /** Enum value AzureSqlContainer. */ + AZURE_SQL_CONTAINER("AzureSqlContainer"), + + /** Enum value WindowsServer. */ + WINDOWS_SERVER("WindowsServer"), + + /** Enum value Windows. */ + WINDOWS("Windows"); + + /** The actual serialized value for a MabServerType instance. */ + private String value; + + MabServerType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MabServerType instance. + * + * @param value the serialized value to parse. + * @return the parsed MabServerType object, or null if unable to parse. + */ + @JsonCreator + public static MabServerType fromString(String value) { + MabServerType[] items = MabServerType.values(); + for (MabServerType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MonthOfYear.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MonthOfYear.java new file mode 100644 index 000000000000..0d2c0440034a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MonthOfYear.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for MonthOfYear. + */ +public enum MonthOfYear { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value January. */ + JANUARY("January"), + + /** Enum value February. */ + FEBRUARY("February"), + + /** Enum value March. */ + MARCH("March"), + + /** Enum value April. */ + APRIL("April"), + + /** Enum value May. */ + MAY("May"), + + /** Enum value June. */ + JUNE("June"), + + /** Enum value July. */ + JULY("July"), + + /** Enum value August. */ + AUGUST("August"), + + /** Enum value September. */ + SEPTEMBER("September"), + + /** Enum value October. */ + OCTOBER("October"), + + /** Enum value November. */ + NOVEMBER("November"), + + /** Enum value December. */ + DECEMBER("December"); + + /** The actual serialized value for a MonthOfYear instance. */ + private String value; + + MonthOfYear(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MonthOfYear instance. + * + * @param value the serialized value to parse. + * @return the parsed MonthOfYear object, or null if unable to parse. + */ + @JsonCreator + public static MonthOfYear fromString(String value) { + MonthOfYear[] items = MonthOfYear.values(); + for (MonthOfYear item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MonthlyRetentionSchedule.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MonthlyRetentionSchedule.java new file mode 100644 index 000000000000..8941e1bb91c6 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/MonthlyRetentionSchedule.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The monthly retention schedule. + */ +public class MonthlyRetentionSchedule { + /** + * Retention schedule format type for monthly retention policy. Possible + * values include: 'Invalid', 'Daily', 'Weekly'. + */ + @JsonProperty(value = "retentionScheduleFormatType") + private RetentionScheduleFormat retentionScheduleFormatType; + + /** + * Daily retention format for the monthly retention policy. + */ + @JsonProperty(value = "retentionScheduleDaily") + private DailyRetentionFormat retentionScheduleDaily; + + /** + * Weekly retention format for the monthly retention policy. + */ + @JsonProperty(value = "retentionScheduleWeekly") + private WeeklyRetentionFormat retentionScheduleWeekly; + + /** + * Retention times of the retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * Retention duration of the retention policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get retention schedule format type for monthly retention policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @return the retentionScheduleFormatType value + */ + public RetentionScheduleFormat retentionScheduleFormatType() { + return this.retentionScheduleFormatType; + } + + /** + * Set retention schedule format type for monthly retention policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @param retentionScheduleFormatType the retentionScheduleFormatType value to set + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionScheduleFormatType(RetentionScheduleFormat retentionScheduleFormatType) { + this.retentionScheduleFormatType = retentionScheduleFormatType; + return this; + } + + /** + * Get daily retention format for the monthly retention policy. + * + * @return the retentionScheduleDaily value + */ + public DailyRetentionFormat retentionScheduleDaily() { + return this.retentionScheduleDaily; + } + + /** + * Set daily retention format for the monthly retention policy. + * + * @param retentionScheduleDaily the retentionScheduleDaily value to set + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionScheduleDaily(DailyRetentionFormat retentionScheduleDaily) { + this.retentionScheduleDaily = retentionScheduleDaily; + return this; + } + + /** + * Get weekly retention format for the monthly retention policy. + * + * @return the retentionScheduleWeekly value + */ + public WeeklyRetentionFormat retentionScheduleWeekly() { + return this.retentionScheduleWeekly; + } + + /** + * Set weekly retention format for the monthly retention policy. + * + * @param retentionScheduleWeekly the retentionScheduleWeekly value to set + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionScheduleWeekly(WeeklyRetentionFormat retentionScheduleWeekly) { + this.retentionScheduleWeekly = retentionScheduleWeekly; + return this; + } + + /** + * Get retention times of the retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set retention times of the retention policy. + * + * @param retentionTimes the retentionTimes value to set + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get retention duration of the retention policy. + * + * @return the retentionDuration value + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set retention duration of the retention policy. + * + * @param retentionDuration the retentionDuration value to set + * @return the MonthlyRetentionSchedule object itself. + */ + public MonthlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfo.java new file mode 100644 index 000000000000..c12f49e51178 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfo.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Information about the result of the operation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationResultInfo") +public class OperationResultInfo extends OperationResultInfoBase { + /** + * List of jobs created by this operation. + */ + @JsonProperty(value = "jobList") + private List jobList; + + /** + * Get list of jobs created by this operation. + * + * @return the jobList value + */ + public List jobList() { + return this.jobList; + } + + /** + * Set list of jobs created by this operation. + * + * @param jobList the jobList value to set + * @return the OperationResultInfo object itself. + */ + public OperationResultInfo withJobList(List jobList) { + this.jobList = jobList; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfoBase.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfoBase.java new file mode 100644 index 000000000000..49ad161b2c22 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfoBase.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for operation result information. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationResultInfoBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "OperationResultInfo", value = OperationResultInfo.class), + @JsonSubTypes.Type(name = "ExportJobsOperationResultInfo", value = ExportJobsOperationResultInfo.class) +}) +public class OperationResultInfoBase { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfoBaseResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfoBaseResource.java new file mode 100644 index 000000000000..f21b458e6da7 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationResultInfoBaseResource.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.OperationResultInfoBaseResourceInner; +import java.util.Map; +import java.util.List; + +/** + * Type representing OperationResultInfoBaseResource. + */ +public interface OperationResultInfoBaseResource extends HasInner, HasManager { + /** + * @return the headers value. + */ + Map> headers(); + + /** + * @return the properties value. + */ + OperationResultInfoBase properties(); + + /** + * @return the statusCode value. + */ + HttpStatusCode statusCode(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusError.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusError.java new file mode 100644 index 000000000000..05ec65938abc --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusError.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error information associated with the operation status call. + */ +public class OperationStatusError { + /** + * The error code for the failed operation. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message for the failed operation. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the error code for the failed operation. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code for the failed operation. + * + * @param code the code value to set + * @return the OperationStatusError object itself. + */ + public OperationStatusError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message for the failed operation. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message for the failed operation. + * + * @param message the message value to set + * @return the OperationStatusError object itself. + */ + public OperationStatusError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusExtendedInfo.java new file mode 100644 index 000000000000..e1f700fd4e06 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusExtendedInfo.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for additional information about the operation status. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusExtendedInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "OperationStatusJobExtendedInfo", value = OperationStatusJobExtendedInfo.class), + @JsonSubTypes.Type(name = "OperationStatusProvisionILRExtendedInfo", value = OperationStatusProvisionILRExtendedInfo.class), + @JsonSubTypes.Type(name = "OperationStatusJobsExtendedInfo", value = OperationStatusJobsExtendedInfo.class) +}) +public class OperationStatusExtendedInfo { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusJobExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusJobExtendedInfo.java new file mode 100644 index 000000000000..7d4554e680db --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusJobExtendedInfo.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Extended information about the operation status job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusJobExtendedInfo") +public class OperationStatusJobExtendedInfo extends OperationStatusExtendedInfo { + /** + * ID of the job created for this backup item. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /** + * Get iD of the job created for this backup item. + * + * @return the jobId value + */ + public String jobId() { + return this.jobId; + } + + /** + * Set iD of the job created for this backup item. + * + * @param jobId the jobId value to set + * @return the OperationStatusJobExtendedInfo object itself. + */ + public OperationStatusJobExtendedInfo withJobId(String jobId) { + this.jobId = jobId; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusJobsExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusJobsExtendedInfo.java new file mode 100644 index 000000000000..7c65b01d77df --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusJobsExtendedInfo.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Operation status extended info for the job list. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusJobsExtendedInfo") +public class OperationStatusJobsExtendedInfo extends OperationStatusExtendedInfo { + /** + * IDs of the jobs created for the backup item. + */ + @JsonProperty(value = "jobIds") + private List jobIds; + + /** + * Stores all the failed jobs along with the corresponding error codes. + */ + @JsonProperty(value = "failedJobsError") + private Map failedJobsError; + + /** + * Get iDs of the jobs created for the backup item. + * + * @return the jobIds value + */ + public List jobIds() { + return this.jobIds; + } + + /** + * Set iDs of the jobs created for the backup item. + * + * @param jobIds the jobIds value to set + * @return the OperationStatusJobsExtendedInfo object itself. + */ + public OperationStatusJobsExtendedInfo withJobIds(List jobIds) { + this.jobIds = jobIds; + return this; + } + + /** + * Get stores all the failed jobs along with the corresponding error codes. + * + * @return the failedJobsError value + */ + public Map failedJobsError() { + return this.failedJobsError; + } + + /** + * Set stores all the failed jobs along with the corresponding error codes. + * + * @param failedJobsError the failedJobsError value to set + * @return the OperationStatusJobsExtendedInfo object itself. + */ + public OperationStatusJobsExtendedInfo withFailedJobsError(Map failedJobsError) { + this.failedJobsError = failedJobsError; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusProvisionILRExtendedInfo.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusProvisionILRExtendedInfo.java new file mode 100644 index 000000000000..4eb491e1ba7b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusProvisionILRExtendedInfo.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Extended information about the Item Level Recovery (ILR) provision action, + * operation status. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("OperationStatusProvisionILRExtendedInfo") +public class OperationStatusProvisionILRExtendedInfo extends OperationStatusExtendedInfo { + /** + * Target details for the file or folder restore. + */ + @JsonProperty(value = "recoveryTarget") + private InstantItemRecoveryTarget recoveryTarget; + + /** + * Get target details for the file or folder restore. + * + * @return the recoveryTarget value + */ + public InstantItemRecoveryTarget recoveryTarget() { + return this.recoveryTarget; + } + + /** + * Set target details for the file or folder restore. + * + * @param recoveryTarget the recoveryTarget value to set + * @return the OperationStatusProvisionILRExtendedInfo object itself. + */ + public OperationStatusProvisionILRExtendedInfo withRecoveryTarget(InstantItemRecoveryTarget recoveryTarget) { + this.recoveryTarget = recoveryTarget; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusValues.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusValues.java new file mode 100644 index 000000000000..2b5cb07b214b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationStatusValues.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OperationStatusValues. + */ +public enum OperationStatusValues { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Canceled. */ + CANCELED("Canceled"); + + /** The actual serialized value for a OperationStatusValues instance. */ + private String value; + + OperationStatusValues(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OperationStatusValues instance. + * + * @param value the serialized value to parse. + * @return the parsed OperationStatusValues object, or null if unable to parse. + */ + @JsonCreator + public static OperationStatusValues fromString(String value) { + OperationStatusValues[] items = OperationStatusValues.values(); + for (OperationStatusValues item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationWorkerResponse.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationWorkerResponse.java new file mode 100644 index 000000000000..e8d59634f86a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/OperationWorkerResponse.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The base class for operation result responses. + */ +public class OperationWorkerResponse { + /** + * The HTTP status code of the operation. Possible values include: + * 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', + * 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', + * 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', + * 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', + * 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', + * 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', + * 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', + * 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', + * 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', + * 'RequestUriTooLong', 'UnsupportedMediaType', + * 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', + * 'InternalServerError', 'NotImplemented', 'BadGateway', + * 'ServiceUnavailable', 'GatewayTimeout', 'HttpVersionNotSupported'. + */ + @JsonProperty(value = "statusCode") + private HttpStatusCode statusCode; + + /** + * The HTTP headers associated with this operation. + */ + @JsonProperty(value = "Headers") + private Map> headers; + + /** + * Get the HTTP status code of the operation. Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HttpVersionNotSupported'. + * + * @return the statusCode value + */ + public HttpStatusCode statusCode() { + return this.statusCode; + } + + /** + * Set the HTTP status code of the operation. Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestUriTooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HttpVersionNotSupported'. + * + * @param statusCode the statusCode value to set + * @return the OperationWorkerResponse object itself. + */ + public OperationWorkerResponse withStatusCode(HttpStatusCode statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the HTTP headers associated with this operation. + * + * @return the headers value + */ + public Map> headers() { + return this.headers; + } + + /** + * Set the HTTP headers associated with this operation. + * + * @param headers the headers value to set + * @return the OperationWorkerResponse object itself. + */ + public OperationWorkerResponse withHeaders(Map> headers) { + this.headers = headers; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectableItems.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectableItems.java new file mode 100644 index 000000000000..db57027c6d5a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectableItems.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectableItemsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectableItems. + */ +public interface ProtectableItems extends HasInner { + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String vaultName, final String resourceGroupName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemOperationResults.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemOperationResults.java new file mode 100644 index 000000000000..a2076330a09d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemOperationResults.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectedItemOperationResults. + */ +public interface ProtectedItemOperationResults extends HasInner { + /** + * Gets the result of any operation on the backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemOperationStatuses.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemOperationStatuses.java new file mode 100644 index 000000000000..a84308439b1f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemOperationStatuses.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemOperationStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectedItemOperationStatuses. + */ +public interface ProtectedItemOperationStatuses extends HasInner { + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be: In progress, Completed, or Failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemQueryObject.java new file mode 100644 index 000000000000..e62bbc126a40 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemQueryObject.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Filters the list of backup items. + */ +public class ProtectedItemQueryObject { + /** + * The backup management type associated with an item. Possible values + * include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', + * 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The workload type associated with an item. Possible values include: + * 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', + * 'Sharepoint', 'DPMUnknown'. + */ + @JsonProperty(value = "itemType") + private DataSourceType itemType; + + /** + * The name of the backup policy associated with the item. + */ + @JsonProperty(value = "policyName") + private String policyName; + + /** + * The name of the container. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * Get the backup management type associated with an item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type associated with an item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the workload type associated with an item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @return the itemType value + */ + public DataSourceType itemType() { + return this.itemType; + } + + /** + * Set the workload type associated with an item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @param itemType the itemType value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withItemType(DataSourceType itemType) { + this.itemType = itemType; + return this; + } + + /** + * Get the name of the backup policy associated with the item. + * + * @return the policyName value + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the name of the backup policy associated with the item. + * + * @param policyName the policyName value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Get the name of the container. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the name of the container. + * + * @param containerName the containerName value to set + * @return the ProtectedItemQueryObject object itself. + */ + public ProtectedItemQueryObject withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemResource.java new file mode 100644 index 000000000000..f359ad878320 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemResource.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing ProtectedItemResource. + */ +public interface ProtectedItemResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectedItemInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemState.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemState.java new file mode 100644 index 000000000000..f5cdd3e840bb --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItemState.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProtectedItemState. + */ +public enum ProtectedItemState { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value IRPending. */ + IRPENDING("IRPending"), + + /** Enum value Protected. */ + PROTECTED("Protected"), + + /** Enum value ProtectionError. */ + PROTECTION_ERROR("ProtectionError"), + + /** Enum value ProtectionStopped. */ + PROTECTION_STOPPED("ProtectionStopped"), + + /** Enum value ProtectionPaused. */ + PROTECTION_PAUSED("ProtectionPaused"); + + /** The actual serialized value for a ProtectedItemState instance. */ + private String value; + + ProtectedItemState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProtectedItemState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProtectedItemState object, or null if unable to parse. + */ + @JsonCreator + public static ProtectedItemState fromString(String value) { + ProtectedItemState[] items = ProtectedItemState.values(); + for (ProtectedItemState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItems.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItems.java new file mode 100644 index 000000000000..96c0d90d48ad --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectedItems.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultProtectedItemResource; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemResourceInner; + +/** + * Type representing ProtectedItems. + */ +public interface ProtectedItems extends HasInner { + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Used to disable the backup job for an item within a container. This is an asynchronous operation. To learn the status of the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String vaultName, final String resourceGroupName); + + /** + * This operation enables an item to be backed up, or modifies the existing backup policy information for an item that has been backed up. This is an asynchronous operation. To learn the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of the backup item. + * @param resourceProtectedItem The resource backup item. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner resourceProtectedItem); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerBackupFabricVaultProtectionContainerResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerBackupFabricVaultProtectionContainerResource.java new file mode 100644 index 000000000000..ba9bc83e3536 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerBackupFabricVaultProtectionContainerResource.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing ProtectionContainerBackupFabricVaultProtectionContainerResource. + */ +public interface ProtectionContainerBackupFabricVaultProtectionContainerResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectionContainerInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerOperationResults.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerOperationResults.java new file mode 100644 index 000000000000..a40bdee049b3 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerOperationResults.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectionContainerOperationResults. + */ +public interface ProtectionContainerOperationResults extends HasInner { + /** + * Gets the result of any operation on the container. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @param operationId The operation ID used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerRefreshOperationResults.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerRefreshOperationResults.java new file mode 100644 index 000000000000..28aa4b1a4da6 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerRefreshOperationResults.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerRefreshOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectionContainerRefreshOperationResults. + */ +public interface ProtectionContainerRefreshOperationResults extends HasInner { + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param operationId The operation ID used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable getAsync(String vaultName, String resourceGroupName, String fabricName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerResource.java new file mode 100644 index 000000000000..decb6f279659 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainerResource.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainerResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing ProtectionContainerResource. + */ +public interface ProtectionContainerResource extends HasInner, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectionContainerInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainers.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainers.java new file mode 100644 index 000000000000..ccb7c1dfae45 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionContainers.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionContainersInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerResource; +import rx.Completable; + +/** + * Type representing ProtectionContainers. + */ +public interface ProtectionContainers extends HasInner { + /** + * Gets details of the specific container registered to your Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName); + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String vaultName, String resourceGroupName); + + /** + * Discovers the containers in the subscription that can be protected in a Recovery Services vault. This is an asynchronous operation. To learn the status of the operation, use the GetRefreshOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable refreshAsync(String vaultName, String resourceGroupName, String fabricName); + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param vaultName The name of the Recovery Services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable unregisterAsync(String resourceGroupName, String vaultName, String identityName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicies.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicies.java new file mode 100644 index 000000000000..8b6dbdaf9303 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicies.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectionPolicies. + */ +public interface ProtectionPolicies extends SupportsCreating, HasInner { + /** + * Gets the details of the backup policy associated with the Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String policyName); + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String vaultName, String resourceGroupName); + + /** + * Deletes the specified backup policy from your Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The name of the backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String vaultName, String resourceGroupName, String policyName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyOperationResults.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyOperationResults.java new file mode 100644 index 000000000000..e46b305641fe --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyOperationResults.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyOperationResultsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectionPolicyOperationResults. + */ +public interface ProtectionPolicyOperationResults extends HasInner { + /** + * Provides the result of an operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String policyName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyOperationStatuses.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyOperationStatuses.java new file mode 100644 index 000000000000..a57d07fcb347 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyOperationStatuses.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyOperationStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProtectionPolicyOperationStatuses. + */ +public interface ProtectionPolicyOperationStatuses extends HasInner { + /** + * Provides the status of the asynchronous operations like backup or restore. The status can be: in progress, completed, or failed. You can refer to the Operation Status enumeration for the possible states of an operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String policyName, String operationId); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyQueryObject.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyQueryObject.java new file mode 100644 index 000000000000..1985bbe22e3c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionPolicyQueryObject.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This object filters the list of backup policies. + */ +public class ProtectionPolicyQueryObject { + /** + * The backup management type associated with the backup policy. Possible + * values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + * 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * Get the backup management type associated with the backup policy. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type associated with the backup policy. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectionPolicyQueryObject object itself. + */ + public ProtectionPolicyQueryObject withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionState.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionState.java new file mode 100644 index 000000000000..22ca2b0e0c86 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionState.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProtectionState. + */ +public enum ProtectionState { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value IRPending. */ + IRPENDING("IRPending"), + + /** Enum value Protected. */ + PROTECTED("Protected"), + + /** Enum value ProtectionError. */ + PROTECTION_ERROR("ProtectionError"), + + /** Enum value ProtectionStopped. */ + PROTECTION_STOPPED("ProtectionStopped"), + + /** Enum value ProtectionPaused. */ + PROTECTION_PAUSED("ProtectionPaused"); + + /** The actual serialized value for a ProtectionState instance. */ + private String value; + + ProtectionState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProtectionState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProtectionState object, or null if unable to parse. + */ + @JsonCreator + public static ProtectionState fromString(String value) { + ProtectionState[] items = ProtectionState.values(); + for (ProtectionState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionStatus.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionStatus.java new file mode 100644 index 000000000000..e6d34f58670d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ProtectionStatus.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProtectionStatus. + */ +public enum ProtectionStatus { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value NotProtected. */ + NOT_PROTECTED("NotProtected"), + + /** Enum value Protecting. */ + PROTECTING("Protecting"), + + /** Enum value Protected. */ + PROTECTED("Protected"); + + /** The actual serialized value for a ProtectionStatus instance. */ + private String value; + + ProtectionStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProtectionStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed ProtectionStatus object, or null if unable to parse. + */ + @JsonCreator + public static ProtectionStatus fromString(String value) { + ProtectionStatus[] items = ProtectionStatus.values(); + for (ProtectionStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryPointResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryPointResource.java new file mode 100644 index 000000000000..93a7ca666ade --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryPointResource.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryPointResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing RecoveryPointResource. + */ +public interface RecoveryPointResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + RecoveryPointInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryPoints.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryPoints.java new file mode 100644 index 000000000000..97a2a710c404 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryPoints.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryPointsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RecoveryPoints. + */ +public interface RecoveryPoints extends HasInner { + /** + * Provides the backup data for the RecoveryPointID. This is an asynchronous operation. To learn the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with backup item. + * @param containerName The container name associated with backup item. + * @param protectedItemName The name of the backup item used in this GET operation. + * @param recoveryPointId The RecoveryPointID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId); + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryType.java new file mode 100644 index 000000000000..e7e847af27ed --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RecoveryType.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RecoveryType. + */ +public enum RecoveryType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value OriginalLocation. */ + ORIGINAL_LOCATION("OriginalLocation"), + + /** Enum value AlternateLocation. */ + ALTERNATE_LOCATION("AlternateLocation"), + + /** Enum value RestoreDisks. */ + RESTORE_DISKS("RestoreDisks"); + + /** The actual serialized value for a RecoveryType instance. */ + private String value; + + RecoveryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecoveryType instance. + * + * @param value the serialized value to parse. + * @return the parsed RecoveryType object, or null if unable to parse. + */ + @JsonCreator + public static RecoveryType fromString(String value) { + RecoveryType[] items = RecoveryType.values(); + for (RecoveryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ResourceList.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ResourceList.java new file mode 100644 index 000000000000..ddae5c963d60 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ResourceList.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base for all lists of resources. + */ +public class ResourceList { + /** + * The URI to GET the next page of resources. Call ListNext() gets the next + * page of resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the URI to GET the next page of resources. Call ListNext() gets the next page of resources. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URI to GET the next page of resources. Call ListNext() gets the next page of resources. + * + * @param nextLink the nextLink value to set + * @return the ResourceList object itself. + */ + public ResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RestoreRequest.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RestoreRequest.java new file mode 100644 index 000000000000..9aa4823b13bc --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RestoreRequest.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for restore requests. Workload-specific restore requests are + * derived from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("RestoreRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IaasVMRestoreRequest", value = IaasVMRestoreRequest.class) +}) +public class RestoreRequest { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RestoreRequestResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RestoreRequestResource.java new file mode 100644 index 000000000000..24f7692ba401 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RestoreRequestResource.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The base class for a restore request. Workload-specific restore requests are + * derived from this class. + */ +@SkipParentValidation +public class RestoreRequestResource extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private RestoreRequest properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public RestoreRequest properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the RestoreRequestResource object itself. + */ + public RestoreRequestResource withProperties(RestoreRequest properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the RestoreRequestResource object itself. + */ + public RestoreRequestResource withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the RestoreRequestResource object itself. + */ + public RestoreRequestResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the RestoreRequestResource object itself. + */ + public RestoreRequestResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the RestoreRequestResource object itself. + */ + public RestoreRequestResource withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Restores.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Restores.java new file mode 100644 index 000000000000..e4ec82844b7a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/Restores.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RestoresInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Restores. + */ +public interface Restores extends HasInner { + /** + * Restores the specified backup data. This is an asynchronous operation. To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The backup item to be restored. + * @param recoveryPointId The recovery point ID for the backup data to be restored. + * @param resourceRestoreRequest The resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource resourceRestoreRequest); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionDuration.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionDuration.java new file mode 100644 index 000000000000..856151ce8766 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionDuration.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Retention duration. + */ +public class RetentionDuration { + /** + * Count of the duration types. Retention duration is determined by the + * combining the Count times and durationType. + * For example, if Count = 3 and durationType = Weeks, then the retention + * duration is three weeks. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * The retention duration type of the retention policy. Possible values + * include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years'. + */ + @JsonProperty(value = "durationType") + private RetentionDurationType durationType; + + /** + * Get count of the duration types. Retention duration is determined by the combining the Count times and durationType. + For example, if Count = 3 and durationType = Weeks, then the retention duration is three weeks. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set count of the duration types. Retention duration is determined by the combining the Count times and durationType. + For example, if Count = 3 and durationType = Weeks, then the retention duration is three weeks. + * + * @param count the count value to set + * @return the RetentionDuration object itself. + */ + public RetentionDuration withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the retention duration type of the retention policy. Possible values include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years'. + * + * @return the durationType value + */ + public RetentionDurationType durationType() { + return this.durationType; + } + + /** + * Set the retention duration type of the retention policy. Possible values include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years'. + * + * @param durationType the durationType value to set + * @return the RetentionDuration object itself. + */ + public RetentionDuration withDurationType(RetentionDurationType durationType) { + this.durationType = durationType; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionDurationType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionDurationType.java new file mode 100644 index 000000000000..e1a5296b91ca --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionDurationType.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RetentionDurationType. + */ +public enum RetentionDurationType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Days. */ + DAYS("Days"), + + /** Enum value Weeks. */ + WEEKS("Weeks"), + + /** Enum value Months. */ + MONTHS("Months"), + + /** Enum value Years. */ + YEARS("Years"); + + /** The actual serialized value for a RetentionDurationType instance. */ + private String value; + + RetentionDurationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RetentionDurationType instance. + * + * @param value the serialized value to parse. + * @return the parsed RetentionDurationType object, or null if unable to parse. + */ + @JsonCreator + public static RetentionDurationType fromString(String value) { + RetentionDurationType[] items = RetentionDurationType.values(); + for (RetentionDurationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionPolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionPolicy.java new file mode 100644 index 000000000000..43aafa3a3b0c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionPolicy.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for retention policy. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "retentionPolicyType") +@JsonTypeName("RetentionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SimpleRetentionPolicy", value = SimpleRetentionPolicy.class), + @JsonSubTypes.Type(name = "LongTermRetentionPolicy", value = LongTermRetentionPolicy.class) +}) +public class RetentionPolicy { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionScheduleFormat.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionScheduleFormat.java new file mode 100644 index 000000000000..795b5c393a4d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/RetentionScheduleFormat.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RetentionScheduleFormat. + */ +public enum RetentionScheduleFormat { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Daily. */ + DAILY("Daily"), + + /** Enum value Weekly. */ + WEEKLY("Weekly"); + + /** The actual serialized value for a RetentionScheduleFormat instance. */ + private String value; + + RetentionScheduleFormat(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RetentionScheduleFormat instance. + * + * @param value the serialized value to parse. + * @return the parsed RetentionScheduleFormat object, or null if unable to parse. + */ + @JsonCreator + public static RetentionScheduleFormat fromString(String value) { + RetentionScheduleFormat[] items = RetentionScheduleFormat.values(); + for (RetentionScheduleFormat item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SchedulePolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SchedulePolicy.java new file mode 100644 index 000000000000..c7efdc2ab651 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SchedulePolicy.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for backup schedules. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType") +@JsonTypeName("SchedulePolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "LongTermSchedulePolicy", value = LongTermSchedulePolicy.class), + @JsonSubTypes.Type(name = "SimpleSchedulePolicy", value = SimpleSchedulePolicy.class) +}) +public class SchedulePolicy { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ScheduleRunType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ScheduleRunType.java new file mode 100644 index 000000000000..dd26d74c0200 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/ScheduleRunType.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ScheduleRunType. + */ +public enum ScheduleRunType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Daily. */ + DAILY("Daily"), + + /** Enum value Weekly. */ + WEEKLY("Weekly"); + + /** The actual serialized value for a ScheduleRunType instance. */ + private String value; + + ScheduleRunType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ScheduleRunType instance. + * + * @param value the serialized value to parse. + * @return the parsed ScheduleRunType object, or null if unable to parse. + */ + @JsonCreator + public static ScheduleRunType fromString(String value) { + ScheduleRunType[] items = ScheduleRunType.values(); + for (ScheduleRunType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SimpleRetentionPolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SimpleRetentionPolicy.java new file mode 100644 index 000000000000..41da1e9accc4 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SimpleRetentionPolicy.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Simple policy retention. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "retentionPolicyType") +@JsonTypeName("SimpleRetentionPolicy") +public class SimpleRetentionPolicy extends RetentionPolicy { + /** + * Retention duration of the protection policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get retention duration of the protection policy. + * + * @return the retentionDuration value + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set retention duration of the protection policy. + * + * @param retentionDuration the retentionDuration value to set + * @return the SimpleRetentionPolicy object itself. + */ + public SimpleRetentionPolicy withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SimpleSchedulePolicy.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SimpleSchedulePolicy.java new file mode 100644 index 000000000000..1f1d37d88c37 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/SimpleSchedulePolicy.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Simple policy schedule. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "schedulePolicyType") +@JsonTypeName("SimpleSchedulePolicy") +public class SimpleSchedulePolicy extends SchedulePolicy { + /** + * Defines the frequency interval (daily or weekly) for the schedule + * policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + */ + @JsonProperty(value = "scheduleRunFrequency") + private ScheduleRunType scheduleRunFrequency; + + /** + * This list is the days of the week when the schedule runs. + */ + @JsonProperty(value = "scheduleRunDays") + private List scheduleRunDays; + + /** + * List of times, during a day, when the schedule runs. + */ + @JsonProperty(value = "scheduleRunTimes") + private List scheduleRunTimes; + + /** + * The number of times per week the schedule runs. + */ + @JsonProperty(value = "scheduleWeeklyFrequency") + private Integer scheduleWeeklyFrequency; + + /** + * Get defines the frequency interval (daily or weekly) for the schedule policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @return the scheduleRunFrequency value + */ + public ScheduleRunType scheduleRunFrequency() { + return this.scheduleRunFrequency; + } + + /** + * Set defines the frequency interval (daily or weekly) for the schedule policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @param scheduleRunFrequency the scheduleRunFrequency value to set + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleRunFrequency(ScheduleRunType scheduleRunFrequency) { + this.scheduleRunFrequency = scheduleRunFrequency; + return this; + } + + /** + * Get this list is the days of the week when the schedule runs. + * + * @return the scheduleRunDays value + */ + public List scheduleRunDays() { + return this.scheduleRunDays; + } + + /** + * Set this list is the days of the week when the schedule runs. + * + * @param scheduleRunDays the scheduleRunDays value to set + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleRunDays(List scheduleRunDays) { + this.scheduleRunDays = scheduleRunDays; + return this; + } + + /** + * Get list of times, during a day, when the schedule runs. + * + * @return the scheduleRunTimes value + */ + public List scheduleRunTimes() { + return this.scheduleRunTimes; + } + + /** + * Set list of times, during a day, when the schedule runs. + * + * @param scheduleRunTimes the scheduleRunTimes value to set + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleRunTimes(List scheduleRunTimes) { + this.scheduleRunTimes = scheduleRunTimes; + return this; + } + + /** + * Get the number of times per week the schedule runs. + * + * @return the scheduleWeeklyFrequency value + */ + public Integer scheduleWeeklyFrequency() { + return this.scheduleWeeklyFrequency; + } + + /** + * Set the number of times per week the schedule runs. + * + * @param scheduleWeeklyFrequency the scheduleWeeklyFrequency value to set + * @return the SimpleSchedulePolicy object itself. + */ + public SimpleSchedulePolicy withScheduleWeeklyFrequency(Integer scheduleWeeklyFrequency) { + this.scheduleWeeklyFrequency = scheduleWeeklyFrequency; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultJobResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultJobResource.java new file mode 100644 index 000000000000..52f32f7952d0 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultJobResource.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing VaultJobResource. + */ +public interface VaultJobResource extends HasInner, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + JobInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultJobResourceModel.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultJobResourceModel.java new file mode 100644 index 000000000000..5c8f518d866b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultJobResourceModel.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.JobResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing VaultJobResourceModel. + */ +public interface VaultJobResourceModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + JobInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultOperationStatus.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultOperationStatus.java new file mode 100644 index 000000000000..040e14a719a7 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultOperationStatus.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.OperationStatusInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import org.joda.time.DateTime; + +/** + * Type representing VaultOperationStatus. + */ +public interface VaultOperationStatus extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the error value. + */ + OperationStatusError error(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + OperationStatusExtendedInfo properties(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + OperationStatusValues status(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultProtectedItemResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultProtectedItemResource.java new file mode 100644 index 000000000000..35726e8ab7f4 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultProtectedItemResource.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectedItemResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing VaultProtectedItemResource. + */ +public interface VaultProtectedItemResource extends HasInner, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectedItemInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultProtectionPolicyResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultProtectionPolicyResource.java new file mode 100644 index 000000000000..35600c50826e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/VaultProtectionPolicyResource.java @@ -0,0 +1,249 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.ProtectionPolicyInner; + +/** + * Type representing VaultProtectionPolicyResource. + */ +public interface VaultProtectionPolicyResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ProtectionPolicyInner properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the VaultProtectionPolicyResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithVault, DefinitionStages.WithCreate { + } + + /** + * Grouping of VaultProtectionPolicyResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a VaultProtectionPolicyResource definition. + */ + interface Blank extends WithVault { + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify Vault. + */ + interface WithVault { + /** + * Specifies vaultName, resourceGroupName. + */ + WithCreate withExistingVault(String vaultName, String resourceGroupName); + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + WithCreate withId(String id); + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + WithCreate withName(String name); + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + WithCreate withProperties(ProtectionPolicyInner properties); + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the vaultprotectionpolicyresource definition allowing to specify Type. + */ + interface WithType { + /** + * Specifies type. + */ + WithCreate withType(String type); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithETag, DefinitionStages.WithId, DefinitionStages.WithLocation, DefinitionStages.WithName, DefinitionStages.WithProperties, DefinitionStages.WithTags, DefinitionStages.WithType { + } + } + /** + * The template for a VaultProtectionPolicyResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithETag, UpdateStages.WithId, UpdateStages.WithLocation, UpdateStages.WithName, UpdateStages.WithProperties, UpdateStages.WithTags, UpdateStages.WithType { + } + + /** + * Grouping of VaultProtectionPolicyResource update stages. + */ + interface UpdateStages { + /** + * The stage of the vaultprotectionpolicyresource update allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + */ + Update withETag(String eTag); + } + + /** + * The stage of the vaultprotectionpolicyresource update allowing to specify Id. + */ + interface WithId { + /** + * Specifies id. + */ + Update withId(String id); + } + + /** + * The stage of the vaultprotectionpolicyresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + Update withLocation(String location); + } + + /** + * The stage of the vaultprotectionpolicyresource update allowing to specify Name. + */ + interface WithName { + /** + * Specifies name. + */ + Update withName(String name); + } + + /** + * The stage of the vaultprotectionpolicyresource update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + Update withProperties(ProtectionPolicyInner properties); + } + + /** + * The stage of the vaultprotectionpolicyresource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + /** + * The stage of the vaultprotectionpolicyresource update allowing to specify Type. + */ + interface WithType { + /** + * Specifies type. + */ + Update withType(String type); + } + + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeekOfMonth.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeekOfMonth.java new file mode 100644 index 000000000000..d4f2fc6cbd33 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeekOfMonth.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for WeekOfMonth. + */ +public enum WeekOfMonth { + /** Enum value First. */ + FIRST("First"), + + /** Enum value Second. */ + SECOND("Second"), + + /** Enum value Third. */ + THIRD("Third"), + + /** Enum value Fourth. */ + FOURTH("Fourth"), + + /** Enum value Last. */ + LAST("Last"); + + /** The actual serialized value for a WeekOfMonth instance. */ + private String value; + + WeekOfMonth(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WeekOfMonth instance. + * + * @param value the serialized value to parse. + * @return the parsed WeekOfMonth object, or null if unable to parse. + */ + @JsonCreator + public static WeekOfMonth fromString(String value) { + WeekOfMonth[] items = WeekOfMonth.values(); + for (WeekOfMonth item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeeklyRetentionFormat.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeeklyRetentionFormat.java new file mode 100644 index 000000000000..596c0070c6b4 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeeklyRetentionFormat.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Weekly retention format. + */ +public class WeeklyRetentionFormat { + /** + * List of days of the week. + */ + @JsonProperty(value = "daysOfTheWeek") + private List daysOfTheWeek; + + /** + * List of weeks of the month. + */ + @JsonProperty(value = "weeksOfTheMonth") + private List weeksOfTheMonth; + + /** + * Get list of days of the week. + * + * @return the daysOfTheWeek value + */ + public List daysOfTheWeek() { + return this.daysOfTheWeek; + } + + /** + * Set list of days of the week. + * + * @param daysOfTheWeek the daysOfTheWeek value to set + * @return the WeeklyRetentionFormat object itself. + */ + public WeeklyRetentionFormat withDaysOfTheWeek(List daysOfTheWeek) { + this.daysOfTheWeek = daysOfTheWeek; + return this; + } + + /** + * Get list of weeks of the month. + * + * @return the weeksOfTheMonth value + */ + public List weeksOfTheMonth() { + return this.weeksOfTheMonth; + } + + /** + * Set list of weeks of the month. + * + * @param weeksOfTheMonth the weeksOfTheMonth value to set + * @return the WeeklyRetentionFormat object itself. + */ + public WeeklyRetentionFormat withWeeksOfTheMonth(List weeksOfTheMonth) { + this.weeksOfTheMonth = weeksOfTheMonth; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeeklyRetentionSchedule.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeeklyRetentionSchedule.java new file mode 100644 index 000000000000..6270d4529ca8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WeeklyRetentionSchedule.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Weekly retention schedule. + */ +public class WeeklyRetentionSchedule { + /** + * List of the days of the week for the weekly retention policy. + */ + @JsonProperty(value = "daysOfTheWeek") + private List daysOfTheWeek; + + /** + * Retention times of the retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * Retention duration of retention policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get list of the days of the week for the weekly retention policy. + * + * @return the daysOfTheWeek value + */ + public List daysOfTheWeek() { + return this.daysOfTheWeek; + } + + /** + * Set list of the days of the week for the weekly retention policy. + * + * @param daysOfTheWeek the daysOfTheWeek value to set + * @return the WeeklyRetentionSchedule object itself. + */ + public WeeklyRetentionSchedule withDaysOfTheWeek(List daysOfTheWeek) { + this.daysOfTheWeek = daysOfTheWeek; + return this; + } + + /** + * Get retention times of the retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set retention times of the retention policy. + * + * @param retentionTimes the retentionTimes value to set + * @return the WeeklyRetentionSchedule object itself. + */ + public WeeklyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get retention duration of retention policy. + * + * @return the retentionDuration value + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set retention duration of retention policy. + * + * @param retentionDuration the retentionDuration value to set + * @return the WeeklyRetentionSchedule object itself. + */ + public WeeklyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadProtectableItem.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadProtectableItem.java new file mode 100644 index 000000000000..5cd39aaa6f69 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadProtectableItem.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for backup item. Workload-specific backup items are derived + * from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableItemType") +@JsonTypeName("WorkloadProtectableItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IaaSVMProtectableItem", value = IaaSVMProtectableItem.class) +}) +public class WorkloadProtectableItem { + /** + * The backup management type. + */ + @JsonProperty(value = "backupManagementType") + private String backupManagementType; + + /** + * The friendly name of the backup item. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The state of the back up item. Possible values include: 'Invalid', + * 'NotProtected', 'Protecting', 'Protected'. + */ + @JsonProperty(value = "protectionState") + private ProtectionStatus protectionState; + + /** + * Get the backup management type. + * + * @return the backupManagementType value + */ + public String backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type. + * + * @param backupManagementType the backupManagementType value to set + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withBackupManagementType(String backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the friendly name of the backup item. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name of the backup item. + * + * @param friendlyName the friendlyName value to set + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the state of the back up item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected'. + * + * @return the protectionState value + */ + public ProtectionStatus protectionState() { + return this.protectionState; + } + + /** + * Set the state of the back up item. Possible values include: 'Invalid', 'NotProtected', 'Protecting', 'Protected'. + * + * @param protectionState the protectionState value to set + * @return the WorkloadProtectableItem object itself. + */ + public WorkloadProtectableItem withProtectionState(ProtectionStatus protectionState) { + this.protectionState = protectionState; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadProtectableItemResource.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadProtectableItemResource.java new file mode 100644 index 000000000000..a3d52834396f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadProtectableItemResource.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.WorkloadProtectableItemResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation.RecoveryServicesManager; +import java.util.Map; + +/** + * Type representing WorkloadProtectableItemResource. + */ +public interface WorkloadProtectableItemResource extends HasInner, HasManager { + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + WorkloadProtectableItem properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadType.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadType.java new file mode 100644 index 000000000000..172d16d6f039 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/WorkloadType.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for WorkloadType. + */ +public enum WorkloadType { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value VM. */ + VM("VM"), + + /** Enum value FileFolder. */ + FILE_FOLDER("FileFolder"), + + /** Enum value AzureSqlDb. */ + AZURE_SQL_DB("AzureSqlDb"), + + /** Enum value SQLDB. */ + SQLDB("SQLDB"), + + /** Enum value Exchange. */ + EXCHANGE("Exchange"), + + /** Enum value Sharepoint. */ + SHAREPOINT("Sharepoint"), + + /** Enum value DPMUnknown. */ + DPMUNKNOWN("DPMUnknown"); + + /** The actual serialized value for a WorkloadType instance. */ + private String value; + + WorkloadType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WorkloadType instance. + * + * @param value the serialized value to parse. + * @return the parsed WorkloadType object, or null if unable to parse. + */ + @JsonCreator + public static WorkloadType fromString(String value) { + WorkloadType[] items = WorkloadType.values(); + for (WorkloadType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/YearlyRetentionSchedule.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/YearlyRetentionSchedule.java new file mode 100644 index 000000000000..1e21fcd54c3b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/YearlyRetentionSchedule.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Yearly retention schedule. + */ +public class YearlyRetentionSchedule { + /** + * Retention schedule format for the yearly retention policy. Possible + * values include: 'Invalid', 'Daily', 'Weekly'. + */ + @JsonProperty(value = "retentionScheduleFormatType") + private RetentionScheduleFormat retentionScheduleFormatType; + + /** + * List of the months of year for the yearly retention policy. + */ + @JsonProperty(value = "monthsOfYear") + private List monthsOfYear; + + /** + * Daily retention format for the yearly retention policy. + */ + @JsonProperty(value = "retentionScheduleDaily") + private DailyRetentionFormat retentionScheduleDaily; + + /** + * Weekly retention format for the yearly retention policy. + */ + @JsonProperty(value = "retentionScheduleWeekly") + private WeeklyRetentionFormat retentionScheduleWeekly; + + /** + * Retention times for the retention policy. + */ + @JsonProperty(value = "retentionTimes") + private List retentionTimes; + + /** + * Retention duration for the retention policy. + */ + @JsonProperty(value = "retentionDuration") + private RetentionDuration retentionDuration; + + /** + * Get retention schedule format for the yearly retention policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @return the retentionScheduleFormatType value + */ + public RetentionScheduleFormat retentionScheduleFormatType() { + return this.retentionScheduleFormatType; + } + + /** + * Set retention schedule format for the yearly retention policy. Possible values include: 'Invalid', 'Daily', 'Weekly'. + * + * @param retentionScheduleFormatType the retentionScheduleFormatType value to set + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionScheduleFormatType(RetentionScheduleFormat retentionScheduleFormatType) { + this.retentionScheduleFormatType = retentionScheduleFormatType; + return this; + } + + /** + * Get list of the months of year for the yearly retention policy. + * + * @return the monthsOfYear value + */ + public List monthsOfYear() { + return this.monthsOfYear; + } + + /** + * Set list of the months of year for the yearly retention policy. + * + * @param monthsOfYear the monthsOfYear value to set + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withMonthsOfYear(List monthsOfYear) { + this.monthsOfYear = monthsOfYear; + return this; + } + + /** + * Get daily retention format for the yearly retention policy. + * + * @return the retentionScheduleDaily value + */ + public DailyRetentionFormat retentionScheduleDaily() { + return this.retentionScheduleDaily; + } + + /** + * Set daily retention format for the yearly retention policy. + * + * @param retentionScheduleDaily the retentionScheduleDaily value to set + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionScheduleDaily(DailyRetentionFormat retentionScheduleDaily) { + this.retentionScheduleDaily = retentionScheduleDaily; + return this; + } + + /** + * Get weekly retention format for the yearly retention policy. + * + * @return the retentionScheduleWeekly value + */ + public WeeklyRetentionFormat retentionScheduleWeekly() { + return this.retentionScheduleWeekly; + } + + /** + * Set weekly retention format for the yearly retention policy. + * + * @param retentionScheduleWeekly the retentionScheduleWeekly value to set + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionScheduleWeekly(WeeklyRetentionFormat retentionScheduleWeekly) { + this.retentionScheduleWeekly = retentionScheduleWeekly; + return this; + } + + /** + * Get retention times for the retention policy. + * + * @return the retentionTimes value + */ + public List retentionTimes() { + return this.retentionTimes; + } + + /** + * Set retention times for the retention policy. + * + * @param retentionTimes the retentionTimes value to set + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionTimes(List retentionTimes) { + this.retentionTimes = retentionTimes; + return this; + } + + /** + * Get retention duration for the retention policy. + * + * @return the retentionDuration value + */ + public RetentionDuration retentionDuration() { + return this.retentionDuration; + } + + /** + * Set retention duration for the retention policy. + * + * @param retentionDuration the retentionDuration value to set + * @return the YearlyRetentionSchedule object itself. + */ + public YearlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { + this.retentionDuration = retentionDuration; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEngineBaseResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEngineBaseResourceImpl.java new file mode 100644 index 000000000000..a82f50dec36b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEngineBaseResourceImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupEngineBaseResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupEngineBase; +import java.util.Map; + +class BackupEngineBaseResourceImpl extends WrapperImpl implements BackupEngineBaseResource { + private final RecoveryServicesManager manager; + + BackupEngineBaseResourceImpl(BackupEngineBaseResourceInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public BackupEngineBase properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEngineBaseResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEngineBaseResourceInner.java new file mode 100644 index 000000000000..588dbb64e7a1 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEngineBaseResourceInner.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupEngineBase; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The base backup engine class. All workload-specific backup engines derive + * from this class. + */ +@SkipParentValidation +public class BackupEngineBaseResourceInner extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private BackupEngineBase properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public BackupEngineBase properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the BackupEngineBaseResourceInner object itself. + */ + public BackupEngineBaseResourceInner withProperties(BackupEngineBase properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the BackupEngineBaseResourceInner object itself. + */ + public BackupEngineBaseResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the BackupEngineBaseResourceInner object itself. + */ + public BackupEngineBaseResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the BackupEngineBaseResourceInner object itself. + */ + public BackupEngineBaseResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the BackupEngineBaseResourceInner object itself. + */ + public BackupEngineBaseResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesImpl.java new file mode 100644 index 000000000000..337e2ba93ba7 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupEngines; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupEngineBaseResource; + +class BackupEnginesImpl extends WrapperImpl implements BackupEngines { + private final RecoveryServicesManager manager; + + BackupEnginesImpl(RecoveryServicesManager manager) { + super(manager.inner().backupEngines()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private BackupEngineBaseResourceImpl wrapModel(BackupEngineBaseResourceInner inner) { + return new BackupEngineBaseResourceImpl(inner, manager()); + } + + @Override + public Observable getAsync(final String vaultName, final String resourceGroupName) { + BackupEnginesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BackupEngineBaseResource call(BackupEngineBaseResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesInner.java new file mode 100644 index 000000000000..b1a7050af11e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupEnginesInner.java @@ -0,0 +1,433 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.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.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BackupEngines. + */ +public class BackupEnginesInner { + /** The Retrofit service to perform REST calls. */ + private BackupEnginesService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupEnginesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupEnginesInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupEnginesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupEngines to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupEnginesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupEngines get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.recoveryservices.backup.v2016_06_01.BackupEngines getNext" }) + @GET + Observable> getNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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<BackupEngineBaseResourceInner> object if successful. + */ + public PagedList get(final String vaultName, final String resourceGroupName) { + ServiceResponse> response = getSinglePageAsync(vaultName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getAsync(final String vaultName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePageAsync(vaultName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> object + */ + public Observable> getAsync(final String vaultName, final String resourceGroupName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> object + */ + public Observable>> getWithServiceResponseAsync(final String vaultName, final String resourceGroupName) { + return getSinglePageAsync(vaultName, 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(getNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackupEngineBaseResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePageAsync(final String vaultName, final String resourceGroupName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final String skipToken = null; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Use this filter to choose the specific backup management server. backupManagementType { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @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<BackupEngineBaseResourceInner> object if successful. + */ + public PagedList get(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + ServiceResponse> response = getSinglePageAsync(vaultName, resourceGroupName, filter, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Use this filter to choose the specific backup management server. backupManagementType { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Use this filter to choose the specific backup management server. backupManagementType { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> object + */ + public Observable> getAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Use this filter to choose the specific backup management server. backupManagementType { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BackupEngineBaseResourceInner> object + */ + public Observable>> getWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return getSinglePageAsync(vaultName, resourceGroupName, filter, 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(getNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + ServiceResponse> * @param vaultName The name of the Recovery Services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + ServiceResponse> * @param filter Use this filter to choose the specific backup management server. backupManagementType { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + ServiceResponse> * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackupEngineBaseResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePageAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, skipToken, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @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<BackupEngineBaseResourceInner> object if successful. + */ + public PagedList getNext(final String nextPageLink) { + ServiceResponse> response = getNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @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> getNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @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<BackupEngineBaseResourceInner> object + */ + public Observable> getNextAsync(final String nextPageLink) { + return getNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + * @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<BackupEngineBaseResourceInner> object + */ + public Observable>> getNextWithServiceResponseAsync(final String nextPageLink) { + return getNextSinglePageAsync(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(getNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The backup management servers registered to a Recovery Services vault. This returns a pageable list of servers. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BackupEngineBaseResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getNextSinglePageAsync(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.getNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getNextDelegate(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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultOperationStatusImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultOperationStatusImpl.java new file mode 100644 index 000000000000..a167584ea48f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultOperationStatusImpl.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupFabricVaultOperationStatus; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusExtendedInfo; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusValues; + +class BackupFabricVaultOperationStatusImpl extends IndexableRefreshableWrapperImpl implements BackupFabricVaultOperationStatus { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String fabricName; + private String containerName; + private String protectedItemName; + private String operationId; + + BackupFabricVaultOperationStatusImpl(OperationStatusInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.fabricName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupFabrics"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectionContainers"); + this.protectedItemName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectedItems"); + this.operationId = IdParsingUtils.getValueFromIdByName(inner.id(), "operationsStatus"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProtectedItemOperationStatusesInner client = this.manager().inner().protectedItemOperationStatuses(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName, this.protectedItemName, this.operationId); + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public OperationStatusError error() { + return this.inner().error(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public OperationStatusExtendedInfo properties() { + return this.inner().properties(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public OperationStatusValues status() { + return this.inner().status(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultProtectedItemResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultProtectedItemResourceImpl.java new file mode 100644 index 000000000000..de329b7e164f --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultProtectedItemResourceImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupFabricVaultProtectedItemResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class BackupFabricVaultProtectedItemResourceImpl extends IndexableRefreshableWrapperImpl implements BackupFabricVaultProtectedItemResource { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String fabricName; + private String containerName; + private String protectedItemName; + private String operationId; + + BackupFabricVaultProtectedItemResourceImpl(ProtectedItemResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.fabricName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupFabrics"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectionContainers"); + this.protectedItemName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectedItems"); + this.operationId = IdParsingUtils.getValueFromIdByName(inner.id(), "operationResults"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProtectedItemOperationResultsInner client = this.manager().inner().protectedItemOperationResults(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName, this.protectedItemName, this.operationId); + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectedItemInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultProtectionContainerResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultProtectionContainerResourceImpl.java new file mode 100644 index 000000000000..8da553e08671 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupFabricVaultProtectionContainerResourceImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupFabricVaultProtectionContainerResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class BackupFabricVaultProtectionContainerResourceImpl extends IndexableRefreshableWrapperImpl implements BackupFabricVaultProtectionContainerResource { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String fabricName; + private String containerName; + + BackupFabricVaultProtectionContainerResourceImpl(ProtectionContainerResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.fabricName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupFabrics"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectionContainers"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProtectionContainersInner client = this.manager().inner().protectionContainers(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName); + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectionContainerInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationResultsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationResultsImpl.java new file mode 100644 index 000000000000..b78e6a563eec --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationResultsImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupOperationResults; +import rx.Completable; + +class BackupOperationResultsImpl extends WrapperImpl implements BackupOperationResults { + private final RecoveryServicesManager manager; + + BackupOperationResultsImpl(RecoveryServicesManager manager) { + super(manager.inner().backupOperationResults()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Completable getAsync(String vaultName, String resourceGroupName, String operationId) { + BackupOperationResultsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, operationId).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationResultsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationResultsInner.java new file mode 100644 index 000000000000..ed01f2d87726 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationResultsInner.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BackupOperationResults. + */ +public class BackupOperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private BackupOperationResultsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupOperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupOperationResultsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupOperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupOperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupOperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupOperationResults get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides the status of the delete operations, for example, deleting a backup item. Once the operation starts, the response status code is Accepted. The response status code remains in this state until the operation reaches completion. On successful completion, the status code changes to OK. This method expects OperationID as an argument. OperationID is part of the Location header of the operation response. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get(String vaultName, String resourceGroupName, String operationId) { + getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).toBlocking().single().body(); + } + + /** + * Provides the status of the delete operations, for example, deleting a backup item. Once the operation starts, the response status code is Accepted. The response status code remains in this state until the operation reaches completion. On successful completion, the status code changes to OK. This method expects OperationID as an argument. OperationID is part of the Location header of the operation response. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, operationId), serviceCallback); + } + + /** + * Provides the status of the delete operations, for example, deleting a backup item. Once the operation starts, the response status code is Accepted. The response status code remains in this state until the operation reaches completion. On successful completion, the status code changes to OK. This method expects OperationID as an argument. OperationID is part of the Location header of the operation response. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getAsync(String vaultName, String resourceGroupName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the status of the delete operations, for example, deleting a backup item. Once the operation starts, the response status code is Accepted. The response status code remains in this state until the operation reaches completion. On successful completion, the status code changes to OK. This method expects OperationID as an argument. OperationID is part of the Location header of the operation response. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationStatusesImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationStatusesImpl.java new file mode 100644 index 000000000000..944f035b9b13 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationStatusesImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupOperationStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultOperationStatus; + +class BackupOperationStatusesImpl extends WrapperImpl implements BackupOperationStatuses { + private final RecoveryServicesManager manager; + + BackupOperationStatusesImpl(RecoveryServicesManager manager) { + super(manager.inner().backupOperationStatuses()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private VaultOperationStatusImpl wrapModel(OperationStatusInner inner) { + return new VaultOperationStatusImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String operationId) { + BackupOperationStatusesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, operationId) + .map(new Func1() { + @Override + public VaultOperationStatus call(OperationStatusInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationStatusesInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationStatusesInner.java new file mode 100644 index 000000000000..c00db5fe5a70 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupOperationStatusesInner.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BackupOperationStatuses. + */ +public class BackupOperationStatusesInner { + /** The Retrofit service to perform REST calls. */ + private BackupOperationStatusesService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupOperationStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupOperationStatusesInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupOperationStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BackupOperationStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupOperationStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupOperationStatuses get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be In progress, Completed or Failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusInner object if successful. + */ + public OperationStatusInner get(String vaultName, String resourceGroupName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).toBlocking().single().body(); + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be In progress, Completed or Failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, operationId), serviceCallback); + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be In progress, Completed or Failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).map(new Func1, OperationStatusInner>() { + @Override + public OperationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be In progress, Completed or Failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupPolicyVaultOperationStatusImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupPolicyVaultOperationStatusImpl.java new file mode 100644 index 000000000000..8edd2c3ac7c5 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupPolicyVaultOperationStatusImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupPolicyVaultOperationStatus; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusExtendedInfo; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusValues; + +class BackupPolicyVaultOperationStatusImpl extends IndexableRefreshableWrapperImpl implements BackupPolicyVaultOperationStatus { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String policyName; + private String operationId; + + BackupPolicyVaultOperationStatusImpl(OperationStatusInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.policyName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupPolicies"); + this.operationId = IdParsingUtils.getValueFromIdByName(inner.id(), "operations"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProtectionPolicyOperationStatusesInner client = this.manager().inner().protectionPolicyOperationStatuses(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.policyName, this.operationId); + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public OperationStatusError error() { + return this.inner().error(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public OperationStatusExtendedInfo properties() { + return this.inner().properties(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public OperationStatusValues status() { + return this.inner().status(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupPolicyVaultProtectionPolicyResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupPolicyVaultProtectionPolicyResourceImpl.java new file mode 100644 index 000000000000..4d469a6958e7 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupPolicyVaultProtectionPolicyResourceImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupPolicyVaultProtectionPolicyResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class BackupPolicyVaultProtectionPolicyResourceImpl extends IndexableRefreshableWrapperImpl implements BackupPolicyVaultProtectionPolicyResource { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String policyName; + private String operationId; + + BackupPolicyVaultProtectionPolicyResourceImpl(ProtectionPolicyResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.policyName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupPolicies"); + this.operationId = IdParsingUtils.getValueFromIdByName(inner.id(), "operationResults"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProtectionPolicyOperationResultsInner client = this.manager().inner().protectionPolicyOperationResults(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.policyName, this.operationId); + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectionPolicyInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupsImpl.java new file mode 100644 index 000000000000..d64c39b8a885 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Backups; +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupRequestResource; + +class BackupsImpl extends WrapperImpl implements Backups { + private final RecoveryServicesManager manager; + + BackupsImpl(RecoveryServicesManager manager) { + super(manager.inner().backups()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Completable triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource resourceBackupRequest) { + BackupsInner client = this.inner(); + return client.triggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceBackupRequest).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupsInner.java new file mode 100644 index 000000000000..201979299ffe --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/BackupsInner.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupRequestResource; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Backups. + */ +public class BackupsInner { + /** The Retrofit service to perform REST calls. */ + private BackupsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of BackupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BackupsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(BackupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Backups to be + * used by Retrofit to perform actually REST calls. + */ + interface BackupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Backups trigger" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup") + Observable> trigger(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Query("api-version") String apiVersion, @Body BackupRequestResource resourceBackupRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Triggers the backup job for the specified backup item. This is an asynchronous operation. To know the status of the operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this POST operation. + * @param resourceBackupRequest The resource backup 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 + */ + public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource resourceBackupRequest) { + triggerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceBackupRequest).toBlocking().single().body(); + } + + /** + * Triggers the backup job for the specified backup item. This is an asynchronous operation. To know the status of the operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this POST operation. + * @param resourceBackupRequest The resource backup 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 triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource resourceBackupRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(triggerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceBackupRequest), serviceCallback); + } + + /** + * Triggers the backup job for the specified backup item. This is an asynchronous operation. To know the status of the operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this POST operation. + * @param resourceBackupRequest The resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource resourceBackupRequest) { + return triggerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceBackupRequest).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers the backup job for the specified backup item. This is an asynchronous operation. To know the status of the operation, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this POST operation. + * @param resourceBackupRequest The resource backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> triggerWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, BackupRequestResource resourceBackupRequest) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName 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 (resourceBackupRequest == null) { + throw new IllegalArgumentException("Parameter resourceBackupRequest is required and cannot be null."); + } + Validator.validate(resourceBackupRequest); + return service.trigger(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, this.client.apiVersion(), resourceBackupRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = triggerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse triggerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ExportJobsOperationResultsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ExportJobsOperationResultsImpl.java new file mode 100644 index 000000000000..ad4b8b598dd9 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ExportJobsOperationResultsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ExportJobsOperationResults; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationResultInfoBaseResource; + +class ExportJobsOperationResultsImpl extends WrapperImpl implements ExportJobsOperationResults { + private final RecoveryServicesManager manager; + + ExportJobsOperationResultsImpl(RecoveryServicesManager manager) { + super(manager.inner().exportJobsOperationResults()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String operationId) { + ExportJobsOperationResultsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, operationId) + .map(new Func1() { + @Override + public OperationResultInfoBaseResource call(OperationResultInfoBaseResourceInner inner) { + return new OperationResultInfoBaseResourceImpl(inner, manager()); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ExportJobsOperationResultsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ExportJobsOperationResultsInner.java new file mode 100644 index 000000000000..e686fc55ce35 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ExportJobsOperationResultsInner.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExportJobsOperationResults. + */ +public class ExportJobsOperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private ExportJobsOperationResultsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ExportJobsOperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExportJobsOperationResultsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ExportJobsOperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExportJobsOperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface ExportJobsOperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ExportJobsOperationResults get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the result of the operation triggered by the ExportJob API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID associated with the export job. + * @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 OperationResultInfoBaseResourceInner object if successful. + */ + public OperationResultInfoBaseResourceInner get(String vaultName, String resourceGroupName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).toBlocking().single().body(); + } + + /** + * Gets the result of the operation triggered by the ExportJob API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID associated with the export job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, operationId), serviceCallback); + } + + /** + * Gets the result of the operation triggered by the ExportJob API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID associated with the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationResultInfoBaseResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, operationId).map(new Func1, OperationResultInfoBaseResourceInner>() { + @Override + public OperationResultInfoBaseResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the result of the operation triggered by the ExportJob API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param operationId The ID associated with the export job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationResultInfoBaseResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/IdParsingUtils.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..f8eb2207532b --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/IdParsingUtils.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ItemLevelRecoveryConnectionsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ItemLevelRecoveryConnectionsImpl.java new file mode 100644 index 000000000000..304e020cf066 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ItemLevelRecoveryConnectionsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ItemLevelRecoveryConnections; +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ILRRequestResource; + +class ItemLevelRecoveryConnectionsImpl extends WrapperImpl implements ItemLevelRecoveryConnections { + private final RecoveryServicesManager manager; + + ItemLevelRecoveryConnectionsImpl(RecoveryServicesManager manager) { + super(manager.inner().itemLevelRecoveryConnections()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Completable revokeAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + ItemLevelRecoveryConnectionsInner client = this.inner(); + return client.revokeAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).toCompletable(); + } + + @Override + public Completable provisionAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest) { + ItemLevelRecoveryConnectionsInner client = this.inner(); + return client.provisionAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceILRRequest).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ItemLevelRecoveryConnectionsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ItemLevelRecoveryConnectionsInner.java new file mode 100644 index 000000000000..18dac8408c69 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ItemLevelRecoveryConnectionsInner.java @@ -0,0 +1,303 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ILRRequestResource; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ItemLevelRecoveryConnections. + */ +public class ItemLevelRecoveryConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private ItemLevelRecoveryConnectionsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ItemLevelRecoveryConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ItemLevelRecoveryConnectionsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ItemLevelRecoveryConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ItemLevelRecoveryConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface ItemLevelRecoveryConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ItemLevelRecoveryConnections revoke" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery") + Observable> revoke(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("recoveryPointId") String recoveryPointId, @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.recoveryservices.backup.v2016_06_01.ItemLevelRecoveryConnections provision" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery") + Observable> provision(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("recoveryPointId") String recoveryPointId, @Query("api-version") String apiVersion, @Body ILRRequestResource resourceILRRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. The value allowed is Azure. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup items whose files or folders will be restored. + * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data. + * @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 revoke(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + revokeWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).toBlocking().single().body(); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. The value allowed is Azure. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup items whose files or folders will be restored. + * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data. + * @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 revokeAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(revokeWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId), serviceCallback); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. The value allowed is Azure. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup items whose files or folders will be restored. + * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable revokeAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + return revokeWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer displaying all recoverable files and folders. This is an asynchronous operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. The value allowed is Azure. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup items whose files or folders will be restored. + * @param recoveryPointId The string that identifies the recovery point. The iSCSI connection will be revoked for this protected data. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> revokeWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (recoveryPointId == null) { + throw new IllegalArgumentException("Parameter recoveryPointId 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.revoke(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = revokeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse revokeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup item whose files or folders are to be restored. + * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data. + * @param resourceILRRequest The resource Item Level Recovery (ILR) 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 + */ + public void provision(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest) { + provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceILRRequest).toBlocking().single().body(); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup item whose files or folders are to be restored. + * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data. + * @param resourceILRRequest The resource Item Level Recovery (ILR) 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 provisionAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceILRRequest), serviceCallback); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup item whose files or folders are to be restored. + * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data. + * @param resourceILRRequest The resource Item Level Recovery (ILR) request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable provisionAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest) { + return provisionWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceILRRequest).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens File Explorer which displays the recoverable files and folders. This is an asynchronous operation. To get the provisioning status, call GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The name of the backup item whose files or folders are to be restored. + * @param recoveryPointId The recovery point ID for backup data. The iSCSI connection will be provisioned for this backup data. + * @param resourceILRRequest The resource Item Level Recovery (ILR) request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> provisionWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, ILRRequestResource resourceILRRequest) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (recoveryPointId == null) { + throw new IllegalArgumentException("Parameter recoveryPointId 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 (resourceILRRequest == null) { + throw new IllegalArgumentException("Parameter resourceILRRequest is required and cannot be null."); + } + Validator.validate(resourceILRRequest); + return service.provision(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, this.client.apiVersion(), resourceILRRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = provisionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse provisionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobCancellationsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobCancellationsImpl.java new file mode 100644 index 000000000000..bb294bbc8644 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobCancellationsImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobCancellations; +import rx.Completable; + +class JobCancellationsImpl extends WrapperImpl implements JobCancellations { + private final RecoveryServicesManager manager; + + JobCancellationsImpl(RecoveryServicesManager manager) { + super(manager.inner().jobCancellations()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Completable triggerAsync(String vaultName, String resourceGroupName, String jobName) { + JobCancellationsInner client = this.inner(); + return client.triggerAsync(vaultName, resourceGroupName, jobName).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobCancellationsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobCancellationsInner.java new file mode 100644 index 000000000000..f1a7052b4040 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobCancellationsInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in JobCancellations. + */ +public class JobCancellationsInner { + /** The Retrofit service to perform REST calls. */ + private JobCancellationsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of JobCancellationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobCancellationsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(JobCancellationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for JobCancellations to be + * used by Retrofit to perform actually REST calls. + */ + interface JobCancellationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobCancellations trigger" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel") + Observable> trigger(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Cancels the job. This is an asynchronous operation. To know the status of the cancellation, call the GetCancelOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job to cancel. + * @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 trigger(String vaultName, String resourceGroupName, String jobName) { + triggerWithServiceResponseAsync(vaultName, resourceGroupName, jobName).toBlocking().single().body(); + } + + /** + * Cancels the job. This is an asynchronous operation. To know the status of the cancellation, call the GetCancelOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job to cancel. + * @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 triggerAsync(String vaultName, String resourceGroupName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(triggerWithServiceResponseAsync(vaultName, resourceGroupName, jobName), serviceCallback); + } + + /** + * Cancels the job. This is an asynchronous operation. To know the status of the cancellation, call the GetCancelOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable triggerAsync(String vaultName, String resourceGroupName, String jobName) { + return triggerWithServiceResponseAsync(vaultName, resourceGroupName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels the job. This is an asynchronous operation. To know the status of the cancellation, call the GetCancelOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> triggerWithServiceResponseAsync(String vaultName, String resourceGroupName, String jobName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (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.trigger(vaultName, resourceGroupName, this.client.subscriptionId(), jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = triggerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse triggerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobDetailsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobDetailsImpl.java new file mode 100644 index 000000000000..bec92dc41fac --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobDetailsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobDetails; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultJobResourceModel; + +class JobDetailsImpl extends WrapperImpl implements JobDetails { + private final RecoveryServicesManager manager; + + JobDetailsImpl(RecoveryServicesManager manager) { + super(manager.inner().jobDetails()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private VaultJobResourceModelImpl wrapModel(JobResourceInner inner) { + return new VaultJobResourceModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String jobName) { + JobDetailsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, jobName) + .map(new Func1() { + @Override + public VaultJobResourceModel call(JobResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobDetailsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobDetailsInner.java new file mode 100644 index 000000000000..a9f802c38617 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobDetailsInner.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in JobDetails. + */ +public class JobDetailsInner { + /** The Retrofit service to perform REST calls. */ + private JobDetailsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of JobDetailsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobDetailsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(JobDetailsService.class); + this.client = client; + } + + /** + * The interface defining all the services for JobDetails to be + * used by Retrofit to perform actually REST calls. + */ + interface JobDetailsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobDetails get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job associated with this GET 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 JobResourceInner object if successful. + */ + public JobResourceInner get(String vaultName, String resourceGroupName, String jobName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, jobName).toBlocking().single().body(); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job associated with this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, jobName), serviceCallback); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String jobName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, jobName).map(new Func1, JobResourceInner>() { + @Override + public JobResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets extended information associated with the job. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Name of the job associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String jobName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (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.get(vaultName, resourceGroupName, this.client.subscriptionId(), jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobInner.java new file mode 100644 index 000000000000..05d473ed55a6 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobInner.java @@ -0,0 +1,214 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupManagementType; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines workload-agnostic properties for a job. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("Job") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureIaaSVMJob", value = AzureIaaSVMJob.class), + @JsonSubTypes.Type(name = "DpmJob", value = DpmJob.class), + @JsonSubTypes.Type(name = "MabJob", value = MabJob.class) +}) +public class JobInner { + /** + * The friendly name of the entity on which the current job is executing. + */ + @JsonProperty(value = "entityFriendlyName") + private String entityFriendlyName; + + /** + * The backup management type for the current job. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The job status. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The start time. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The end time. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * ActivityId of job. + */ + @JsonProperty(value = "activityId") + private String activityId; + + /** + * Get the friendly name of the entity on which the current job is executing. + * + * @return the entityFriendlyName value + */ + public String entityFriendlyName() { + return this.entityFriendlyName; + } + + /** + * Set the friendly name of the entity on which the current job is executing. + * + * @param entityFriendlyName the entityFriendlyName value to set + * @return the JobInner object itself. + */ + public JobInner withEntityFriendlyName(String entityFriendlyName) { + this.entityFriendlyName = entityFriendlyName; + return this; + } + + /** + * Get the backup management type for the current job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type for the current job. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the JobInner object itself. + */ + public JobInner withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the operation name. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation name. + * + * @param operation the operation value to set + * @return the JobInner object itself. + */ + public JobInner withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the job status. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the job status. + * + * @param status the status value to set + * @return the JobInner object itself. + */ + public JobInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time. + * + * @param startTime the startTime value to set + * @return the JobInner object itself. + */ + public JobInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the end time. + * + * @param endTime the endTime value to set + * @return the JobInner object itself. + */ + public JobInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get activityId of job. + * + * @return the activityId value + */ + public String activityId() { + return this.activityId; + } + + /** + * Set activityId of job. + * + * @param activityId the activityId value to set + * @return the JobInner object itself. + */ + public JobInner withActivityId(String activityId) { + this.activityId = activityId; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsImpl.java new file mode 100644 index 000000000000..87682f3d5fe8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobOperationResults; +import rx.Completable; + +class JobOperationResultsImpl extends WrapperImpl implements JobOperationResults { + private final RecoveryServicesManager manager; + + JobOperationResultsImpl(RecoveryServicesManager manager) { + super(manager.inner().jobOperationResults()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Completable getAsync(String vaultName, String resourceGroupName, String jobName, String operationId) { + JobOperationResultsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, jobName, operationId).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsInner.java new file mode 100644 index 000000000000..2aae25f9415e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobOperationResultsInner.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in JobOperationResults. + */ +public class JobOperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private JobOperationResultsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of JobOperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobOperationResultsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(JobOperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for JobOperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface JobOperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobOperationResults get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("jobName") String jobName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the result of the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Job name associated with this GET operation. + * @param operationId OperationID associated with this GET 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 + */ + public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { + getWithServiceResponseAsync(vaultName, resourceGroupName, jobName, operationId).toBlocking().single().body(); + } + + /** + * Gets the result of the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Job name associated with this GET operation. + * @param operationId OperationID associated with this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String jobName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, jobName, operationId), serviceCallback); + } + + /** + * Gets the result of the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Job name associated with this GET operation. + * @param operationId OperationID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getAsync(String vaultName, String resourceGroupName, String jobName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, jobName, operationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the result of the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param jobName Job name associated with this GET operation. + * @param operationId OperationID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String jobName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), jobName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobResourceInner.java new file mode 100644 index 000000000000..6fa04746de99 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobResourceInner.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Defines the workload-agnostic properties for a job. + */ +@SkipParentValidation +public class JobResourceInner extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private JobInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public JobInner properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the JobResourceInner object itself. + */ + public JobResourceInner withProperties(JobInner properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the JobResourceInner object itself. + */ + public JobResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the JobResourceInner object itself. + */ + public JobResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the JobResourceInner object itself. + */ + public JobResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the JobResourceInner object itself. + */ + public JobResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsImpl.java new file mode 100644 index 000000000000..84360ca46f7a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Jobs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultJobResource; +import rx.Completable; + +class JobsImpl extends WrapperImpl implements Jobs { + private final RecoveryServicesManager manager; + + JobsImpl(RecoveryServicesManager manager) { + super(manager.inner().jobs()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private VaultJobResourceImpl wrapModel(JobResourceInner inner) { + return new VaultJobResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName) { + JobsInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VaultJobResource call(JobResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable exportAsync(String vaultName, String resourceGroupName) { + JobsInner client = this.inner(); + return client.exportAsync(vaultName, resourceGroupName).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsInner.java new file mode 100644 index 000000000000..6780752f3abf --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsInner.java @@ -0,0 +1,607 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.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 Jobs. + */ +public class JobsInner { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl 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, RecoveryServicesBackupClientImpl 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.recoveryservices.backup.v2016_06_01.Jobs export" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport") + Observable> export(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.recoveryservices.backup.v2016_06_01.Jobs list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs") + Observable> list(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.recoveryservices.backup.v2016_06_01.Jobs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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 export(String vaultName, String resourceGroupName) { + exportWithServiceResponseAsync(vaultName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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 exportAsync(String vaultName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportWithServiceResponseAsync(vaultName, resourceGroupName), serviceCallback); + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable exportAsync(String vaultName, String resourceGroupName) { + return exportWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> exportWithServiceResponseAsync(String vaultName, String resourceGroupName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.export(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = exportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The OData filter options. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @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 export(String vaultName, String resourceGroupName, String filter) { + exportWithServiceResponseAsync(vaultName, resourceGroupName, filter).toBlocking().single().body(); + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The OData filter options. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @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 exportAsync(String vaultName, String resourceGroupName, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportWithServiceResponseAsync(vaultName, resourceGroupName, filter), serviceCallback); + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The OData filter options. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable exportAsync(String vaultName, String resourceGroupName, String filter) { + return exportWithServiceResponseAsync(vaultName, resourceGroupName, filter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The OData filter options. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> exportWithServiceResponseAsync(String vaultName, String resourceGroupName, String filter) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.export(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = exportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse exportDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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 vaultName, final String resourceGroupName) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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 vaultName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName) { + return listSinglePageAsync(vaultName, 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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, 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); + } + } + }); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of jobs based on status, type, start date, and end date. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @param skipToken The Skip Token filter. + * @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 vaultName, final String resourceGroupName, final String filter, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of jobs based on status, type, start date, and end date. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @param skipToken The Skip Token filter. + * @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 vaultName, final String resourceGroupName, final String filter, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of jobs based on status, type, start date, and end date. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Provides a pageable list of jobs. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of jobs based on status, type, start date, and end date. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return listSinglePageAsync(vaultName, resourceGroupName, filter, 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)); + } + }); + } + + /** + * Provides a pageable list of jobs. + * + ServiceResponse> * @param vaultName The name of the Recovery Services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + ServiceResponse> * @param filter The following equation can be used to filter the list of jobs based on status, type, start date, and end date. status eq { InProgress , Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and operation eq { ConfigureBackup , Backup , Restore , DisableBackup , DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }. + ServiceResponse> * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, 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); + } + + /** + * Provides a pageable list of jobs. + * + * @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(); + } + }; + } + + /** + * Provides a pageable list of jobs. + * + * @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); + } + + /** + * Provides a pageable list of jobs. + * + * @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(); + } + }); + } + + /** + * Provides a pageable list of jobs. + * + * @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)); + } + }); + } + + /** + * Provides a pageable list of jobs. + * + 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); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationResultInfoBaseResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationResultInfoBaseResourceImpl.java new file mode 100644 index 000000000000..dd76fe87db3c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationResultInfoBaseResourceImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationResultInfoBaseResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationResultInfoBase; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.HttpStatusCode; + +class OperationResultInfoBaseResourceImpl extends WrapperImpl implements OperationResultInfoBaseResource { + private final RecoveryServicesManager manager; + OperationResultInfoBaseResourceImpl(OperationResultInfoBaseResourceInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Map> headers() { + return this.inner().headers(); + } + + @Override + public OperationResultInfoBase properties() { + return this.inner().properties(); + } + + @Override + public HttpStatusCode statusCode() { + return this.inner().statusCode(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationResultInfoBaseResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationResultInfoBaseResourceInner.java new file mode 100644 index 000000000000..96f5fd437129 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationResultInfoBaseResourceInner.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationResultInfoBase; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationWorkerResponse; + +/** + * Base class for operation result information. + */ +public class OperationResultInfoBaseResourceInner extends OperationWorkerResponse { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private OperationResultInfoBase properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public OperationResultInfoBase properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the OperationResultInfoBaseResourceInner object itself. + */ + public OperationResultInfoBaseResourceInner withProperties(OperationResultInfoBase properties) { + this.properties = properties; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationStatusInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationStatusInner.java new file mode 100644 index 000000000000..fb9f8833ae24 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/OperationStatusInner.java @@ -0,0 +1,206 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusValues; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusExtendedInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation status. + */ +public class OperationStatusInner { + /** + * ID of the operation. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Operation status. Possible values include: 'Invalid', 'InProgress', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "status") + private OperationStatusValues status; + + /** + * The operation start time. The format of the time is ISO-8601. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The operation end time. The format of the time is ISO-8601. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * Error information related to this operation. + */ + @JsonProperty(value = "error") + private OperationStatusError error; + + /** + * Additional information associated with this operation. + */ + @JsonProperty(value = "properties") + private OperationStatusExtendedInfo properties; + + /** + * Get iD of the operation. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set iD of the operation. + * + * @param id the id value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get operation status. Possible values include: 'Invalid', 'InProgress', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the status value + */ + public OperationStatusValues status() { + return this.status; + } + + /** + * Set operation status. Possible values include: 'Invalid', 'InProgress', 'Succeeded', 'Failed', 'Canceled'. + * + * @param status the status value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStatus(OperationStatusValues status) { + this.status = status; + return this; + } + + /** + * Get the operation start time. The format of the time is ISO-8601. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the operation start time. The format of the time is ISO-8601. + * + * @param startTime the startTime value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the operation end time. The format of the time is ISO-8601. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set the operation end time. The format of the time is ISO-8601. + * + * @param endTime the endTime value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get error information related to this operation. + * + * @return the error value + */ + public OperationStatusError error() { + return this.error; + } + + /** + * Set error information related to this operation. + * + * @param error the error value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withError(OperationStatusError error) { + this.error = error; + return this; + } + + /** + * Get additional information associated with this operation. + * + * @return the properties value + */ + public OperationStatusExtendedInfo properties() { + return this.properties; + } + + /** + * Set additional information associated with this operation. + * + * @param properties the properties value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withProperties(OperationStatusExtendedInfo properties) { + this.properties = properties; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/PageImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/PageImpl.java new file mode 100644 index 000000000000..6b8dd1a1985a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/PageImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + 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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/PageImpl1.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..81459a3b63b1 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/PageImpl1.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 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 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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectableItemsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectableItemsImpl.java new file mode 100644 index 000000000000..b226922b4a89 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectableItemsImpl.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectableItems; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.WorkloadProtectableItemResource; + +class ProtectableItemsImpl extends WrapperImpl implements ProtectableItems { + private final RecoveryServicesManager manager; + + ProtectableItemsImpl(RecoveryServicesManager manager) { + super(manager.inner().protectableItems()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private WorkloadProtectableItemResourceImpl wrapModel(WorkloadProtectableItemResourceInner inner) { + return new WorkloadProtectableItemResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName) { + ProtectableItemsInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public WorkloadProtectableItemResource call(WorkloadProtectableItemResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectableItemsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectableItemsInner.java new file mode 100644 index 000000000000..285850c4b60c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectableItemsInner.java @@ -0,0 +1,433 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.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.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectableItems. + */ +public class ProtectableItemsInner { + /** The Retrofit service to perform REST calls. */ + private ProtectableItemsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectableItemsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectableItemsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectableItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectableItems to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectableItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectableItems list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems") + Observable> list(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.recoveryservices.backup.v2016_06_01.ProtectableItems listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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<WorkloadProtectableItemResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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 vaultName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadProtectableItemResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadProtectableItemResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName) { + return listSinglePageAsync(vaultName, 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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadProtectableItemResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, 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); + } + } + }); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Using the following query filters, you can sort a specific backup item based on: type of backup item, status, name of the item, and more. providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and status eq { NotProtected , Protecting , Protected } and friendlyName {name} and skipToken eq {string which provides the next set of list} and topToken eq {int} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @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<WorkloadProtectableItemResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Using the following query filters, you can sort a specific backup item based on: type of backup item, status, name of the item, and more. providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and status eq { NotProtected , Protecting , Protected } and friendlyName {name} and skipToken eq {string which provides the next set of list} and topToken eq {int} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @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 vaultName, final String resourceGroupName, final String filter, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Using the following query filters, you can sort a specific backup item based on: type of backup item, status, name of the item, and more. providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and status eq { NotProtected , Protecting , Protected } and friendlyName {name} and skipToken eq {string which provides the next set of list} and topToken eq {int} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadProtectableItemResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter Using the following query filters, you can sort a specific backup item based on: type of backup item, status, name of the item, and more. providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and status eq { NotProtected , Protecting , Protected } and friendlyName {name} and skipToken eq {string which provides the next set of list} and topToken eq {int} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WorkloadProtectableItemResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return listSinglePageAsync(vaultName, resourceGroupName, filter, 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)); + } + }); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + ServiceResponse> * @param vaultName The name of the Recovery Services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + ServiceResponse> * @param filter Using the following query filters, you can sort a specific backup item based on: type of backup item, status, name of the item, and more. providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and status eq { NotProtected , Protecting , Protected } and friendlyName {name} and skipToken eq {string which provides the next set of list} and topToken eq {int} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + ServiceResponse> * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadProtectableItemResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, 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); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @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<WorkloadProtectableItemResourceInner> 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(); + } + }; + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @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); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @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<WorkloadProtectableItemResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + * @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<WorkloadProtectableItemResourceInner> 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)); + } + }); + } + + /** + * Based on the query filter and the pagination parameters, this operation provides a pageable list of objects within the subscription that can be protected. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WorkloadProtectableItemResourceInner> 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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemInner.java new file mode 100644 index 000000000000..aa40453f9d1e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemInner.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupManagementType; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.DataSourceType; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for backup items. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectedItemType") +@JsonTypeName("ProtectedItem") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureIaaSVMProtectedItem", value = AzureIaaSVMProtectedItem.class), + @JsonSubTypes.Type(name = "MabFileFolderProtectedItem", value = MabFileFolderProtectedItem.class), + @JsonSubTypes.Type(name = "Microsoft.Sql/servers/databases", value = AzureSqlProtectedItem.class) +}) +public class ProtectedItemInner { + /** + * The backup management type associated with the backup item. Possible + * values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', + * 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The workload type for this item. Possible values include: 'Invalid', + * 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', + * 'DPMUnknown'. + */ + @JsonProperty(value = "workloadType") + private DataSourceType workloadType; + + /** + * The ID of the resource to be backed up. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * The ID of the backup policy associated with this backup item. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /** + * The timestamp when the most recent backup copy was created for this + * backup item. + */ + @JsonProperty(value = "lastRecoveryPoint") + private DateTime lastRecoveryPoint; + + /** + * Get the backup management type associated with the backup item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type associated with the backup item. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectedItemInner object itself. + */ + public ProtectedItemInner withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @return the workloadType value + */ + public DataSourceType workloadType() { + return this.workloadType; + } + + /** + * Set the workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'. + * + * @param workloadType the workloadType value to set + * @return the ProtectedItemInner object itself. + */ + public ProtectedItemInner withWorkloadType(DataSourceType workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the ID of the resource to be backed up. + * + * @return the sourceResourceId value + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the ID of the resource to be backed up. + * + * @param sourceResourceId the sourceResourceId value to set + * @return the ProtectedItemInner object itself. + */ + public ProtectedItemInner withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Get the ID of the backup policy associated with this backup item. + * + * @return the policyId value + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the ID of the backup policy associated with this backup item. + * + * @param policyId the policyId value to set + * @return the ProtectedItemInner object itself. + */ + public ProtectedItemInner withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the timestamp when the most recent backup copy was created for this backup item. + * + * @return the lastRecoveryPoint value + */ + public DateTime lastRecoveryPoint() { + return this.lastRecoveryPoint; + } + + /** + * Set the timestamp when the most recent backup copy was created for this backup item. + * + * @param lastRecoveryPoint the lastRecoveryPoint value to set + * @return the ProtectedItemInner object itself. + */ + public ProtectedItemInner withLastRecoveryPoint(DateTime lastRecoveryPoint) { + this.lastRecoveryPoint = lastRecoveryPoint; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationResultsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationResultsImpl.java new file mode 100644 index 000000000000..d84ec3b548f4 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationResultsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemOperationResults; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupFabricVaultProtectedItemResource; + +class ProtectedItemOperationResultsImpl extends WrapperImpl implements ProtectedItemOperationResults { + private final RecoveryServicesManager manager; + + ProtectedItemOperationResultsImpl(RecoveryServicesManager manager) { + super(manager.inner().protectedItemOperationResults()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private BackupFabricVaultProtectedItemResourceImpl wrapModel(ProtectedItemResourceInner inner) { + return new BackupFabricVaultProtectedItemResourceImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + ProtectedItemOperationResultsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId) + .map(new Func1() { + @Override + public BackupFabricVaultProtectedItemResource call(ProtectedItemResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationResultsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationResultsInner.java new file mode 100644 index 000000000000..2208648980e0 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationResultsInner.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectedItemOperationResults. + */ +public class ProtectedItemOperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private ProtectedItemOperationResultsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectedItemOperationResultsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectedItemOperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectedItemOperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectedItemOperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemOperationResults get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the result of any operation on the backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET 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 ProtectedItemResourceInner object if successful. + */ + public ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).toBlocking().single().body(); + } + + /** + * Gets the result of any operation on the backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId), serviceCallback); + } + + /** + * Gets the result of any operation on the backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectedItemResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).map(new Func1, ProtectedItemResourceInner>() { + @Override + public ProtectedItemResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the result of any operation on the backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectedItemResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationStatusesImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationStatusesImpl.java new file mode 100644 index 000000000000..4a39146f24a8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationStatusesImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemOperationStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupFabricVaultOperationStatus; + +class ProtectedItemOperationStatusesImpl extends WrapperImpl implements ProtectedItemOperationStatuses { + private final RecoveryServicesManager manager; + + ProtectedItemOperationStatusesImpl(RecoveryServicesManager manager) { + super(manager.inner().protectedItemOperationStatuses()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private BackupFabricVaultOperationStatusImpl wrapModel(OperationStatusInner inner) { + return new BackupFabricVaultOperationStatusImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + ProtectedItemOperationStatusesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId) + .map(new Func1() { + @Override + public BackupFabricVaultOperationStatus call(OperationStatusInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationStatusesInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationStatusesInner.java new file mode 100644 index 000000000000..c14e68c2aa82 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemOperationStatusesInner.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectedItemOperationStatuses. + */ +public class ProtectedItemOperationStatusesInner { + /** The Retrofit service to perform REST calls. */ + private ProtectedItemOperationStatusesService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectedItemOperationStatusesInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectedItemOperationStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectedItemOperationStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectedItemOperationStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemOperationStatuses get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be: In progress, Completed, or Failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET 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 OperationStatusInner object if successful. + */ + public OperationStatusInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).toBlocking().single().body(); + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be: In progress, Completed, or Failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId), serviceCallback); + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be: In progress, Completed, or Failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).map(new Func1, OperationStatusInner>() { + @Override + public OperationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of an operation such as triggering a backup or restore. The status can be: In progress, Completed, or Failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param operationId The OperationID used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemResourceImpl.java new file mode 100644 index 000000000000..38f03a056193 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemResourceImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class ProtectedItemResourceImpl extends IndexableRefreshableWrapperImpl implements ProtectedItemResource { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String fabricName; + private String containerName; + private String protectedItemName; + + ProtectedItemResourceImpl(ProtectedItemResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.fabricName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupFabrics"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectionContainers"); + this.protectedItemName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectedItems"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProtectedItemsInner client = this.manager().inner().protectedItems(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName, this.protectedItemName); + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectedItemInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemResourceInner.java new file mode 100644 index 000000000000..93a703a374d5 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemResourceInner.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The base class for backup items. + */ +@SkipParentValidation +public class ProtectedItemResourceInner extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private ProtectedItemInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public ProtectedItemInner properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withProperties(ProtectedItemInner properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the ProtectedItemResourceInner object itself. + */ + public ProtectedItemResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemsImpl.java new file mode 100644 index 000000000000..bb75f6f60217 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItems; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemResource; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultProtectedItemResource; + +class ProtectedItemsImpl extends WrapperImpl implements ProtectedItems { + private final RecoveryServicesManager manager; + + ProtectedItemsImpl(RecoveryServicesManager manager) { + super(manager.inner().protectedItems()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private ProtectedItemResourceImpl wrapModel(ProtectedItemResourceInner inner) { + return new ProtectedItemResourceImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + ProtectedItemsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName) + .map(new Func1() { + @Override + public ProtectedItemResource call(ProtectedItemResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + ProtectedItemsInner client = this.inner(); + return client.deleteAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).toCompletable(); + } + + private VaultProtectedItemResourceImpl wrapVaultProtectedItemResourceModel(ProtectedItemResourceInner inner) { + return new VaultProtectedItemResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String vaultName, final String resourceGroupName) { + ProtectedItemsInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public VaultProtectedItemResource call(ProtectedItemResourceInner inner) { + return wrapVaultProtectedItemResourceModel(inner); + } + }); + } + + @Override + public Completable createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner resourceProtectedItem) { + ProtectedItemsInner client = this.inner(); + return client.createOrUpdateAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceProtectedItem).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemsInner.java new file mode 100644 index 000000000000..f290dcbe0818 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectedItemsInner.java @@ -0,0 +1,883 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectedItems. + */ +public class ProtectedItemsInner { + /** The Retrofit service to perform REST calls. */ + private ProtectedItemsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectedItemsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectedItemsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectedItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectedItems to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectedItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItems list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems") + Observable> list(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.recoveryservices.backup.v2016_06_01.ProtectedItems get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.recoveryservices.backup.v2016_06_01.ProtectedItems createOrUpdate" }) + @PUT("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") + Observable> createOrUpdate(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Query("api-version") String apiVersion, @Body ProtectedItemResourceInner resourceProtectedItem, @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.recoveryservices.backup.v2016_06_01.ProtectedItems delete" }) + @HTTP(path = "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @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.recoveryservices.backup.v2016_06_01.ProtectedItems listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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<ProtectedItemResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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 vaultName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectedItemResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectedItemResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName) { + return listSinglePageAsync(vaultName, 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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectedItemResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + final String skipToken = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, 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); + } + } + }); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter itemType eq { VM , FileFolder , AzureSqlDb , SQLDB , Exchange , Sharepoint , DPMUnknown } and providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and policyName eq {policyName} and containerName eq {containername} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @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<ProtectedItemResourceInner> object if successful. + */ + public PagedList list(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter itemType eq { VM , FileFolder , AzureSqlDb , SQLDB , Exchange , Sharepoint , DPMUnknown } and providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and policyName eq {policyName} and containerName eq {containername} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @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 vaultName, final String resourceGroupName, final String filter, final String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter itemType eq { VM , FileFolder , AzureSqlDb , SQLDB , Exchange , Sharepoint , DPMUnknown } and providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and policyName eq {policyName} and containerName eq {containername} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectedItemResourceInner> object + */ + public Observable> listAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter itemType eq { VM , FileFolder , AzureSqlDb , SQLDB , Exchange , Sharepoint , DPMUnknown } and providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and policyName eq {policyName} and containerName eq {containername} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProtectedItemResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + return listSinglePageAsync(vaultName, resourceGroupName, filter, 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)); + } + }); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + ServiceResponse> * @param vaultName The name of the Recovery Services vault. + ServiceResponse> * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + ServiceResponse> * @param filter itemType eq { VM , FileFolder , AzureSqlDb , SQLDB , Exchange , Sharepoint , DPMUnknown } and providerType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql } and policyName eq {policyName} and containerName eq {containername} and backupManagementType eq { AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }. + ServiceResponse> * @param skipToken The Skip Token filter. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectedItemResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String vaultName, final String resourceGroupName, final String filter, final String skipToken) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, 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); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET 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 ProtectedItemResourceInner object if successful. + */ + public ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).toBlocking().single().body(); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName), serviceCallback); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectedItemResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).map(new Func1, ProtectedItemResourceInner>() { + @Override + public ProtectedItemResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectedItemResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @param filter expand eq {extendedInfo}. This filter enables you to choose (or filter) specific items in the list of backup items. + * @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 ProtectedItemResourceInner object if successful. + */ + public ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter).toBlocking().single().body(); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @param filter expand eq {extendedInfo}. This filter enables you to choose (or filter) specific items in the list of backup items. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), serviceCallback); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @param filter expand eq {extendedInfo}. This filter enables you to choose (or filter) specific items in the list of backup items. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectedItemResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter).map(new Func1, ProtectedItemResourceInner>() { + @Override + public ProtectedItemResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the details of the backup item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item name used in this GET operation. + * @param filter expand eq {extendedInfo}. This filter enables you to choose (or filter) specific items in the list of backup items. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectedItemResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * This operation enables an item to be backed up, or modifies the existing backup policy information for an item that has been backed up. This is an asynchronous operation. To learn the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of the backup item. + * @param resourceProtectedItem The resource backup item. + * @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 createOrUpdate(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner resourceProtectedItem) { + createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceProtectedItem).toBlocking().single().body(); + } + + /** + * This operation enables an item to be backed up, or modifies the existing backup policy information for an item that has been backed up. This is an asynchronous operation. To learn the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of the backup item. + * @param resourceProtectedItem The resource backup item. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner resourceProtectedItem, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceProtectedItem), serviceCallback); + } + + /** + * This operation enables an item to be backed up, or modifies the existing backup policy information for an item that has been backed up. This is an asynchronous operation. To learn the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of the backup item. + * @param resourceProtectedItem The resource backup item. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner resourceProtectedItem) { + return createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, resourceProtectedItem).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This operation enables an item to be backed up, or modifies the existing backup policy information for an item that has been backed up. This is an asynchronous operation. To learn the status of the operation, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of the backup item. + * @param resourceProtectedItem The resource backup item. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createOrUpdateWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner resourceProtectedItem) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName 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 (resourceProtectedItem == null) { + throw new IllegalArgumentException("Parameter resourceProtectedItem is required and cannot be null."); + } + Validator.validate(resourceProtectedItem); + return service.createOrUpdate(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, this.client.apiVersion(), resourceProtectedItem, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Used to disable the backup job for an item within a container. This is an asynchronous operation. To learn the status of the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item to be deleted. + * @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 vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + deleteWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).toBlocking().single().body(); + } + + /** + * Used to disable the backup job for an item within a container. This is an asynchronous operation. To learn the status of the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item to be deleted. + * @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 vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName), serviceCallback); + } + + /** + * Used to disable the backup job for an item within a container. This is an asynchronous operation. To learn the status of the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + return deleteWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Used to disable the backup job for an item within a container. This is an asynchronous operation. To learn the status of the request, call the GetItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The backup item to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @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<ProtectedItemResourceInner> 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(); + } + }; + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @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); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @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<ProtectedItemResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + * @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<ProtectedItemResourceInner> 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)); + } + }); + } + + /** + * Provides a pageable list of all items in a subscription, that can be protected. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProtectedItemResourceInner> 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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl.java new file mode 100644 index 000000000000..aecd86d0d15c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerBackupFabricVaultProtectionContainerResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl extends IndexableRefreshableWrapperImpl implements ProtectionContainerBackupFabricVaultProtectionContainerResource { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String fabricName; + private String containerName; + private String operationId; + + ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl(ProtectionContainerResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.fabricName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupFabrics"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectionContainers"); + this.operationId = IdParsingUtils.getValueFromIdByName(inner.id(), "operationResults"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProtectionContainerOperationResultsInner client = this.manager().inner().protectionContainerOperationResults(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName, this.operationId); + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectionContainerInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerInner.java new file mode 100644 index 000000000000..c744ea401070 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerInner.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupManagementType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for a container with backup items. Containers with specific + * workloads are derived from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "protectableObjectType") +@JsonTypeName("ProtectionContainer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureSqlContainer", value = AzureSqlContainer.class), + @JsonSubTypes.Type(name = "IaaSVMContainer", value = IaaSVMContainer.class), + @JsonSubTypes.Type(name = "MABWindowsContainer", value = MabContainer.class) +}) +public class ProtectionContainerInner { + /** + * Friendly name of the container. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The backup management type for the container. Possible values include: + * 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + */ + @JsonProperty(value = "backupManagementType") + private BackupManagementType backupManagementType; + + /** + * The container's registration status with the Recovery Services vault. + */ + @JsonProperty(value = "registrationStatus") + private String registrationStatus; + + /** + * The status of the container's health. + */ + @JsonProperty(value = "healthStatus") + private String healthStatus; + + /** + * The type assigned to the container. The values to use for each of these + * properties are:<br/> 1. Compute Azure VM is + * Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM + * is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows + * machines (like Azure Backup Server and DPM) is Windows<br/> 4. + * Azure SQL instance is AzureSqlContainer. + */ + @JsonProperty(value = "containerType", access = JsonProperty.Access.WRITE_ONLY) + private String containerType; + + /** + * Get friendly name of the container. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set friendly name of the container. + * + * @param friendlyName the friendlyName value to set + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the backup management type for the container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @return the backupManagementType value + */ + public BackupManagementType backupManagementType() { + return this.backupManagementType; + } + + /** + * Set the backup management type for the container. Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql'. + * + * @param backupManagementType the backupManagementType value to set + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withBackupManagementType(BackupManagementType backupManagementType) { + this.backupManagementType = backupManagementType; + return this; + } + + /** + * Get the container's registration status with the Recovery Services vault. + * + * @return the registrationStatus value + */ + public String registrationStatus() { + return this.registrationStatus; + } + + /** + * Set the container's registration status with the Recovery Services vault. + * + * @param registrationStatus the registrationStatus value to set + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withRegistrationStatus(String registrationStatus) { + this.registrationStatus = registrationStatus; + return this; + } + + /** + * Get the status of the container's health. + * + * @return the healthStatus value + */ + public String healthStatus() { + return this.healthStatus; + } + + /** + * Set the status of the container's health. + * + * @param healthStatus the healthStatus value to set + * @return the ProtectionContainerInner object itself. + */ + public ProtectionContainerInner withHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + /** + * Get the type assigned to the container. The values to use for each of these properties are:<br/> 1. Compute Azure VM is Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows machines (like Azure Backup Server and DPM) is Windows<br/> 4. Azure SQL instance is AzureSqlContainer. + * + * @return the containerType value + */ + public String containerType() { + return this.containerType; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerOperationResultsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerOperationResultsImpl.java new file mode 100644 index 000000000000..72f2fdc48e73 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerOperationResultsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerOperationResults; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerBackupFabricVaultProtectionContainerResource; + +class ProtectionContainerOperationResultsImpl extends WrapperImpl implements ProtectionContainerOperationResults { + private final RecoveryServicesManager manager; + + ProtectionContainerOperationResultsImpl(RecoveryServicesManager manager) { + super(manager.inner().protectionContainerOperationResults()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl wrapModel(ProtectionContainerResourceInner inner) { + return new ProtectionContainerBackupFabricVaultProtectionContainerResourceImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + ProtectionContainerOperationResultsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName, operationId) + .map(new Func1() { + @Override + public ProtectionContainerBackupFabricVaultProtectionContainerResource call(ProtectionContainerResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerOperationResultsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerOperationResultsInner.java new file mode 100644 index 000000000000..b99438e75cda --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerOperationResultsInner.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectionContainerOperationResults. + */ +public class ProtectionContainerOperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private ProtectionContainerOperationResultsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionContainerOperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectionContainerOperationResultsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectionContainerOperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectionContainerOperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectionContainerOperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerOperationResults get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the result of any operation on the container. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @param operationId The operation ID used for this GET 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 ProtectionContainerResourceInner object if successful. + */ + public ProtectionContainerResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, operationId).toBlocking().single().body(); + } + + /** + * Gets the result of any operation on the container. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @param operationId The operation ID used for this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, operationId), serviceCallback); + } + + /** + * Gets the result of any operation on the container. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @param operationId The operation ID used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionContainerResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, operationId).map(new Func1, ProtectionContainerResourceInner>() { + @Override + public ProtectionContainerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the result of any operation on the container. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @param operationId The operation ID used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionContainerResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerRefreshOperationResultsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerRefreshOperationResultsImpl.java new file mode 100644 index 000000000000..b6e84b639bc8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerRefreshOperationResultsImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerRefreshOperationResults; +import rx.Completable; + +class ProtectionContainerRefreshOperationResultsImpl extends WrapperImpl implements ProtectionContainerRefreshOperationResults { + private final RecoveryServicesManager manager; + + ProtectionContainerRefreshOperationResultsImpl(RecoveryServicesManager manager) { + super(manager.inner().protectionContainerRefreshOperationResults()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Completable getAsync(String vaultName, String resourceGroupName, String fabricName, String operationId) { + ProtectionContainerRefreshOperationResultsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, operationId).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerRefreshOperationResultsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerRefreshOperationResultsInner.java new file mode 100644 index 000000000000..b40db457e254 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerRefreshOperationResultsInner.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectionContainerRefreshOperationResults. + */ +public class ProtectionContainerRefreshOperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private ProtectionContainerRefreshOperationResultsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionContainerRefreshOperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectionContainerRefreshOperationResultsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectionContainerRefreshOperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectionContainerRefreshOperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectionContainerRefreshOperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerRefreshOperationResults get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param operationId The operation ID used for this GET 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 + */ + public void get(String vaultName, String resourceGroupName, String fabricName, String operationId) { + getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, operationId).toBlocking().single().body(); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param operationId The operation ID used for this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, operationId), serviceCallback); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param operationId The operation ID used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, operationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the result of the refresh operation triggered by the BeginRefresh operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param operationId The operation ID used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerResourceImpl.java new file mode 100644 index 000000000000..e530a8ed7184 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerResourceImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class ProtectionContainerResourceImpl extends WrapperImpl implements ProtectionContainerResource { + private final RecoveryServicesManager manager; + + ProtectionContainerResourceImpl(ProtectionContainerResourceInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectionContainerInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerResourceInner.java new file mode 100644 index 000000000000..cc85788367f2 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainerResourceInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Base class for a container with backup items. Containers with specific + * workloads are derived from this class. + */ +@SkipParentValidation +public class ProtectionContainerResourceInner extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private ProtectionContainerInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public ProtectionContainerInner properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the ProtectionContainerResourceInner object itself. + */ + public ProtectionContainerResourceInner withProperties(ProtectionContainerInner properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the ProtectionContainerResourceInner object itself. + */ + public ProtectionContainerResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the ProtectionContainerResourceInner object itself. + */ + public ProtectionContainerResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the ProtectionContainerResourceInner object itself. + */ + public ProtectionContainerResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the ProtectionContainerResourceInner object itself. + */ + public ProtectionContainerResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersImpl.java new file mode 100644 index 000000000000..ecd392051abe --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainers; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupFabricVaultProtectionContainerResource; +import java.util.List; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerResource; +import rx.Completable; + +class ProtectionContainersImpl extends WrapperImpl implements ProtectionContainers { + private final RecoveryServicesManager manager; + + ProtectionContainersImpl(RecoveryServicesManager manager) { + super(manager.inner().protectionContainers()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private BackupFabricVaultProtectionContainerResourceImpl wrapModel(ProtectionContainerResourceInner inner) { + return new BackupFabricVaultProtectionContainerResourceImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + ProtectionContainersInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName) + .map(new Func1() { + @Override + public BackupFabricVaultProtectionContainerResource call(ProtectionContainerResourceInner inner) { + return wrapModel(inner); + } + }); + } + + private ProtectionContainerResourceImpl wrapProtectionContainerResourceModel(ProtectionContainerResourceInner inner) { + return new ProtectionContainerResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(String vaultName, String resourceGroupName) { + ProtectionContainersInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ProtectionContainerResource call(ProtectionContainerResourceInner inner) { + return wrapProtectionContainerResourceModel(inner); + } + }); + } + + @Override + public Completable refreshAsync(String vaultName, String resourceGroupName, String fabricName) { + ProtectionContainersInner client = this.inner(); + return client.refreshAsync(vaultName, resourceGroupName, fabricName).toCompletable(); + } + + @Override + public Completable unregisterAsync(String resourceGroupName, String vaultName, String identityName) { + ProtectionContainersInner client = this.inner(); + return client.unregisterAsync(resourceGroupName, vaultName, identityName).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java new file mode 100644 index 000000000000..e47f807142fc --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java @@ -0,0 +1,541 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectionContainers. + */ +public class ProtectionContainersInner { + /** The Retrofit service to perform REST calls. */ + private ProtectionContainersService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectionContainersInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectionContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectionContainers to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectionContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainers get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @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.recoveryservices.backup.v2016_06_01.ProtectionContainers list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers") + Observable> list(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.recoveryservices.backup.v2016_06_01.ProtectionContainers refresh" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers") + Observable> refresh(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @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.recoveryservices.backup.v2016_06_01.ProtectionContainers unregister" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}", method = "DELETE", hasBody = true) + Observable> unregister(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("identityName") String identityName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets details of the specific container registered to your Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET 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 ProtectionContainerResourceInner object if successful. + */ + public ProtectionContainerResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).toBlocking().single().body(); + } + + /** + * Gets details of the specific container registered to your Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName), serviceCallback); + } + + /** + * Gets details of the specific container registered to your Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionContainerResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName).map(new Func1, ProtectionContainerResourceInner>() { + @Override + public ProtectionContainerResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details of the specific container registered to your Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @param containerName The container name used for this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionContainerResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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<ProtectionContainerResourceInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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(String vaultName, String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(vaultName, resourceGroupName), serviceCallback); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionContainerResourceInner> object + */ + public Observable> listAsync(String vaultName, String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionContainerResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(String vaultName, String resourceGroupName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation is used to sort or filter the containers registered to the vault. providerType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql} and status eq {Unknown, NotRegistered, Registered, Registering} and friendlyName eq {containername} and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @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<ProtectionContainerResourceInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName, String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter).toBlocking().single().body(); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation is used to sort or filter the containers registered to the vault. providerType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql} and status eq {Unknown, NotRegistered, Registered, Registering} and friendlyName eq {containername} and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @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(String vaultName, String resourceGroupName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(vaultName, resourceGroupName, filter), serviceCallback); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation is used to sort or filter the containers registered to the vault. providerType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql} and status eq {Unknown, NotRegistered, Registered, Registering} and friendlyName eq {containername} and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionContainerResourceInner> object + */ + public Observable> listAsync(String vaultName, String resourceGroupName, String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the containers registered to the Recovery Services vault. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation is used to sort or filter the containers registered to the vault. providerType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql} and status eq {Unknown, NotRegistered, Registered, Registering} and friendlyName eq {containername} and backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionContainerResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(String vaultName, String resourceGroupName, String filter) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Discovers the containers in the subscription that can be protected in a Recovery Services vault. This is an asynchronous operation. To learn the status of the operation, use the GetRefreshOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @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 refresh(String vaultName, String resourceGroupName, String fabricName) { + refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName).toBlocking().single().body(); + } + + /** + * Discovers the containers in the subscription that can be protected in a Recovery Services vault. This is an asynchronous operation. To learn the status of the operation, use the GetRefreshOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @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 refreshAsync(String vaultName, String resourceGroupName, String fabricName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName), serviceCallback); + } + + /** + * Discovers the containers in the subscription that can be protected in a Recovery Services vault. This is an asynchronous operation. To learn the status of the operation, use the GetRefreshOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable refreshAsync(String vaultName, String resourceGroupName, String fabricName) { + return refreshWithServiceResponseAsync(vaultName, resourceGroupName, fabricName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Discovers the containers in the subscription that can be protected in a Recovery Services vault. This is an asynchronous operation. To learn the status of the operation, use the GetRefreshOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> refreshWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName 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.refresh(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = refreshDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse refreshDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param vaultName The name of the Recovery Services vault. + * @param identityName Name of the protection container to unregister. + * @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 unregister(String resourceGroupName, String vaultName, String identityName) { + unregisterWithServiceResponseAsync(resourceGroupName, vaultName, identityName).toBlocking().single().body(); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param vaultName The name of the Recovery Services vault. + * @param identityName Name of the protection container to unregister. + * @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 unregisterAsync(String resourceGroupName, String vaultName, String identityName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unregisterWithServiceResponseAsync(resourceGroupName, vaultName, identityName), serviceCallback); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param vaultName The name of the Recovery Services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable unregisterAsync(String resourceGroupName, String vaultName, String identityName) { + return unregisterWithServiceResponseAsync(resourceGroupName, vaultName, identityName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unregisters the given container from your Recovery Services vault. + * + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param vaultName The name of the Recovery Services vault. + * @param identityName Name of the protection container to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> unregisterWithServiceResponseAsync(String resourceGroupName, String vaultName, String identityName) { + 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 (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (identityName == null) { + throw new IllegalArgumentException("Parameter identityName 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.unregister(this.client.subscriptionId(), resourceGroupName, vaultName, identityName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unregisterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse unregisterDelegate(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); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesImpl.java new file mode 100644 index 000000000000..7d0e232cbfdb --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicies; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultProtectionPolicyResource; + +class ProtectionPoliciesImpl extends WrapperImpl implements ProtectionPolicies { + private final RecoveryServicesManager manager; + + ProtectionPoliciesImpl(RecoveryServicesManager manager) { + super(manager.inner().protectionPolicies()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public VaultProtectionPolicyResourceImpl define(String name) { + return wrapModel(name); + } + + private VaultProtectionPolicyResourceImpl wrapModel(ProtectionPolicyResourceInner inner) { + return new VaultProtectionPolicyResourceImpl(inner, manager()); + } + + private VaultProtectionPolicyResourceImpl wrapModel(String name) { + return new VaultProtectionPolicyResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String vaultName, String resourceGroupName) { + ProtectionPoliciesInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public VaultProtectionPolicyResource call(ProtectionPolicyResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String policyName) { + ProtectionPoliciesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, policyName) + .map(new Func1() { + @Override + public VaultProtectionPolicyResource call(ProtectionPolicyResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String vaultName, String resourceGroupName, String policyName) { + ProtectionPoliciesInner client = this.inner(); + return client.deleteAsync(vaultName, resourceGroupName, policyName).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesInner.java new file mode 100644 index 000000000000..4e41ce41581a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPoliciesInner.java @@ -0,0 +1,547 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectionPolicies. + */ +public class ProtectionPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ProtectionPoliciesService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectionPoliciesInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectionPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectionPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectionPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicies get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("policyName") String policyName, @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.recoveryservices.backup.v2016_06_01.ProtectionPolicies createOrUpdate" }) + @PUT("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") + Observable> createOrUpdate(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("policyName") String policyName, @Query("api-version") String apiVersion, @Body ProtectionPolicyResourceInner resourceProtectionPolicy, @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.recoveryservices.backup.v2016_06_01.ProtectionPolicies delete" }) + @HTTP(path = "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("policyName") String policyName, @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.recoveryservices.backup.v2016_06_01.ProtectionPolicies list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies") + Observable> list(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the details of the backup policy associated with the Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET 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 ProtectionPolicyResourceInner object if successful. + */ + public ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, policyName).toBlocking().single().body(); + } + + /** + * Gets the details of the backup policy associated with the Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, policyName), serviceCallback); + } + + /** + * Gets the details of the backup policy associated with the Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionPolicyResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String policyName) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, policyName).map(new Func1, ProtectionPolicyResourceInner>() { + @Override + public ProtectionPolicyResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of the backup policy associated with the Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionPolicyResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String policyName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), policyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy to be created. + * @param resourceProtectionPolicy The resource backup policy. + * @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 ProtectionPolicyResourceInner object if successful. + */ + public ProtectionPolicyResourceInner createOrUpdate(String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner resourceProtectionPolicy) { + return createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, policyName, resourceProtectionPolicy).toBlocking().single().body(); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy to be created. + * @param resourceProtectionPolicy The resource backup policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner resourceProtectionPolicy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, policyName, resourceProtectionPolicy), serviceCallback); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy to be created. + * @param resourceProtectionPolicy The resource backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionPolicyResourceInner object + */ + public Observable createOrUpdateAsync(String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner resourceProtectionPolicy) { + return createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, policyName, resourceProtectionPolicy).map(new Func1, ProtectionPolicyResourceInner>() { + @Override + public ProtectionPolicyResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or modifies a backup policy. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy to be created. + * @param resourceProtectionPolicy The resource backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionPolicyResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String vaultName, String resourceGroupName, String policyName, ProtectionPolicyResourceInner resourceProtectionPolicy) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName 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 (resourceProtectionPolicy == null) { + throw new IllegalArgumentException("Parameter resourceProtectionPolicy is required and cannot be null."); + } + Validator.validate(resourceProtectionPolicy); + return service.createOrUpdate(vaultName, resourceGroupName, this.client.subscriptionId(), policyName, this.client.apiVersion(), resourceProtectionPolicy, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws 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 the specified backup policy from your Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The name of the backup policy to be deleted. + * @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 vaultName, String resourceGroupName, String policyName) { + deleteWithServiceResponseAsync(vaultName, resourceGroupName, policyName).toBlocking().single().body(); + } + + /** + * Deletes the specified backup policy from your Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The name of the backup policy to be deleted. + * @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 vaultName, String resourceGroupName, String policyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(vaultName, resourceGroupName, policyName), serviceCallback); + } + + /** + * Deletes the specified backup policy from your Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The name of the backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String vaultName, String resourceGroupName, String policyName) { + return deleteWithServiceResponseAsync(vaultName, resourceGroupName, policyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified backup policy from your Recovery Services vault. This is an asynchronous operation. Use the GetPolicyOperationResult API to Get the operation status. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The name of the backup policy to be deleted. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String vaultName, String resourceGroupName, String policyName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(vaultName, resourceGroupName, this.client.subscriptionId(), policyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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<ProtectionPolicyResourceInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @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(String vaultName, String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(vaultName, resourceGroupName), serviceCallback); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionPolicyResourceInner> object + */ + public Observable> listAsync(String vaultName, String resourceGroupName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionPolicyResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(String vaultName, String resourceGroupName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of backup policies. backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @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<ProtectionPolicyResourceInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName, String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter).toBlocking().single().body(); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of backup policies. backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @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(String vaultName, String resourceGroupName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(vaultName, resourceGroupName, filter), serviceCallback); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of backup policies. backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionPolicyResourceInner> object + */ + public Observable> listAsync(String vaultName, String resourceGroupName, String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the backup policies associated with the Recovery Services vault. The API provides parameters to Get scoped results. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param filter The following equation can be used to filter the list of backup policies. backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProtectionPolicyResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(String vaultName, String resourceGroupName, String filter) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws 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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyInner.java new file mode 100644 index 000000000000..962de350f067 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyInner.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for a backup policy. Workload-specific backup policies are + * derived from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "backupManagementType") +@JsonTypeName("ProtectionPolicy") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureIaasVM", value = AzureIaaSVMProtectionPolicy.class), + @JsonSubTypes.Type(name = "MAB", value = MabProtectionPolicy.class), + @JsonSubTypes.Type(name = "AzureSql", value = AzureSqlProtectionPolicy.class) +}) +public class ProtectionPolicyInner { + /** + * The number of items associated with this policy. + */ + @JsonProperty(value = "protectedItemsCount") + private Integer protectedItemsCount; + + /** + * Get the number of items associated with this policy. + * + * @return the protectedItemsCount value + */ + public Integer protectedItemsCount() { + return this.protectedItemsCount; + } + + /** + * Set the number of items associated with this policy. + * + * @param protectedItemsCount the protectedItemsCount value to set + * @return the ProtectionPolicyInner object itself. + */ + public ProtectionPolicyInner withProtectedItemsCount(Integer protectedItemsCount) { + this.protectedItemsCount = protectedItemsCount; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationResultsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationResultsImpl.java new file mode 100644 index 000000000000..6a71349ef367 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationResultsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicyOperationResults; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupPolicyVaultProtectionPolicyResource; + +class ProtectionPolicyOperationResultsImpl extends WrapperImpl implements ProtectionPolicyOperationResults { + private final RecoveryServicesManager manager; + + ProtectionPolicyOperationResultsImpl(RecoveryServicesManager manager) { + super(manager.inner().protectionPolicyOperationResults()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private BackupPolicyVaultProtectionPolicyResourceImpl wrapModel(ProtectionPolicyResourceInner inner) { + return new BackupPolicyVaultProtectionPolicyResourceImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String policyName, String operationId) { + ProtectionPolicyOperationResultsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, policyName, operationId) + .map(new Func1() { + @Override + public BackupPolicyVaultProtectionPolicyResource call(ProtectionPolicyResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationResultsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationResultsInner.java new file mode 100644 index 000000000000..acc9209f6c1d --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationResultsInner.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectionPolicyOperationResults. + */ +public class ProtectionPolicyOperationResultsInner { + /** The Retrofit service to perform REST calls. */ + private ProtectionPolicyOperationResultsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionPolicyOperationResultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectionPolicyOperationResultsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectionPolicyOperationResultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectionPolicyOperationResults to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectionPolicyOperationResultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicyOperationResults get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("policyName") String policyName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET 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 ProtectionPolicyResourceInner object if successful. + */ + public ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, policyName, operationId).toBlocking().single().body(); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String policyName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, policyName, operationId), serviceCallback); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionPolicyResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String policyName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, policyName, operationId).map(new Func1, ProtectionPolicyResourceInner>() { + @Override + public ProtectionPolicyResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the result of an operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProtectionPolicyResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String policyName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), policyName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationStatusesImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationStatusesImpl.java new file mode 100644 index 000000000000..e4cc3c3889f9 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationStatusesImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicyOperationStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupPolicyVaultOperationStatus; + +class ProtectionPolicyOperationStatusesImpl extends WrapperImpl implements ProtectionPolicyOperationStatuses { + private final RecoveryServicesManager manager; + + ProtectionPolicyOperationStatusesImpl(RecoveryServicesManager manager) { + super(manager.inner().protectionPolicyOperationStatuses()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private BackupPolicyVaultOperationStatusImpl wrapModel(OperationStatusInner inner) { + return new BackupPolicyVaultOperationStatusImpl(inner, manager()); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String policyName, String operationId) { + ProtectionPolicyOperationStatusesInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, policyName, operationId) + .map(new Func1() { + @Override + public BackupPolicyVaultOperationStatus call(OperationStatusInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationStatusesInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationStatusesInner.java new file mode 100644 index 000000000000..e92836e9df6c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyOperationStatusesInner.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProtectionPolicyOperationStatuses. + */ +public class ProtectionPolicyOperationStatusesInner { + /** The Retrofit service to perform REST calls. */ + private ProtectionPolicyOperationStatusesService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of ProtectionPolicyOperationStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProtectionPolicyOperationStatusesInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(ProtectionPolicyOperationStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProtectionPolicyOperationStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface ProtectionPolicyOperationStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicyOperationStatuses get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("policyName") String policyName, @Path("operationId") String operationId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides the status of the asynchronous operations like backup or restore. The status can be: in progress, completed, or failed. You can refer to the Operation Status enumeration for the possible states of an operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET 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 OperationStatusInner object if successful. + */ + public OperationStatusInner get(String vaultName, String resourceGroupName, String policyName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, policyName, operationId).toBlocking().single().body(); + } + + /** + * Provides the status of the asynchronous operations like backup or restore. The status can be: in progress, completed, or failed. You can refer to the Operation Status enumeration for the possible states of an operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String policyName, String operationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, policyName, operationId), serviceCallback); + } + + /** + * Provides the status of the asynchronous operations like backup or restore. The status can be: in progress, completed, or failed. You can refer to the Operation Status enumeration for the possible states of an operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String policyName, String operationId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, policyName, operationId).map(new Func1, OperationStatusInner>() { + @Override + public OperationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the status of the asynchronous operations like backup or restore. The status can be: in progress, completed, or failed. You can refer to the Operation Status enumeration for the possible states of an operation. Some operations create jobs. This method returns the list of jobs associated with the operation. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param policyName The backup policy name used in this GET operation. + * @param operationId The ID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String policyName, String operationId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (policyName == null) { + throw new IllegalArgumentException("Parameter policyName is required and cannot be null."); + } + if (operationId == null) { + throw new IllegalArgumentException("Parameter operationId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), policyName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyResourceInner.java new file mode 100644 index 000000000000..e4e0c760509e --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionPolicyResourceInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The base class for backup policy. Workload-specific backup policies are + * derived from this class. + */ +@SkipParentValidation +public class ProtectionPolicyResourceInner extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private ProtectionPolicyInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public ProtectionPolicyInner properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the ProtectionPolicyResourceInner object itself. + */ + public ProtectionPolicyResourceInner withProperties(ProtectionPolicyInner properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the ProtectionPolicyResourceInner object itself. + */ + public ProtectionPolicyResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the ProtectionPolicyResourceInner object itself. + */ + public ProtectionPolicyResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the ProtectionPolicyResourceInner object itself. + */ + public ProtectionPolicyResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the ProtectionPolicyResourceInner object itself. + */ + public ProtectionPolicyResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointInner.java new file mode 100644 index 000000000000..851d4cc2795c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointInner.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The base class for backup copies. Workload-specific backup copies are + * derived from this class. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType") +@JsonTypeName("RecoveryPoint") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IaasVMRecoveryPoint", value = IaasVMRecoveryPoint.class), + @JsonSubTypes.Type(name = "GenericRecoveryPoint", value = GenericRecoveryPoint.class) +}) +public class RecoveryPointInner { +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointResourceImpl.java new file mode 100644 index 000000000000..5e16e6319119 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointResourceImpl.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.RecoveryPointResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class RecoveryPointResourceImpl extends IndexableRefreshableWrapperImpl implements RecoveryPointResource { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String fabricName; + private String containerName; + private String protectedItemName; + private String recoveryPointId; + + RecoveryPointResourceImpl(RecoveryPointResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.fabricName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupFabrics"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectionContainers"); + this.protectedItemName = IdParsingUtils.getValueFromIdByName(inner.id(), "protectedItems"); + this.recoveryPointId = IdParsingUtils.getValueFromIdByName(inner.id(), "recoveryPoints"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + RecoveryPointsInner client = this.manager().inner().recoveryPoints(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.fabricName, this.containerName, this.protectedItemName, this.recoveryPointId); + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public RecoveryPointInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointResourceInner.java new file mode 100644 index 000000000000..1f66d90d909c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointResourceInner.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The base class for backup copies. Workload-specific backup copies are + * derived from this class. + */ +@SkipParentValidation +public class RecoveryPointResourceInner extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private RecoveryPointInner properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public RecoveryPointInner properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the RecoveryPointResourceInner object itself. + */ + public RecoveryPointResourceInner withProperties(RecoveryPointInner properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the RecoveryPointResourceInner object itself. + */ + public RecoveryPointResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the RecoveryPointResourceInner object itself. + */ + public RecoveryPointResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the RecoveryPointResourceInner object itself. + */ + public RecoveryPointResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the RecoveryPointResourceInner object itself. + */ + public RecoveryPointResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsImpl.java new file mode 100644 index 000000000000..877202fe1ca8 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.RecoveryPoints; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.RecoveryPointResource; + +class RecoveryPointsImpl extends WrapperImpl implements RecoveryPoints { + private final RecoveryServicesManager manager; + + RecoveryPointsImpl(RecoveryServicesManager manager) { + super(manager.inner().recoveryPoints()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + private RecoveryPointResourceImpl wrapModel(RecoveryPointResourceInner inner) { + return new RecoveryPointResourceImpl(inner, manager()); + } + + @Override + public Observable listAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + RecoveryPointsInner client = this.inner(); + return client.listAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public RecoveryPointResource call(RecoveryPointResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + RecoveryPointsInner client = this.inner(); + return client.getAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId) + .map(new Func1() { + @Override + public RecoveryPointResource call(RecoveryPointResourceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsInner.java new file mode 100644 index 000000000000..9bb51b5b5542 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryPointsInner.java @@ -0,0 +1,403 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RecoveryPoints. + */ +public class RecoveryPointsInner { + /** The Retrofit service to perform REST calls. */ + private RecoveryPointsService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of RecoveryPointsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RecoveryPointsInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(RecoveryPointsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryPoints to be + * used by Retrofit to perform actually REST calls. + */ + interface RecoveryPointsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.RecoveryPoints get" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") + Observable> get(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("recoveryPointId") String recoveryPointId, @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.recoveryservices.backup.v2016_06_01.RecoveryPoints list" }) + @GET("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints") + Observable> list(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides the backup data for the RecoveryPointID. This is an asynchronous operation. To learn the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with backup item. + * @param containerName The container name associated with backup item. + * @param protectedItemName The name of the backup item used in this GET operation. + * @param recoveryPointId The RecoveryPointID associated with this GET 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 RecoveryPointResourceInner object if successful. + */ + public RecoveryPointResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).toBlocking().single().body(); + } + + /** + * Provides the backup data for the RecoveryPointID. This is an asynchronous operation. To learn the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with backup item. + * @param containerName The container name associated with backup item. + * @param protectedItemName The name of the backup item used in this GET operation. + * @param recoveryPointId The RecoveryPointID associated with this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId), serviceCallback); + } + + /** + * Provides the backup data for the RecoveryPointID. This is an asynchronous operation. To learn the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with backup item. + * @param containerName The container name associated with backup item. + * @param protectedItemName The name of the backup item used in this GET operation. + * @param recoveryPointId The RecoveryPointID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecoveryPointResourceInner object + */ + public Observable getAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + return getWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).map(new Func1, RecoveryPointResourceInner>() { + @Override + public RecoveryPointResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides the backup data for the RecoveryPointID. This is an asynchronous operation. To learn the status of the operation, call the GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with backup item. + * @param containerName The container name associated with backup item. + * @param protectedItemName The name of the backup item used in this GET operation. + * @param recoveryPointId The RecoveryPointID associated with this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RecoveryPointResourceInner object + */ + public Observable> getWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (recoveryPointId == null) { + throw new IllegalArgumentException("Parameter recoveryPointId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET 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 List<RecoveryPointResourceInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).toBlocking().single().body(); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName), serviceCallback); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RecoveryPointResourceInner> object + */ + public Observable> listAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RecoveryPointResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String filter = null; + return service.list(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param filter startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate { yyyy-mm-dd hh:mm:ss PM}. + * @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<RecoveryPointResourceInner> object if successful. + */ + public List list(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter).toBlocking().single().body(); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param filter startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate { yyyy-mm-dd hh:mm:ss PM}. + * @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(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), serviceCallback); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param filter startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate { yyyy-mm-dd hh:mm:ss PM}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RecoveryPointResourceInner> object + */ + public Observable> listAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) { + return listWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the recovery points, or backup copies, for the specified backup item. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup item. + * @param containerName The container name associated with the backup item. + * @param protectedItemName The name of backup item used in this GET operation. + * @param filter startDate eq {yyyy-mm-dd hh:mm:ss PM} and endDate { yyyy-mm-dd hh:mm:ss PM}. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RecoveryPointResourceInner> object + */ + public Observable>> listWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName 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(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws 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/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryServicesBackupClientImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryServicesBackupClientImpl.java new file mode 100644 index 000000000000..bdf3281c4378 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryServicesBackupClientImpl.java @@ -0,0 +1,492 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.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 RecoveryServicesBackupClientImpl class. + */ +public class RecoveryServicesBackupClientImpl 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 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 RecoveryServicesBackupClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public RecoveryServicesBackupClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or 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 RecoveryServicesBackupClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** 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 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 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 RecoveryServicesBackupClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ItemLevelRecoveryConnectionsInner object to access its operations. + */ + private ItemLevelRecoveryConnectionsInner itemLevelRecoveryConnections; + + /** + * Gets the ItemLevelRecoveryConnectionsInner object to access its operations. + * @return the ItemLevelRecoveryConnectionsInner object. + */ + public ItemLevelRecoveryConnectionsInner itemLevelRecoveryConnections() { + return this.itemLevelRecoveryConnections; + } + + /** + * The RestoresInner object to access its operations. + */ + private RestoresInner restores; + + /** + * Gets the RestoresInner object to access its operations. + * @return the RestoresInner object. + */ + public RestoresInner restores() { + return this.restores; + } + + /** + * The ProtectionPolicyOperationStatusesInner object to access its operations. + */ + private ProtectionPolicyOperationStatusesInner protectionPolicyOperationStatuses; + + /** + * Gets the ProtectionPolicyOperationStatusesInner object to access its operations. + * @return the ProtectionPolicyOperationStatusesInner object. + */ + public ProtectionPolicyOperationStatusesInner protectionPolicyOperationStatuses() { + return this.protectionPolicyOperationStatuses; + } + + /** + * The ProtectionPolicyOperationResultsInner object to access its operations. + */ + private ProtectionPolicyOperationResultsInner protectionPolicyOperationResults; + + /** + * Gets the ProtectionPolicyOperationResultsInner object to access its operations. + * @return the ProtectionPolicyOperationResultsInner object. + */ + public ProtectionPolicyOperationResultsInner protectionPolicyOperationResults() { + return this.protectionPolicyOperationResults; + } + + /** + * The ProtectionPoliciesInner object to access its operations. + */ + private ProtectionPoliciesInner protectionPolicies; + + /** + * Gets the ProtectionPoliciesInner object to access its operations. + * @return the ProtectionPoliciesInner object. + */ + public ProtectionPoliciesInner protectionPolicies() { + return this.protectionPolicies; + } + + /** + * The ProtectionContainerOperationResultsInner object to access its operations. + */ + private ProtectionContainerOperationResultsInner protectionContainerOperationResults; + + /** + * Gets the ProtectionContainerOperationResultsInner object to access its operations. + * @return the ProtectionContainerOperationResultsInner object. + */ + public ProtectionContainerOperationResultsInner protectionContainerOperationResults() { + return this.protectionContainerOperationResults; + } + + /** + * The ProtectionContainerRefreshOperationResultsInner object to access its operations. + */ + private ProtectionContainerRefreshOperationResultsInner protectionContainerRefreshOperationResults; + + /** + * Gets the ProtectionContainerRefreshOperationResultsInner object to access its operations. + * @return the ProtectionContainerRefreshOperationResultsInner object. + */ + public ProtectionContainerRefreshOperationResultsInner protectionContainerRefreshOperationResults() { + return this.protectionContainerRefreshOperationResults; + } + + /** + * The ProtectionContainersInner object to access its operations. + */ + private ProtectionContainersInner protectionContainers; + + /** + * Gets the ProtectionContainersInner object to access its operations. + * @return the ProtectionContainersInner object. + */ + public ProtectionContainersInner protectionContainers() { + return this.protectionContainers; + } + + /** + * The RecoveryPointsInner object to access its operations. + */ + private RecoveryPointsInner recoveryPoints; + + /** + * Gets the RecoveryPointsInner object to access its operations. + * @return the RecoveryPointsInner object. + */ + public RecoveryPointsInner recoveryPoints() { + return this.recoveryPoints; + } + + /** + * The BackupsInner object to access its operations. + */ + private BackupsInner backups; + + /** + * Gets the BackupsInner object to access its operations. + * @return the BackupsInner object. + */ + public BackupsInner backups() { + return this.backups; + } + + /** + * The ProtectedItemOperationStatusesInner object to access its operations. + */ + private ProtectedItemOperationStatusesInner protectedItemOperationStatuses; + + /** + * Gets the ProtectedItemOperationStatusesInner object to access its operations. + * @return the ProtectedItemOperationStatusesInner object. + */ + public ProtectedItemOperationStatusesInner protectedItemOperationStatuses() { + return this.protectedItemOperationStatuses; + } + + /** + * The ProtectedItemOperationResultsInner object to access its operations. + */ + private ProtectedItemOperationResultsInner protectedItemOperationResults; + + /** + * Gets the ProtectedItemOperationResultsInner object to access its operations. + * @return the ProtectedItemOperationResultsInner object. + */ + public ProtectedItemOperationResultsInner protectedItemOperationResults() { + return this.protectedItemOperationResults; + } + + /** + * The ProtectedItemsInner object to access its operations. + */ + private ProtectedItemsInner protectedItems; + + /** + * Gets the ProtectedItemsInner object to access its operations. + * @return the ProtectedItemsInner object. + */ + public ProtectedItemsInner protectedItems() { + return this.protectedItems; + } + + /** + * The ProtectableItemsInner object to access its operations. + */ + private ProtectableItemsInner protectableItems; + + /** + * Gets the ProtectableItemsInner object to access its operations. + * @return the ProtectableItemsInner object. + */ + public ProtectableItemsInner protectableItems() { + return this.protectableItems; + } + + /** + * The ExportJobsOperationResultsInner object to access its operations. + */ + private ExportJobsOperationResultsInner exportJobsOperationResults; + + /** + * Gets the ExportJobsOperationResultsInner object to access its operations. + * @return the ExportJobsOperationResultsInner object. + */ + public ExportJobsOperationResultsInner exportJobsOperationResults() { + return this.exportJobsOperationResults; + } + + /** + * The JobOperationResultsInner object to access its operations. + */ + private JobOperationResultsInner jobOperationResults; + + /** + * Gets the JobOperationResultsInner object to access its operations. + * @return the JobOperationResultsInner object. + */ + public JobOperationResultsInner jobOperationResults() { + return this.jobOperationResults; + } + + /** + * 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 JobCancellationsInner object to access its operations. + */ + private JobCancellationsInner jobCancellations; + + /** + * Gets the JobCancellationsInner object to access its operations. + * @return the JobCancellationsInner object. + */ + public JobCancellationsInner jobCancellations() { + return this.jobCancellations; + } + + /** + * The JobDetailsInner object to access its operations. + */ + private JobDetailsInner jobDetails; + + /** + * Gets the JobDetailsInner object to access its operations. + * @return the JobDetailsInner object. + */ + public JobDetailsInner jobDetails() { + return this.jobDetails; + } + + /** + * The BackupOperationStatusesInner object to access its operations. + */ + private BackupOperationStatusesInner backupOperationStatuses; + + /** + * Gets the BackupOperationStatusesInner object to access its operations. + * @return the BackupOperationStatusesInner object. + */ + public BackupOperationStatusesInner backupOperationStatuses() { + return this.backupOperationStatuses; + } + + /** + * The BackupOperationResultsInner object to access its operations. + */ + private BackupOperationResultsInner backupOperationResults; + + /** + * Gets the BackupOperationResultsInner object to access its operations. + * @return the BackupOperationResultsInner object. + */ + public BackupOperationResultsInner backupOperationResults() { + return this.backupOperationResults; + } + + /** + * The BackupEnginesInner object to access its operations. + */ + private BackupEnginesInner backupEngines; + + /** + * Gets the BackupEnginesInner object to access its operations. + * @return the BackupEnginesInner object. + */ + public BackupEnginesInner backupEngines() { + return this.backupEngines; + } + + /** + * Initializes an instance of RecoveryServicesBackupClient client. + * + * @param credentials the management credentials for Azure + */ + public RecoveryServicesBackupClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of RecoveryServicesBackupClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public RecoveryServicesBackupClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of RecoveryServicesBackupClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public RecoveryServicesBackupClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-06-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.itemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsInner(restClient().retrofit(), this); + this.restores = new RestoresInner(restClient().retrofit(), this); + this.protectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesInner(restClient().retrofit(), this); + this.protectionPolicyOperationResults = new ProtectionPolicyOperationResultsInner(restClient().retrofit(), this); + this.protectionPolicies = new ProtectionPoliciesInner(restClient().retrofit(), this); + this.protectionContainerOperationResults = new ProtectionContainerOperationResultsInner(restClient().retrofit(), this); + this.protectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsInner(restClient().retrofit(), this); + this.protectionContainers = new ProtectionContainersInner(restClient().retrofit(), this); + this.recoveryPoints = new RecoveryPointsInner(restClient().retrofit(), this); + this.backups = new BackupsInner(restClient().retrofit(), this); + this.protectedItemOperationStatuses = new ProtectedItemOperationStatusesInner(restClient().retrofit(), this); + this.protectedItemOperationResults = new ProtectedItemOperationResultsInner(restClient().retrofit(), this); + this.protectedItems = new ProtectedItemsInner(restClient().retrofit(), this); + this.protectableItems = new ProtectableItemsInner(restClient().retrofit(), this); + this.exportJobsOperationResults = new ExportJobsOperationResultsInner(restClient().retrofit(), this); + this.jobOperationResults = new JobOperationResultsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.jobCancellations = new JobCancellationsInner(restClient().retrofit(), this); + this.jobDetails = new JobDetailsInner(restClient().retrofit(), this); + this.backupOperationStatuses = new BackupOperationStatusesInner(restClient().retrofit(), this); + this.backupOperationResults = new BackupOperationResultsInner(restClient().retrofit(), this); + this.backupEngines = new BackupEnginesInner(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)", super.userAgent(), "RecoveryServicesBackupClient", "2016-06-01"); + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryServicesManager.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryServicesManager.java new file mode 100644 index 000000000000..978732519c53 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RecoveryServicesManager.java @@ -0,0 +1,353 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ItemLevelRecoveryConnections; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Restores; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicyOperationStatuses; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicyOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionPolicies; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainerRefreshOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectionContainers; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.RecoveryPoints; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Backups; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemOperationStatuses; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItemOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectedItems; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ProtectableItems; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.ExportJobsOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Jobs; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobCancellations; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.JobDetails; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupOperationStatuses; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupOperationResults; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.BackupEngines; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure RecoveryServices resource management. + */ +public final class RecoveryServicesManager extends ManagerCore { + private ItemLevelRecoveryConnections itemLevelRecoveryConnections; + private Restores restores; + private ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses; + private ProtectionPolicyOperationResults protectionPolicyOperationResults; + private ProtectionPolicies protectionPolicies; + private ProtectionContainerOperationResults protectionContainerOperationResults; + private ProtectionContainerRefreshOperationResults protectionContainerRefreshOperationResults; + private ProtectionContainers protectionContainers; + private RecoveryPoints recoveryPoints; + private Backups backups; + private ProtectedItemOperationStatuses protectedItemOperationStatuses; + private ProtectedItemOperationResults protectedItemOperationResults; + private ProtectedItems protectedItems; + private ProtectableItems protectableItems; + private ExportJobsOperationResults exportJobsOperationResults; + private JobOperationResults jobOperationResults; + private Jobs jobs; + private JobCancellations jobCancellations; + private JobDetails jobDetails; + private BackupOperationStatuses backupOperationStatuses; + private BackupOperationResults backupOperationResults; + private BackupEngines backupEngines; + /** + * Get a Configurable instance that can be used to create RecoveryServicesManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new RecoveryServicesManager.ConfigurableImpl(); + } + /** + * Creates an instance of RecoveryServicesManager that exposes RecoveryServices resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the RecoveryServicesManager + */ + public static RecoveryServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new RecoveryServicesManager(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 RecoveryServicesManager that exposes RecoveryServices resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the RecoveryServicesManager + */ + public static RecoveryServicesManager authenticate(RestClient restClient, String subscriptionId) { + return new RecoveryServicesManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of RecoveryServicesManager that exposes RecoveryServices management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing RecoveryServices management API entry points that work across subscriptions + */ + RecoveryServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ItemLevelRecoveryConnections. + */ + public ItemLevelRecoveryConnections itemLevelRecoveryConnections() { + if (this.itemLevelRecoveryConnections == null) { + this.itemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsImpl(this); + } + return this.itemLevelRecoveryConnections; + } + + /** + * @return Entry point to manage Restores. + */ + public Restores restores() { + if (this.restores == null) { + this.restores = new RestoresImpl(this); + } + return this.restores; + } + + /** + * @return Entry point to manage ProtectionPolicyOperationStatuses. + */ + public ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses() { + if (this.protectionPolicyOperationStatuses == null) { + this.protectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesImpl(this); + } + return this.protectionPolicyOperationStatuses; + } + + /** + * @return Entry point to manage ProtectionPolicyOperationResults. + */ + public ProtectionPolicyOperationResults protectionPolicyOperationResults() { + if (this.protectionPolicyOperationResults == null) { + this.protectionPolicyOperationResults = new ProtectionPolicyOperationResultsImpl(this); + } + return this.protectionPolicyOperationResults; + } + + /** + * @return Entry point to manage ProtectionPolicies. + */ + public ProtectionPolicies protectionPolicies() { + if (this.protectionPolicies == null) { + this.protectionPolicies = new ProtectionPoliciesImpl(this); + } + return this.protectionPolicies; + } + + /** + * @return Entry point to manage ProtectionContainerOperationResults. + */ + public ProtectionContainerOperationResults protectionContainerOperationResults() { + if (this.protectionContainerOperationResults == null) { + this.protectionContainerOperationResults = new ProtectionContainerOperationResultsImpl(this); + } + return this.protectionContainerOperationResults; + } + + /** + * @return Entry point to manage ProtectionContainerRefreshOperationResults. + */ + public ProtectionContainerRefreshOperationResults protectionContainerRefreshOperationResults() { + if (this.protectionContainerRefreshOperationResults == null) { + this.protectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsImpl(this); + } + return this.protectionContainerRefreshOperationResults; + } + + /** + * @return Entry point to manage ProtectionContainers. + */ + public ProtectionContainers protectionContainers() { + if (this.protectionContainers == null) { + this.protectionContainers = new ProtectionContainersImpl(this); + } + return this.protectionContainers; + } + + /** + * @return Entry point to manage RecoveryPoints. + */ + public RecoveryPoints recoveryPoints() { + if (this.recoveryPoints == null) { + this.recoveryPoints = new RecoveryPointsImpl(this); + } + return this.recoveryPoints; + } + + /** + * @return Entry point to manage Backups. + */ + public Backups backups() { + if (this.backups == null) { + this.backups = new BackupsImpl(this); + } + return this.backups; + } + + /** + * @return Entry point to manage ProtectedItemOperationStatuses. + */ + public ProtectedItemOperationStatuses protectedItemOperationStatuses() { + if (this.protectedItemOperationStatuses == null) { + this.protectedItemOperationStatuses = new ProtectedItemOperationStatusesImpl(this); + } + return this.protectedItemOperationStatuses; + } + + /** + * @return Entry point to manage ProtectedItemOperationResults. + */ + public ProtectedItemOperationResults protectedItemOperationResults() { + if (this.protectedItemOperationResults == null) { + this.protectedItemOperationResults = new ProtectedItemOperationResultsImpl(this); + } + return this.protectedItemOperationResults; + } + + /** + * @return Entry point to manage ProtectedItems. + */ + public ProtectedItems protectedItems() { + if (this.protectedItems == null) { + this.protectedItems = new ProtectedItemsImpl(this); + } + return this.protectedItems; + } + + /** + * @return Entry point to manage ProtectableItems. + */ + public ProtectableItems protectableItems() { + if (this.protectableItems == null) { + this.protectableItems = new ProtectableItemsImpl(this); + } + return this.protectableItems; + } + + /** + * @return Entry point to manage ExportJobsOperationResults. + */ + public ExportJobsOperationResults exportJobsOperationResults() { + if (this.exportJobsOperationResults == null) { + this.exportJobsOperationResults = new ExportJobsOperationResultsImpl(this); + } + return this.exportJobsOperationResults; + } + + /** + * @return Entry point to manage JobOperationResults. + */ + public JobOperationResults jobOperationResults() { + if (this.jobOperationResults == null) { + this.jobOperationResults = new JobOperationResultsImpl(this); + } + return this.jobOperationResults; + } + + /** + * @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 JobCancellations. + */ + public JobCancellations jobCancellations() { + if (this.jobCancellations == null) { + this.jobCancellations = new JobCancellationsImpl(this); + } + return this.jobCancellations; + } + + /** + * @return Entry point to manage JobDetails. + */ + public JobDetails jobDetails() { + if (this.jobDetails == null) { + this.jobDetails = new JobDetailsImpl(this); + } + return this.jobDetails; + } + + /** + * @return Entry point to manage BackupOperationStatuses. + */ + public BackupOperationStatuses backupOperationStatuses() { + if (this.backupOperationStatuses == null) { + this.backupOperationStatuses = new BackupOperationStatusesImpl(this); + } + return this.backupOperationStatuses; + } + + /** + * @return Entry point to manage BackupOperationResults. + */ + public BackupOperationResults backupOperationResults() { + if (this.backupOperationResults == null) { + this.backupOperationResults = new BackupOperationResultsImpl(this); + } + return this.backupOperationResults; + } + + /** + * @return Entry point to manage BackupEngines. + */ + public BackupEngines backupEngines() { + if (this.backupEngines == null) { + this.backupEngines = new BackupEnginesImpl(this); + } + return this.backupEngines; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public RecoveryServicesManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return RecoveryServicesManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private RecoveryServicesManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new RecoveryServicesBackupClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RestoresImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RestoresImpl.java new file mode 100644 index 000000000000..ee0e07b47e37 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RestoresImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + * abc + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Restores; +import rx.Completable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.RestoreRequestResource; + +class RestoresImpl extends WrapperImpl implements Restores { + private final RecoveryServicesManager manager; + + RestoresImpl(RecoveryServicesManager manager) { + super(manager.inner().restores()); + this.manager = manager; + } + + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Completable triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource resourceRestoreRequest) { + RestoresInner client = this.inner(); + return client.triggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceRestoreRequest).toCompletable(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RestoresInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RestoresInner.java new file mode 100644 index 000000000000..f2fdc5f4166c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/RestoresInner.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.RestoreRequestResource; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Restores. + */ +public class RestoresInner { + /** The Retrofit service to perform REST calls. */ + private RestoresService service; + /** The service client containing this operation class. */ + private RecoveryServicesBackupClientImpl client; + + /** + * Initializes an instance of RestoresInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RestoresInner(Retrofit retrofit, RecoveryServicesBackupClientImpl client) { + this.service = retrofit.create(RestoresService.class); + this.client = client; + } + + /** + * The interface defining all the services for Restores to be + * used by Retrofit to perform actually REST calls. + */ + interface RestoresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.Restores trigger" }) + @POST("Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore") + Observable> trigger(@Path("vaultName") String vaultName, @Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("fabricName") String fabricName, @Path("containerName") String containerName, @Path("protectedItemName") String protectedItemName, @Path("recoveryPointId") String recoveryPointId, @Query("api-version") String apiVersion, @Body RestoreRequestResource resourceRestoreRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Restores the specified backup data. This is an asynchronous operation. To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The backup item to be restored. + * @param recoveryPointId The recovery point ID for the backup data to be restored. + * @param resourceRestoreRequest The resource restore 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 + */ + public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource resourceRestoreRequest) { + triggerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceRestoreRequest).toBlocking().single().body(); + } + + /** + * Restores the specified backup data. This is an asynchronous operation. To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The backup item to be restored. + * @param recoveryPointId The recovery point ID for the backup data to be restored. + * @param resourceRestoreRequest The resource restore 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 triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource resourceRestoreRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(triggerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceRestoreRequest), serviceCallback); + } + + /** + * Restores the specified backup data. This is an asynchronous operation. To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The backup item to be restored. + * @param recoveryPointId The recovery point ID for the backup data to be restored. + * @param resourceRestoreRequest The resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource resourceRestoreRequest) { + return triggerWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, resourceRestoreRequest).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restores the specified backup data. This is an asynchronous operation. To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param vaultName The name of the Recovery Services vault. + * @param resourceGroupName The name of the resource group associated with the Recovery Services vault. + * @param fabricName The fabric name associated with the backup items. + * @param containerName The container name associated with the backup items. + * @param protectedItemName The backup item to be restored. + * @param recoveryPointId The recovery point ID for the backup data to be restored. + * @param resourceRestoreRequest The resource restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> triggerWithServiceResponseAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource resourceRestoreRequest) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (fabricName == null) { + throw new IllegalArgumentException("Parameter fabricName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName is required and cannot be null."); + } + if (protectedItemName == null) { + throw new IllegalArgumentException("Parameter protectedItemName is required and cannot be null."); + } + if (recoveryPointId == null) { + throw new IllegalArgumentException("Parameter recoveryPointId 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 (resourceRestoreRequest == null) { + throw new IllegalArgumentException("Parameter resourceRestoreRequest is required and cannot be null."); + } + Validator.validate(resourceRestoreRequest); + return service.trigger(vaultName, resourceGroupName, this.client.subscriptionId(), fabricName, containerName, protectedItemName, recoveryPointId, this.client.apiVersion(), resourceRestoreRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = triggerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse triggerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultJobResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultJobResourceImpl.java new file mode 100644 index 000000000000..f45f3c66cd3c --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultJobResourceImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultJobResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class VaultJobResourceImpl extends WrapperImpl implements VaultJobResource { + private final RecoveryServicesManager manager; + + VaultJobResourceImpl(JobResourceInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public JobInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultJobResourceModelImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultJobResourceModelImpl.java new file mode 100644 index 000000000000..bd3d25239482 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultJobResourceModelImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultJobResourceModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class VaultJobResourceModelImpl extends IndexableRefreshableWrapperImpl implements VaultJobResourceModel { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String jobName; + + VaultJobResourceModelImpl(JobResourceInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.jobName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupJobs"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + JobDetailsInner client = this.manager().inner().jobDetails(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.jobName); + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public JobInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultOperationStatusImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultOperationStatusImpl.java new file mode 100644 index 000000000000..5dfe5e4700c6 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultOperationStatusImpl.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultOperationStatus; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusError; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusExtendedInfo; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.OperationStatusValues; + +class VaultOperationStatusImpl extends IndexableRefreshableWrapperImpl implements VaultOperationStatus { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String operationId; + + VaultOperationStatusImpl(OperationStatusInner inner, RecoveryServicesManager manager) { + super(null, inner); + this.manager = manager; + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.operationId = IdParsingUtils.getValueFromIdByName(inner.id(), "backupOperations"); + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + BackupOperationStatusesInner client = this.manager().inner().backupOperationStatuses(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.operationId); + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public OperationStatusError error() { + return this.inner().error(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public OperationStatusExtendedInfo properties() { + return this.inner().properties(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public OperationStatusValues status() { + return this.inner().status(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultProtectedItemResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultProtectedItemResourceImpl.java new file mode 100644 index 000000000000..fa69246557b7 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultProtectedItemResourceImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultProtectedItemResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; +import java.util.Map; + +class VaultProtectedItemResourceImpl extends WrapperImpl implements VaultProtectedItemResource { + private final RecoveryServicesManager manager; + + VaultProtectedItemResourceImpl(ProtectedItemResourceInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectedItemInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultProtectionPolicyResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultProtectionPolicyResourceImpl.java new file mode 100644 index 000000000000..1876a4790d6a --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/VaultProtectionPolicyResourceImpl.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.VaultProtectionPolicyResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.; + +class VaultProtectionPolicyResourceImpl extends CreatableUpdatableImpl implements VaultProtectionPolicyResource, VaultProtectionPolicyResource.Definition, VaultProtectionPolicyResource.Update { + private final RecoveryServicesManager manager; + private String vaultName; + private String resourceGroupName; + private String policyName; + + VaultProtectionPolicyResourceImpl(String name, RecoveryServicesManager manager) { + super(name, new ProtectionPolicyResourceInner()); + this.manager = manager; + // Set resource name + this.policyName = name; + // + } + + VaultProtectionPolicyResourceImpl(ProtectionPolicyResourceInner inner, RecoveryServicesManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.policyName = inner.name(); + // resource ancestor names + this.vaultName = IdParsingUtils.getValueFromIdByName(inner.id(), "vaults"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.policyName = IdParsingUtils.getValueFromIdByName(inner.id(), "backupPolicies"); + // + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ProtectionPoliciesInner client = this.manager().inner().protectionPolicies(); + return client.createOrUpdateAsync(this.vaultName, this.resourceGroupName, this.policyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ProtectionPoliciesInner client = this.manager().inner().protectionPolicies(); + return client.createOrUpdateAsync(this.vaultName, this.resourceGroupName, this.policyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ProtectionPoliciesInner client = this.manager().inner().protectionPolicies(); + return client.getAsync(this.vaultName, this.resourceGroupName, this.policyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProtectionPolicyInner properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VaultProtectionPolicyResourceImpl withExistingVault(String vaultName, String resourceGroupName) { + this.vaultName = vaultName; + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public VaultProtectionPolicyResourceImpl withETag(String eTag) { + this.inner().withETag(eTag); + return this; + } + + @Override + public VaultProtectionPolicyResourceImpl withId(String id) { + this.inner().withId(id); + return this; + } + + @Override + public VaultProtectionPolicyResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VaultProtectionPolicyResourceImpl withName(String name) { + this.inner().withName(name); + return this; + } + + @Override + public VaultProtectionPolicyResourceImpl withProperties(ProtectionPolicyInner properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public VaultProtectionPolicyResourceImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public VaultProtectionPolicyResourceImpl withType(String type) { + this.inner().withType(type); + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/WorkloadProtectableItemResourceImpl.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/WorkloadProtectableItemResourceImpl.java new file mode 100644 index 000000000000..554e930f14ce --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/WorkloadProtectableItemResourceImpl.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 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.WorkloadProtectableItemResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.WorkloadProtectableItem; +import java.util.Map; + +class WorkloadProtectableItemResourceImpl extends WrapperImpl implements WorkloadProtectableItemResource { + private final RecoveryServicesManager manager; + + WorkloadProtectableItemResourceImpl(WorkloadProtectableItemResourceInner inner, RecoveryServicesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public RecoveryServicesManager manager() { + return this.manager; + } + + + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public WorkloadProtectableItem properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/WorkloadProtectableItemResourceInner.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/WorkloadProtectableItemResourceInner.java new file mode 100644 index 000000000000..ae72f999b276 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/WorkloadProtectableItemResourceInner.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; + +import com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.WorkloadProtectableItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The base class for the backup item. Workload-specific backup items are + * derived from this class. + */ +@SkipParentValidation +public class WorkloadProtectableItemResourceInner extends Resource { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private WorkloadProtectableItem properties; + + /** + * Optional ETag. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource ID represents the complete path to the resource. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Resource name associated with the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type represents the complete path of the form + * Namespace/ResourceType/ResourceType/... + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the properties value. + * + * @return the properties value + */ + public WorkloadProtectableItem properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the WorkloadProtectableItemResourceInner object itself. + */ + public WorkloadProtectableItemResourceInner withProperties(WorkloadProtectableItem properties) { + this.properties = properties; + return this; + } + + /** + * Get optional ETag. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set optional ETag. + * + * @param eTag the eTag value to set + * @return the WorkloadProtectableItemResourceInner object itself. + */ + public WorkloadProtectableItemResourceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource ID represents the complete path to the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID represents the complete path to the resource. + * + * @param id the id value to set + * @return the WorkloadProtectableItemResourceInner object itself. + */ + public WorkloadProtectableItemResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get resource name associated with the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set resource name associated with the resource. + * + * @param name the name value to set + * @return the WorkloadProtectableItemResourceInner object itself. + */ + public WorkloadProtectableItemResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... + * + * @param type the type value to set + * @return the WorkloadProtectableItemResourceInner object itself. + */ + public WorkloadProtectableItemResourceInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/package-info.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/package-info.java new file mode 100644 index 000000000000..74e0a2156731 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for RecoveryServicesBackupClient. + * Open API 2.0 Specs for Azure RecoveryServices Backup service. + */ +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01.implementation; diff --git a/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/package-info.java b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/package-info.java new file mode 100644 index 000000000000..3797421aa6a2 --- /dev/null +++ b/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator 2.3.31.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for RecoveryServicesBackupClient. + * Open API 2.0 Specs for Azure RecoveryServices Backup service. + */ +package com.microsoft.azure.management.recoveryservices.backup.v2016_06_01;